Commit Graph
39 Commits
Author SHA1 Message Date
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
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 6e4d6b0cb2 more work, discovery works 2017-10-07 18:11:03 -07: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 084c8274b4 Allow configuration of the ciphers, KEX algorithm, and MAC algorithms
for node and proxy.
2017-06-11 12:16:10 -07:00
Ev Kontsevoy 19f666370f Web UI now passes the true client IP into SSH sessions
This commit closes #735 this is how it works:

- When a web-based client creates a Teleport Client object, it now
  passes the true client IP (as taken from HTTP requests) into the
  created SSH-to-proxy session via an environment variable.

- The Teleport proxy interprets that variable when it dials the
  destination server and passes it on using the same handshake protocol
  as a regular teleport CLI client.
2017-02-06 14:45:44 -08: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 8330658526 Fixed haning tests 2017-01-15 16:28:18 -08:00
Ev Kontsevoy 23b01e3cd2 PR comments
Addressed comments from #681
2016-12-30 16:14:07 -08:00
Ev Kontsevoy db2c09e630 Fixed tests 2016-12-30 15:01:27 -08:00
Ev Kontsevoy 4f009e2259 Finished the implementation of a proper "client IP" 2016-12-30 13:50:22 -08:00
Ev Kontsevoy 2035ace860 Dead code elimination and more comments
This commit does not change the behavior
2016-12-30 12:30:55 -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
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 69177fd751 Almost fixed tests 2016-04-28 21:44:18 -07:00
Ev Kontsevoy 5e01bc3d55 Merge branch 'ev/log' of github.com:gravitational/teleport into ev/log 2016-04-28 17:42:14 -07:00
klizhentas d68e693cad migrate to trace errors 2016-04-12 11:07:14 -07:00
Ev Kontsevoy 6ac710f308 Nicer inetgration package 2016-04-11 16:32:37 -07:00
Ev Kontsevoy 757c34a755 Added the ability to stop teleport without restarting the process 2016-04-03 12:17: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
klizhentas 0e503ca376 Add proper integration with OpenSSH on both sides 2016-03-09 19:39:15 -08:00
klizhentas 07fd46bb1d fix orphane processes, fixes #191 2016-03-03 12:28:10 -08:00
Ev Kontsevoy 6a8dc6c668 Nonintrusive minor refactoring of "auth tunnel"
1. Wrote comments in places where I was confused
2. Renamed variables/structs that were confusing
3. Cleaned up code for easier reading
2016-03-01 14:40:10 -08:00
Ev Kontsevoy e02378baf8 Minor code refactoring and commenting...
...in preparation for server side chagnes
2016-02-29 19:00:45 -08:00
Alex Lyulkov bd61f6793f Changed limiter initialization 2016-02-26 16:59:35 +03:00
klizhentas ef28bf4b24 reverse tunnel roundrobin, refs #114
* reverese tunnel now supports multiple inbound connections
* load balances between them
* discards and removes bad connections from the pool
2016-02-19 20:56:25 -08:00
klizhentas 6cdaba2ef6 user mappings should be deleted if user is deleted, fixes #116
This commit includes refactoring and cleanup of cert authority sybsystem:

* User keys methods are deleted
* Authorities CRUD is simplified
* Lots of code removed
2016-02-17 15:29:01 -08:00
Ev Kontsevoy 83f2d30d12 Replaced our own logger with logrus 2016-02-02 17:53:21 -08:00
Alex Lyulkov a56b5236ac Moved to go1.5 vendoring 2016-01-20 18:52:25 +03:00
Alex Lyulkov a3998b1f20 Added hotp mock for client library 2015-12-23 02:29:08 +03:00
Alex Lyulkov c6ed9ba9f9 Added scp for client, fixed scp receiveDir handler, made utils.NetAddr implement net.Addr 2015-12-18 00:40:42 +03:00
Alex Lyulkov 0a7e6fdfbe Refactoring 2015-12-03 12:26:34 +03:00
Alex Lyulkov 91bfd6e719 Added rate limiter, connection limiter 2015-12-02 21:51:32 +03:00
Alex Lyulkov 18c8ff180a Refactored: renamed fqdn to domainName, renaimed CAservice names 2015-11-20 13:15:48 -08:00
Alex Lyulkov 3f2ab06e40 Refactored CertificateAuthority service, added getTrustedKeys function 2015-11-17 20:39:19 -08:00
Alex Lyulkov ddd625035b Added reconnections, added certificates cache in nodes and proxy 2015-11-16 20:50:48 -08:00
klizhentas 00ef621e6b Apply apache license to teleport 2015-10-31 11:56:49 -07:00
Alex Lyulkov a3db86b236 More folders arrangments 2015-10-05 20:36:55 +03:00
Alex Lyulkov 9afc9a38a1 Fixed imports 2015-10-05 17:33:25 +03:00