Commit graph

1632 commits

Author SHA1 Message Date
Russell Jones 5d5c3de588 Updated TLS ciphersuites and updated SSH ciphers, KEX, and MAC
algorithms in forwarding server.
2018-05-25 21:29:33 +00:00
Russell Jones 9044cbe015 Increase size of connection pool. 2018-05-17 23:24:53 +00:00
Russell Jones 19b2936514 Update default cryptographic primitives. 2018-05-08 14:47:07 -07:00
Sasha Klizhentas 309e06766d Check for format type and fix help string 2018-05-08 12:27:45 -07:00
Russell Jones cd0d0f49ee Consolidate token validation code. 2018-05-08 10:34:45 -07:00
Sasha Klizhentas ddd5150dd3 Introduce additional phase to CA rotation.
Flaky tests in teleport integration suite uncovered a problem.
It is possible that main cluster rotates certificate authority,
and will try to dial to the remote cluster with new credentials
before the remote cluster could fetch the new CA to trust.

To fix this, phase "update_clients" was split in two phases:

* Init and Update clients

Init phase does nothing on the main cluster except generating
new certificate authorities, that are trusted but not used in the
cluster.

This phase exists to give remote clusters opporunity
to update the list of trusted certificate authorities
of the main cluster, before main cluster reconnects with new clients
in "Update clients" phase.
2018-05-07 15:23:28 -07:00
Russell Jones 90f9115b67 Shortened key names. 2018-05-07 14:31:06 -07:00
Russell Jones 3fb773bd90 Wrap error message in raw envelope so it can be displayed in web
terminal.
2018-05-07 14:20:13 -07:00
Russell Jones 72be842b05 Propagate closing context to login handler. 2018-05-07 13:39:38 -07:00
Sasha Klizhentas 0df4bcbad2 Fix rotation after migration.
Rotation on CA could not be performed on data migrated
from 2.5 versions, because they do not have rotation
property.

This commit fixes the problem by making rotation
property optional.
2018-05-05 12:02:19 -07:00
Russell Jones fafb31741e Use libpam.so.0 instead of libpam.so. 2018-05-05 00:44:32 +00:00
Sasha Klizhentas 074961892a Precompute keys only for auth and proxies.
This commit fixes #1886

Previously the code was precomputing keys
even for SSH nodes, that do not need precomputed
private keys pool.
2018-05-04 13:41:13 -07:00
Russell Jones 876e04af07 * Push window size changes to clients instead of polling.
* Cache services.ClusterConfig within srv.ServerContext for the duration
  of a connection.
* Create a single websocket between the browser and the proxy for all
* terminal bytes and events.
2018-05-04 18:28:36 +00:00
Ev Kontsevoy 9c0d7296a5 Improved error message for tsh status
Closes #1906
2018-05-03 17:32:13 -07:00
Sasha Klizhentas 7f3c35f00d Bring back some deleted methods 2018-05-03 17:12:52 -07:00
Sasha Klizhentas 350ccc3ecd Delete code deprecated in 2.6.0
This commit fixes #1805
2018-05-03 16:44:39 -07:00
Sasha Klizhentas daff8de6ef Switch to default dir backend.
This commit fixes #1741

* If bolt backend was used as a default,
new teleport continues using it as a default to prevent
regressions on start.

* Otherwise, dir backend is used as a default.
2018-05-03 11:06:08 -07:00
Sasha Klizhentas a4c86e0603 Add public_addr support for auth and ssh services.
This commit fixes #1803, fixes #1889

* Adds support for public_addr for Proxy and Auth
* Parameter advertise_ip now supports host:port format
* Fixes incorrect output for tctl get proxies
* Fixes duplicate output of some error messages.
2018-05-02 18:04:05 -07:00
Sasha Klizhentas a75034f256 Serialize parallel downloads, fixes #1774
In case if multiple requests to get session
event data were issued to the auth server
at the same time, multiple download requests
were originated, and sometimes partial data
was returned.

