Commit graph

56 commits

Author SHA1 Message Date
Russell Jones 6439f7f973 Support configurable cipher suites. 2018-07-23 10:29:28 -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
Sasha Klizhentas 68b65f5b24 Teleport signal handling and live reload.
This commit introduces signal handling.
Parent teleport process is now capable of forking
the child process and passing listeners file descriptors
to the child.

Parent process then can gracefully shutdown
by tracking the amount of current connections and
closing listeners once the amount goes to 0.

Here are the signals handled:

* USR2 signal will cause the parent to fork
a child process and pass listener file descriptors to it.
Child process will close unused file descriptors
and will bind to the used ones.

At this moment two processes - the parent
and the forked child process will be serving requests.
After looking at the traffic and the log files,
administrator can either shut down the parent process
or the child process if the child process is not functioning
as expected.

* TERM, INT signals will trigger graceful process shutdown.
Auth, node and proxy processes will wait until the amount
of active connections goes down to 0 and will exit after that.

* KILL, QUIT signals will cause immediate non-graceful
shutdown.

* HUP signal combines USR2 and TERM signals in a convenient
way: parent process will fork a child process and
self-initate graceful shutdown. This is a more convenient
than USR2/TERM sequence, but less agile and robust
as if the connection to the parent process drops, but
the new process exits with error, administrators
can lock themselves out of the environment.

Additionally, boltdb backend has to be phased out,
as it does not support read/writes by two concurrent
processes. This had required refactoring of the dir
backend to use file locking to allow inter-process
collaboration on read/write operations.
2018-02-13 15:18:47 -08:00
Sasha Klizhentas e88047c6da fix incorrect cluster name on the web handler 2018-01-03 10:40:44 -08:00
Sasha Klizhentas 0130c6aa41 Mutual TLS Auth server and clients.
This commit introduced mutual TLS authentication
for auth server API server.

Auth server multiplexes HTTP over SSH - existing
protocol and HTTP over TLS - new protocol
on the same listening socket.

Nodes and users authenticate with 2.5.0 Teleport
using TLS mutual TLS except backwards-compatibility
cases.
2017-12-27 11:37:19 -08:00
Russell Jones 37ab1596c4 Updated reverse tunnel to allow use to forwarding server. 2017-12-09 19:29:20 +00:00
Roman Tkachenko 143b834e57 Changes for the upcoming teleport pro:
* Allow external audit log plugins
* Add support for auth API server plugins
* Add license file path configuration parameter (not used in open-source)
* Extend audit log with user login events
2017-11-21 17:35:58 -08:00
mricher b58cb051e8
Correct various typos
This was fixed running the `misspell` linter in fix mode using
`gometalinter`. The exact command I ran was :
```
gometalinter --vendor --disable-all -E misspell --linter='misspell:misspell -w {path}:^(?P<path>.*?\.go):(?P<line>\d+):(?P<col>\d+):\s*(?P<message>.*)$' ./...
```

Some typo were fixed by hand on top of it.
2017-10-20 10:20:26 +02:00
Russell Jones 6a1c045fa6 Fix issue where users would get locked out when using OTP tokens. 2017-10-11 22:56:55 +00:00
Sasha Klizhentas 426d4a7a51 export web.TerminalRequest interfaces
* Export web.TerminalRequest
* Add option for interactive exec as a parameter
2017-09-22 11:58:30 -07:00
Russell Jones 2b60dd9354 Removed cert authority and reverse tunnel permission check for
trusted clusters.
2017-09-06 18:42:19 +00:00
Russell Jones 444d62ef8c Session access controls. 2017-08-26 00:55:20 +00:00
Sasha Klizhentas 8b81a0c384 Migrate to golang/dep for dependency management
Update following packages:

