Commit Graph
70 Commits
Author SHA1 Message Date
Sasha Klizhentas b1f502a0f3 add ttl support for invite tokens, fixes #1474 2017-11-28 19:39:12 -08:00
Sasha Klizhentas f8dba76147 SSH/TLS multiplexer with Proxy protocol support
This commit aadds multiplexer library of SSH/TLS on the same
listener socket. The multiplexer detects the protocol by the first
3 bytes of the incoming connection and forwards wrapped
connection either to the SSH ot TLS listeners.

The library also supports PROXY line protocol
and wraps connection information with connection details
from the proxy line received by the server
2017-11-23 14:50:28 -08: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
Sasha Klizhentas 965c0e2848 address code review changes 2017-11-16 10:31:52 -08:00
Sasha Klizhentas fed7d2f116 fix audit log file leak, fixes #1433
This is a fix for file leak in audit log server caused
by design issue:

Session file descriptors in audit log were opened on demand
when the session event or byte stream chunk  was reported.

AuditLog server relied on SessionEnd event to close the
file descriptors associated with the session.

However, when SessionEnd event does not arrive (e.g.
there is a timeout or disconnect), the file descriptors
were not closed. This commit adds periodic clean up
of inactive sessions.

SessionEnd is now used as an optimization measure
to close the files, but is not used as the only
trigger to close files.

Now, inactive idle sessions, will close file descriptors
after periods of inactivity and will reopen the file
descriptors when the session activity resumes.

SessionLogger was not designed to open/close files
multiple times as it was reseting offsets
every time the session files were opened. This
change fixes this condition as well.
2017-11-15 18:39:27 -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
Sasha Klizhentas 9543bf2208 Merge branch 'master' into sasha/curiosity 2017-10-12 16:57:41 -07:00
Sasha Klizhentas 7b82e31150 add fast and slow pace tickers 2017-10-11 17:23:03 -07: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 f12024031a more work on logging and stats 2017-10-09 18:58:24 -07:00
Sasha Klizhentas eb4cfa12d9 refactoring complete 2017-10-08 23:07:39 -07:00
Sasha Klizhentas e12ec7422c refactoring 2017-10-05 17:29:31 -07:00
Alexey Kontsevoy 1193ae5bf3 addressing CR comments 2017-08-21 21:28:53 -04:00
Sasha Klizhentas bf211f5764 integration test 2017-05-19 19:03:28 -07:00
Sasha Klizhentas f8641681f6 SAML 2.0 initial implementation 2017-05-12 14:10:18 -07:00
Sasha Klizhentas 3c2570fa35 Sasha High Availability. 2017-04-07 16:54:15 -07:00
Russell Jones 95192e3777 Redirect timeout is 10 mins and redirect to error page on failed login. 2017-04-07 14:56:32 -07:00
Ev Kontsevoy 9a16ac4dff SSH keepalive implementation + refactoring
The base SSH server implementation now sends SSH keepalive at ta rate of
1/4 of "idle timeout" constant. The client properly responds to keepalive
pings.

The SSH client, instead of creating 2 goroutines for handling SSH
requests and SSH channels now uses the same (existing) goroutine with
for-loop + select statement.
2017-01-30 16:53:10 -08:00
Ev Kontsevoy 40caec6048 Converted boltbk to the new format
BoltDB backend is now compatible with how all backends should
initialize.

Also all BoltDB-specific code/constants have been consolidated inside of
`backend.boltbk` package.
2017-01-15 16:28:18 -08:00
Ev Kontsevoy e648bdc4dd Minor changes to the "dir" backend:
1. Nicer tests for locking
2. Bugfix around Acquirelock / Releaselock
2017-01-15 16:28:18 -08:00
Ev Kontsevoy ed8604f757 Semi-serious connection overhaul of Teleport SSH
- Added idle timeout handling to every SSH connection.
- A bit of code refactoring (removing unused code paths)

Most importantly:

Added a custom SSH handshake between SSH Teleport proxies
and SSH Teleport servers. This handshake sends a custom JSON payload
from a proxy to a server, allowing to exchange additional information,
like the true IP of a client.
2016-12-30 01:21:28 -08:00
Sasha Klizhentas 1fee2980f2 login attempts fix 2016-12-16 19:33:18 -08:00
Sasha Klizhentas 2dceb42547 Merge branch 'master' into sasha/rbac 2016-12-14 16:36:55 -08:00
Sasha Klizhentas c96c412542 add namespaces for sessions and events 2016-12-12 11:09:09 -08:00
Alex Charles 9e743f803a Some cleanup for PR. Mostly appId -> appID, U2f -> U2F 2016-12-08 02:23:51 -08:00
Ev Kontsevoy d549d884bc "Cluster snapshot" became "caching AP client"
Instead of trying to achieve a full "offline" operation, this commit
honestly converts previous attempts to a "caching access point client"
behavior.

Closes #554
2016-10-16 22:04:20 -07:00
Ev Kontsevoy b4a6a4f972 Cleaned up Teleport logging
* Downgraded many messages from `Debug` to `Info`
* Edited messages so they're not verbose and not too short
* Added "context" to some
* Added logical teleport component as [COMPONENT] at the beginning of
  many, making logs **vastly** easier to read.
* Added one more logging level option when creating Teleport (only
  Teleconsole uses it for now)

The output with 'info' severity now look extremely clean.
This is startup, for example:

```
INFO[0000] [AUTH]  Auth service is starting on turing:32829  file=utils/cli.go:107
INFO[0000] [SSH:auth] listening socket: 127.0.0.1:32829  file=sshutils/server.go:119
INFO[0000] [SSH:auth] is listening on 127.0.0.1:32829    file=sshutils/server.go:144
INFO[0000] [Proxy] Successfully registered with the cluster  file=utils/cli.go:107
INFO[0000] [Node] Successfully registered with the cluster  file=utils/cli.go:107
INFO[0000] [AUTH] keyAuth: 127.0.0.1:56886->127.0.0.1:32829, user=turing  file=auth/tun.go:370
WARN[0000] unable to load the auth server cache: open /tmp/cluster-teleconsole-client781495771/authservers.json: no such file or directory  file=auth/tun.go:594
INFO[0000] [SSH:auth] new connection 127.0.0.1:56886 -> 127.0.0.1:32829 vesion: SSH-2.0-Go  file=sshutils/server.go:205
INFO[0000] [AUTH] keyAuth: 127.0.0.1:56888->127.0.0.1:32829, user=turing.teleconsole-client  file=auth/tun.go:370
INFO[0000] [AUTH] keyAuth: 127.0.0.1:56890->127.0.0.1:32829, user=turing.teleconsole-client  file=auth/tun.go:370
INFO[0000] [Node] turing connected to the cluster 'teleconsole-client'  file=service/service.go:158
INFO[0000] [AUTH] keyAuth: 127.0.0.1:56892->127.0.0.1:32829, user=turing  file=auth/tun.go:370
INFO[0000] [SSH:auth] new connection 127.0.0.1:56890 -> 127.0.0.1:32829 vesion: SSH-2.0-Go  file=sshutils/server.go:205
INFO[0000] [SSH:auth] new connection 127.0.0.1:56888 -> 127.0.0.1:32829 vesion: SSH-2.0-Go  file=sshutils/server.go:205
INFO[0000] [Node] turing.teleconsole-client connected to the cluster 'teleconsole-client'  file=service/service.go:158
INFO[0000] [Node] turing.teleconsole-client connected to the cluster 'teleconsole-client'  file=service/service.go:158
INFO[0000] [SSH] received event(SSHIdentity)             file=service/service.go:436
INFO[0000] [SSH] received event(ProxyIdentity)           file=service/service.go:563
```
You can easily tell that auth, ssh node and proxy have successfully started.
2016-09-02 17:28:18 -07:00
Ev Kontsevoy 110e783d5c Killed some dead code 2016-08-16 22:27:46 -07:00
Ev Kontsevoy 9f9c586989 Account lock after N unsuccessful login attempts 2016-05-30 16:17:47 -07:00
Ev Kontsevoy b6f3fc529b Minor refactorings and configs for the vagrant environment 2016-05-12 20:57:36 -07:00
Ev Kontsevoy dab0ad347c Flexible tokens:
- Static never-expiring tokens
- TTL tokens
- Single-use tokens with TTL of 30 mins
2016-05-12 00:44:25 -07:00
Ev Kontsevoy b175d92052 PR comments - implemented! 2016-05-07 21:51:35 -07:00
Ev Kontsevoy 8cb2716373 Refactoring of reverse tunnel agent
- reduced number of goroutines
- reduced number of 'sleep constants', settling on just one:
  `defaults.HeartbeatPeriod`