This commit serializes downloads of the session
in the context of the same auth server.
2018-05-02 09:31:14 -07:00
Sasha Klizhentas 3e144cb900 Teleport certificate authority rotation.
This commit implements #1860

During the the rotation procedure issuing TLS and SSH
certificate authorities are re-generated and all internal
components of the cluster re-register to get new
credentials.

The rotation procedure is based on a distributed
state machine algorithm - certificate authorities have
explicit rotation state and all parts of the cluster sync
local state machines by following transitions between phases.

Operator can launch CA rotation in auto or manual modes.

In manual mode operator moves cluster bewtween rotation states
and watches the states of the components to sync.

In auto mode state transitions are happening automatically
on a specified schedule.

The design documentation is embedded in the code:

lib/auth/rotate.go
2018-04-30 12:58:57 -07:00
Alexey Kontsevoy feefffcd8c do not use 22 port by default when ssh from web ui 2018-04-26 11:54:59 -04:00
Ev Kontsevoy 1fd6813961 Change the default idle timeout for SSH sessions
From 20 minutes to 15 minutes to be PCI compliant by default.
Closes #1851
2018-04-24 14:52:23 -07:00
Russell Jones 35d4fbbae7 Added "tsh status" command. 2018-04-16 10:23:28 -07:00
Sasha Klizhentas 5d4c527eee Better error message in trusted clusters. 2018-04-06 10:13:03 -07:00
Sasha Klizhentas c3919c79e3 Fix panic in tests.
Fixes #1836

When events.DiskSessionLogger.Finalize() is called
twice, the panic was happening.

At the same time it turns out the old buffering
logic is obsolete, as teleport always writes to disk,
so it was removed.
2018-04-05 16:26:20 -07:00
Russell Jones 6be8af16c5 Removed depreciated code and re-factored tests to use
golang.org/x/crypto.
2018-04-05 23:14:20 +00:00
Russell Jones bfb4c41891 Refactor code use updated interfaces for golang.org/x/crypto/ssh. 2018-04-05 22:49:46 +00:00
Sasha Klizhentas 2b1175fea5 Write PID file before signal the parent process.
This fixes the race with systemd reload.

P - parent, C - child

During live reload scenario,
the following happens:

P -> forks C
P -> blocks  on pipe read
C -> writes to  pipe
C -> writes pid file
P < - reads message from pipe
P <- shuts down

However, there is a race:

P -> forks C
P -> blocks  on pipe read
C -> writes to pipe
P < - reads message from pipe
P <- shuts down
C -> writes pid file

In this case parent process exited
before child process writes new pid file
what makes systemd think that main process
is down and stop both processes.

This fix changes the sequence to:

P -> forks C
P -> blocks on pipe read
C -> writes pid file
C -> writes to pipe
P < - reads message from pipe
P <- shuts down

to make sure the race can't happen any more.
2018-04-04 16:21:23 -07:00
Russell Jones 3c80ce1c62 Fixed SIGINT handling when no network connectivity exists and when
running an "exec" request without a TTY.
2018-04-04 18:02:37 +00:00
Sasha Klizhentas 533b45bdff Use signal pipe to make live reload better.
This commit allows teleport parent process to track
the status of the forked child process using os.Pipe.

Child process signals success to parent process by writing
to Pipe.

This allows HUP and USR2 to be more intelligent as they
can now detect the failure or success of the process.
2018-04-03 17:25:43 -07:00
Russell Jones 9454d0133a Create context once either "session" or "direct-tcpip" channel has been
opened in the forwarding server.
2018-04-02 15:04:48 -07:00
Sasha Klizhentas 0515e5abc3 Fix not found event. 2018-03-30 16:05:53 -07:00
Sasha Klizhentas 9af093e6f6 Introduce new upload API.
This PR improves session recording:

* Nodes and proxies always buffer recorded sessions
to disk during the session what improves performance
and makes the recording more resilient to network failures.

* Async uploader running on proxy or node always uploads the
session tarball to the audit log server.