* Replace Sirupsen/log with sirupsen/log everywhere
* Update etcd client to 3.2.4
* Update docker/term to moby/term
* Update kr/pty to v1.0.0 release
* Update K8s client to 2.0
2017-08-22 15:30:30 -07:00
Russell Jones b4c805fe23 Re-factored cluster configuration. 2017-08-07 17:20:16 -07:00
Russell Jones 7e17b6f9a7 Added --compat=oldssh flag to generate user certificates without roles. 2017-06-20 16:57:56 -07:00
Russell Jones 2b10e53a1d Allow creating local users without second factor. 2017-03-22 15:06:40 -07:00
Russell Jones 2f70866e5a Added TrustedCluster resource. 2017-03-09 13:49:44 -08:00
Ev Kontsevoy cb71de08a6 Merge branch 'master' into ev/clusters 2017-02-25 00:46:28 -08:00
Ev Kontsevoy be52971437 Terminal resizing in the UI works for remote clusters
Fixes #778
2017-02-24 22:04:59 -08:00
Sasha Klizhentas d6ff6f6204 Configure web session duration, fixes #691
* Fix bug with OIDC powered sessions logged out after 10 minutes
* Adjust web sessions durations by taking roles into account
* Provide explicit TTL enforced on the server side for bearer tokens

Before this PR the web session TTL was measured using defaults,
10 minutes for local sessions and 1 hour for OIDC sessions and
the system relied on client to renew the bearer token.

With this change bearer token TTL is set to 10 minutes
and the entire web session will expire if not renewed before

The maximum session duration is set to 12 hours, if not
limited to a smaller value by roles in RBAC modules.
2017-02-17 16:16:44 -08:00
Sasha Klizhentas 1b91689e57 fixes 2017-02-11 10:48:29 -08:00
Sasha Klizhentas b569b04494 work in progress sessions 2017-02-10 18:55:51 -08:00
Ev Kontsevoy 730a44cfb4 Fixed web tests
... also fixed web session "closer" leak
2017-02-03 23:12:29 -08:00
Ev Kontsevoy 225a9a4d4c Moved HTTP client code from lib/web into lib/client
The purpose of this commit was to remove the lib/client dependency of
lib/web.

lib/client must be dependency-free in order to be reusable.

Next step: make the web UI use the same client code as the CLI. This
will remove a ton of duplicate code making Teleport audit surface area
much smaller.
2017-02-02 18:48:50 -08:00
Ev Kontsevoy ff2fd9ca47 Code review changes 2017-01-25 13:45:46 -08:00
Russell Jones 9e0c439927 Added TOTP support and deprecated HOTP support. New users are created with TOTP as the second factor, but HOTP backward compatibility is maintained by allowing users created before this commit to continue to log in with HOTP tokens. 2017-01-17 11:24:52 -08:00
Ev Kontsevoy 3c6325f283 Code refactoring before trying to fix #669
Web UI backend used very generic and hard to follow naming conventions,
like "connect" or "connectHandler" or "newHandlerRequest".

Renaming everything to something easier to follow, like "makeTerminal"
or "newTerminalRequest"

Even the source file is renamed from "connect.go" to "terminal.go"
2016-12-31 16:14:56 -08:00
Sasha Klizhentas 98e613a4ea web tests recovered 2016-12-30 13:25:35 -08:00
Sasha Klizhentas 8ab3add372 map OIDC scopes to roles, implements #620 2016-12-24 14:42:33 -08:00
Sasha Klizhentas 2dceb42547 Merge branch 'master' into sasha/rbac 2016-12-14 16:36:55 -08:00
Sasha Klizhentas 7e97b10032 add support for namespaces almost everywhere 2016-12-14 15:48:36 -08:00
Alex Charles 9e743f803a Some cleanup for PR. Mostly appId -> appID, U2f -> U2F 2016-12-08 02:23:51 -08:00
jcj83429 3030878807 cleanup unused constant, duplicate code, and commented out code 2016-11-28 23:03:29 -08:00
jcj83429 739308c5ae got u2f login working on the CLI client.
also grouped the u2f webapi endpoints together,
and fixed the default u2f AppID so it works out of the box
2016-10-22 20:43:44 -07:00
jcj83429 bb0a25d617 Implemented U2F authentication on the server side 2016-10-16 14:03:43 -07:00
jcj83429 b79c4cffba Implmented U2F registration and some of authentication on the server side
I know comments are very lacking right now. Once things are stable I will add
proper comments. Minimal manual testing of the U2F registration API was done
with a hardware U2F key. Some of the code may need to be cleaned up later to
remove excessively long variable names...