- increased the interval

Fixes #358
2016-04-17 15:45:24 -07:00
Ev Kontsevoy 5575e350e8 Cosmetic code refactoring + clearer log messges 2016-04-11 23:00:40 -07:00
Ev Kontsevoy 8bbb14d03b Sped up tests 2016-04-07 18:29:07 -07:00
Ev Kontsevoy b7be49bc49 Added new integration test (not turned on yet) 2016-04-07 18:20:38 -07:00
klizhentas 84cade14c5 draft OIDC support 2016-04-02 22:20:51 -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 d42e122ef1 small fixes, refs #290
* do not populate auth servers advertising local ips
* fix annoying resize on session create
* decrease TTLs for active sessions and parties
2016-03-23 11:12:24 -07:00
klizhentas 9f48d32c1f Merge branch 'master' into ev/scp-bug 2016-03-22 11:26:09 -07:00
Ev Kontsevoy b36b3cde61 Merge remote-tracking branch 'origin/master' into taylor/docs
Conflicts:
	Makefile
	tool/tctl/main.go
2016-03-22 10:11:12 -07:00
Ev Kontsevoy e2c495bb76 Merge remote-tracking branch 'origin/master' into ev/scp-bug 2016-03-21 22:13:25 -07:00
klizhentas bb8924a795 enforce and check server token TTL, fixes #272 2016-03-19 12:37:21 -07:00
Ev Kontsevoy 6c9e14fceb Merge remote-tracking branch 'origin/master' into ev/docs
Conflicts:
	Makefile
	build.assets/Dockerfile
	build.assets/Makefile
2016-03-19 09:59:22 -07:00
Ev Kontsevoy 2ad2fb4ff1 SCP bugfixes
- also removed annoying log messages
- refs #274
2016-03-18 20:35:28 -07:00
klizhentas 6edd6675e6 re-introduce reverse tunnels into teleport
Reverse tunnels are now first class citizens of teleport.
There's no longer static configuration for reverse tunnel agents
in the config. Instead, admins can add and remove reverse tunnels
using tctl reversetunnel (hidden) commands.

* tctl reversetunnel ls
  lists reverse tunnels

* tctl reversetunnel upsert a.example.com 10.0.0.4:2023,10.0.0.5:2033 --ttl=10m
  updates or inserts reverse tunnel for 10 minutes

* tctl reversetunnel del a.example.com
  deletes a reverse tunnel

Teleport proxies watch changes in the reverse tunnels on the backend and
spin up / spin down reverse tunnels according to these changes.
2016-03-18 17:13:22 -07:00
Ev Kontsevoy 8bde5af868 Added a bit for 'admin manual' 2016-03-17 18:10:44 -07:00
klizhentas 091ccb9894 add TLS client authentication for ETCD 2016-03-16 18:30:00 -07:00
klizhentas 75a430bfa9 add resize sync and detection on tsh on both sides, fixes #235 2016-03-15 17:16:58 -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