* Audit log server is the only component uploading
to the S3 or any other API.
2018-03-29 15:15:05 -07:00
Russell Jones ff436e2339 Updated error logging. 2018-03-26 17:55:43 -07:00
Sasha Klizhentas 078a4d01fc Check if S3 bucket exists first. 2018-03-26 16:35:48 -07:00
dmitri f3754833da Map error to errno value and log it 2018-03-26 23:28:58 +02:00
dmitri 13be44272a Avoid resetting the SIGINT handler if it has not actually been set to
ignore (Go's runtime respects SIG_IGN, btw, by not setting a handler).

If the handler is reset unconditionally, no Go code can ask to be
notified of Interrupt signal as the system default handler obviously
knows nothing about Go code.
2018-03-26 23:10:14 +02:00
Sasha Klizhentas 8898f4235d Add support for paths in S3 URI uploader. 2018-03-26 09:18:36 -07:00
Russell Jones 523ad0b01c When unable to accept channel, write to logs, return error to user, and
return.
2018-03-23 00:52:26 +00:00
Russell Jones 6d7634a577 Update global dial timeout to 30 seconds. 2018-03-22 18:24:49 +00:00
Russell Jones e06521dfe6 Use pagination when pulling back list of teams from GitHub. 2018-03-21 23:58:31 +00:00
Sasha Klizhentas 0f43c4935d Turn off proxy support when no-tls is used.
Fixes #1800
2018-03-20 17:55:39 -07:00
Russell Jones 40c9755b3e Corrected signup URL note. 2018-03-20 16:50:17 -07:00
Russell Jones 785967e37f Added PAM support to Teleport. 2018-03-20 14:20:43 -07:00
Sasha Klizhentas 7d05c05b5b Fix logging, collect status of forked processes
fixes #1785, fixes #1776

This commit fixes several issues with output:

First teleport start now prints output
matching quickstart guide and sets default
console logging to ERROR.

SIGCHLD handler now only collects
processes PID forked during live restart
to avoid confusing other wait calls that
have no process status to collect any more.
2018-03-19 16:46:10 -07:00
Russell Jones 8de02770ef Include nodename in the host certificate. 2018-03-16 22:01:44 +00:00
Sasha Klizhentas 1bcf8ae010 Run session migrations in the background.
Large directories with on disk recordings
take a lot of time to migrate, this patch
makes the operation async.

Do not use modification time for audit log
search, replace it with file name parsing.
2018-03-16 10:36:31 -07:00
Ev Kontsevoy 78139cc512 Updated log message 2018-03-15 17:06:32 -07:00
Sasha Klizhentas b234a54c93 Update e reference and release 2.6.0-alpha.0 2018-03-15 12:56:26 -07:00
Sasha Klizhentas bad1b0498d External events and sessions storage.
Updates #1755

Design
------

This commit adds support for pluggable events and
sessions recordings and adds several plugins.

In case if external sessions recording storage
is used, nodes or proxies depending on configuration
store the session recordings locally and
then upload the recordings in the background.

Non-print session events are always sent to the
remote auth server as usual.

In case if remote events storage is used, auth
servers download recordings from it during playbacks.

DynamoDB event backend
----------------------

Transient DynamoDB backend is added for events
storage. Events are stored with default TTL of 1 year.

External lambda functions should be used
to forward events from DynamoDB.

Parameter audit_table_name in storage section
turns on dynamodb backend.

The table will be auto created.

S3 sessions backend
-------------------

If audit_sessions_uri is specified to s3://bucket-name
node or proxy depending on recording mode
will start uploading the recorded sessions
to the bucket.

If the bucket does not exist, teleport will
attempt to create a bucket with versioning and encryption
turned on by default.

Teleport will turn on bucket-side encryption for the tarballs
using aws:kms key.

File sessions backend
---------------------

If audit_sessions_uri is specified to file:///folder
teleport will start writing tarballs to this folder instead
of sending records to the file server.

This is helpful for plugin writers who can use fuse or NFS
mounted storage to handle the data.

Working dynamic configuration.
2018-03-15 12:42:43 -07:00