Commit Graph
96 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
Russell Jones 1eb6f6bd52 Refactored lib/srv to support multiple servers. 2017-11-09 16:58: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
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
Ev Kontsevoy 6150216653 Changes to how TSH deals with identity files
- Renamed "dir" format to "openssh"
- Replaced self-made key fingerprinting function with a standard one
- Changed fingerprinting from legacy md5 to sha256
2017-08-18 17:31:32 -07:00
Ev Kontsevoy d046eaee20 Merge branch 'master' into ev/i 2017-06-11 21:54:41 -07:00
Ev Kontsevoy 37319d6b41 Implemented identity loading
First part of addressing #1033 is ability to load credentials from the
credentials file(s).

This commit adds -i flag processing, i.e. a certificate can be fed via a
cert.file and used to login.
2017-06-11 13:37:42 -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 cdfb15fd82 scp compatibility improvements 2017-06-09 10:48:21 -07:00
Ev Kontsevoy 0ce13c8b1b Fixed shell globbing for scp 2017-06-08 22:18:09 -07:00
Ev Kontsevoy 99672d09a7 Fixed scp regressions
In this commit:

1. Minor addition to Makefile to pull new .go files from
   tool/teleport/common

2. os.Glob() returns an empty list (instead of an error) if the
   file/pattern is not found, so added check for that.

3. sendFile was prematurely sending 'C' command before trying to open a
   file. This used to lead to creation of empty files for invlaid
   sources.

Also, removed some confusing comments.
2017-03-29 16:49:40 -07:00
Russell Jones f7934b5be4 Set default PTY size if an invalid size is requested and
correctly split command.
2017-03-21 16:50:07 -07:00
Sasha Klizhentas 320dc0c57d fix window resize for OpenSSH, fixes #800 2017-03-16 11:20:35 -07:00
Sasha Klizhentas db08d896f1 agent forwarding test 2017-03-08 21:29:30 -08:00
Ev Kontsevoy a7aa9b4c93 Final cleanup in preparation for PR 2017-02-23 17:57:28 -08:00
Ev Kontsevoy 80df1bbc2d scp fixes
- added file globbing for "sink"
- added proper handling of directory copying into an existing target [1]

[1] compatible with OpenSSH behavior
2017-02-23 00:37:13 -08:00
Ev Kontsevoy f5022149c8 Fixed "double echo" scp issue
Refs #771
2017-02-18 23:52:56 -08: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 c3b57a8bb5 Removed the old web-based client code 2017-02-03 12:08:09 -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 c6c77a183c SCP improvements
- Removed strange handling of the ending / symbol, causing directories
  not being created. Fixes #606

- Added per-file progress indicator (reports "XXX uploaded").
2016-11-03 20:06:43 -07:00
Ev Kontsevoy 380d2f366b Preliminary SCP work
1) -r flag handling

   Proper handling of `-r` flag on the tsh side (recursive).
   Prior to this commit it was all uploads were _always_ recursive.

2) less verbose logging.

   Replaced a bunch of log.Info() with log.Debug()
2016-11-03 18:07:39 -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 7c3b74d8ff PR comments - implemented! 2016-05-27 11:26:48 -07:00
Ev Kontsevoy ce3bbbde3f SCP error messages are proper now
`tsh scp` now reports the same error messages as OpenSSH scp:

- when talking to Teleport servers
- when talking to OpenSSH servers
2016-05-26 18:00:40 -07:00
Ev Kontsevoy 48a74fbeca Intermediate commit (scp up/down works agaisnt openSSH servers) 2016-05-26 14:46:56 -07:00
Ev Kontsevoy 6e6e951650 Intermediate commit 2016-05-25 22:33:07 -07:00
Ev Kontsevoy 2d566ecbe2 Intermediate commit 2016-05-23 15:50:53 -07:00
Ev Kontsevoy b175d92052 PR comments - implemented! 2016-05-07 21:51:35 -07:00
Ev Kontsevoy e10612028e Preparations for a PR
Fixes #394
2016-05-06 20:48:02 -07:00
Ev Kontsevoy 9d2a5c3536 Buffer overflow issue 2016-05-06 13:37:11 -07:00
Ev Kontsevoy d36fced780 Added multi-party real-time window size support 2016-05-02 23:21:13 -07:00
Ev Kontsevoy 98568578ea Quick size fix 2016-05-02 20:39:11 -07:00
Ev Kontsevoy bec224fe97 Dirty size pushing 2016-05-02 19:12:16 -07:00
Ev Kontsevoy 17268c0c73 Removed extra UTF-8 encoding 2016-05-01 22:25:54 -07:00
Ev Kontsevoy 5629f76868 Added utf-8 encoding of terminal streams 2016-04-29 00:55:58 -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
Ev Kontsevoy 29d5ef454d Audit log improvements
Added clear separation between 'user' (Teleport user) and 'login' (OS
host login)
2016-04-26 17:41:04 -07:00
Ev Kontsevoy 2e099cdd0b Added full audit event support for:
- Port forwarding
- SCP up/down
- Auth attempts
2016-04-26 17:41:04 -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