Currently we return an error rightaway if the username/password combo is wrong.
It's difficult to do U2F without revealing either whether a user exists or
whether the password is correct. Returning error immediately reveals whether
the user/password combo is valid, while waiting until we get a signed response
from the U2F device to announce whether the user/pass combo is valid can reveal
which users exist since we need to return a keyHandle in the U2F SignRequest
and generating fake keyHandles for nonexistent users can be difficult to get
right since there is no rigid format for keyHandle.
2016-10-13 23:51:16 -07:00
Roman Tkachenko 7d7b86e7aa Fix expired session cleanup 2016-10-12 13:40:08 -07:00
Ev Kontsevoy f6b2d56542 Fixed timer leak 2016-08-28 12:50:52 -07:00
Ev Kontsevoy ec880ae700 Fixed resource leaks and removed dead code
Refs #508
2016-08-21 23:19:09 -07:00
Ev Kontsevoy b175d92052 PR comments - implemented! 2016-05-07 21:51:35 -07:00
Ev Kontsevoy ce1c4d4a38 A great number of bugfixes:
- replay now works in both web and CLI
- fixed two nasty connection bugs in web sessions
- removed verbose logging/diagnostics
- refactoring of web code by Alexey
2016-05-03 21:30:17 -07:00
klizhentas d68e693cad migrate to trace errors 2016-04-12 11:07:14 -07:00
klizhentas e1808b8579 some interface adjustments 2016-04-10 13:29:32 -07:00
klizhentas bbb69cb598 fix leaking TunClient, fixes #312 2016-04-07 15:00:11 -07:00
klizhentas 65d7864f1d Update internal interfaces and expose web handler methods 2016-04-06 10:32:26 -07:00
klizhentas ca7e3820d7 This commit adds ability to preconfigure the cluster without running
auth server. This is needed when you configure cluster from scratch and
all nodes including auth server spin up simultaneously.

* Add tctl tools to generate keys and certificates

  + Command "tctl authorities gen" generates public and private keypair.
  + Command "tctl authorities gencert" generates public and private keypair signed
    by existng private key
  + Command "tctl authorities export" was modified to be able to export exisitng private
    CA keys to local storage

   All of these commands are hidden by default.

section "static configuration"

* Add ability to configure teleport from environment variable

Environment variable TELEPORT_CONFIG can contain base64 encoded
YAML file config file of the standard file format, so teleport will use it on start

* Add special secrets section to the config file

Section "secrets" was updated to support pre-configured trusted CA keys and pre-generated keys

* Add special rts hidden section to add support for provisioning
2016-03-28 12:58:34 -07:00
klizhentas 55388db74b migrate to time UUID in session log, fixes #266
this commit restricts session id and session party id to be time UUID v1
and uses this fact to create a sorted session log
2016-03-19 18:16:06 -07:00
klizhentas 03dc97ed1e Introduce failover and auth servers sync, refs #78
* clients to tun servers are now supporting failover on the client
* clients periodically pull and sync auth servers that are available in the cluster
* teleport stores the information about cluster state locally and reuses it on restart
2016-03-15 13:07:31 -07:00
klizhentas 1eb952b89f properly propagate HTTP errors, fixes #172 2016-03-07 17:05:57 -08:00
klizhentas 4cd90d7ee0 fix hostport problem when connecting to proxy 2016-03-07 10:06:42 -08:00