Commit Graph
594 Commits
Author SHA1 Message Date
klizhentas cd03fc9a7d reuse GetLoginShell 2016-04-22 17:18:46 -07:00
Ev Kontsevoy e28f21922c Certificate TTL improvements
1. Server now always uses UTC timestamps for certificates it ussues
2. Client doesn't store cert validBefore time in separate files, it
   parses the cert itself.

Fixes #370
2016-04-19 16:09:22 -07:00
Ev Kontsevoy 5e80c2d662 Simple filesystem-based keystore for TSH
Started re-writing Teleport client keystore. From a buggy JSON-to-file
to a standard, directory/filebased API behind a standard interface to
allow for alternative implementations.

```
~/.tsh/
└── sessions
    └── localhost
        ├── cert
        ├── key
        └── pub
```
2016-04-18 22:56:21 -07:00
klizhentas d68e693cad migrate to trace errors 2016-04-12 11:07:14 -07:00
Ev Kontsevoy 757c34a755 Added the ability to stop teleport without restarting the process 2016-04-03 12:17:28 -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 23fa0ac2fe fix tests 2016-03-23 18:23:48 -07:00
klizhentas 94dd0f7fd9 use custom certificate pool instead of insecure connections for localhost proxies 2016-03-23 18:08:17 -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 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 25deb3a4e9 Merge pull request #255 from gravitational/alexander/resize
add resize sync and detection on tsh on both sides, fixes #235
2016-03-15 20:13:00 -07:00
Ev Kontsevoy 3599d4025e In CLI mode without -d flag Teleport now logs with Error level 2016-03-15 18:18:18 -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
Ev Kontsevoy 9a4b114901 Merge pull request #249 from gravitational/alexander/test-output
add support for TELEPORT_DEBUG_TESTS environment variable
2016-03-14 14:20:58 -07:00
klizhentas 7a2a9e334f add support for TELEPORT_DEBUG_TESTS environment variable turning on verbose testing 2016-03-14 14:07:45 -07:00
klizhentas 19788c25ce introduce teleport version, fixes #241
Here's how it works:

* It takes the closest tag that is present in the build
* Automatically applies this tag
* Adds git commit as well
* Is 100% go gettable
* No external deps, all vendored
2016-03-14 11:22:49 -07:00
klizhentas c1e0604dd0 Introduce auth server and proxy heartbeats
This commit introduces heartbeats of AuthServers and Proxies and fixes several issues:

1. Server init problem

There was an issue in server init, when certificates of multiple roles were overwriting each otther.
Now Teleport stores each keypair and certificate in a separate file <hostid>.role.key and <hostid>.role.cert
This also means that it's backwards incompatible with previous on disk format.

2. Proxy and Auth heartbeats

Auth servers and proxies now heartbeat into cluster as well

3. Bugfixes:

* Proxy role was missing, it is now treated as a separate role with permissions
* AdvertiseIP is now a global setting that can be used by all roles
* --advertise-ip flag was ignored and was never applied
* teleport service initialization has been simplified, now each role get it's own client
* minor cleanups
2016-03-13 18:15:09 -07:00
klizhentas 09725aab60 recover etcd backend support 2016-03-10 17:03:01 -08:00
klizhentas 0e503ca376 Add proper integration with OpenSSH on both sides 2016-03-09 19:39:15 -08:00
klizhentas 519f07611b fix data races and remove sleep from tests
* fix data race with advertise ip
* remove global variable
* simplify pings logic and fix ping bug
* fix potential bug in dynamic labels
2016-03-08 18:41:05 -08:00
Alexander Klizhentas cfd1ba9e3a Merge pull request #217 from gravitational/alexander/handle-errors
report errors in case of SSH access denied, fixes #179
2016-03-08 16:29:28 -08:00
klizhentas d4e741ffc7 report errors in case of SSH access denied, fixes #179 2016-03-08 16:29:08 -08:00
Ev Kontsevoy 02f9d38a50 Merge remote-tracking branch 'origin/master' into ev/tsh-ls
Conflicts:
	lib/hangout/hangout_test.go
2016-03-08 15:03:24 -08:00
Alexander Klizhentas e29c62bce0 Merge pull request #216 from gravitational/alexander/subsystems
Alexander/subsystems
2016-03-08 12:06:51 -08:00
klizhentas 35852bdca9 remove hangouts, report errors from subsystems, refs #179 2016-03-08 12:02:45 -08:00
Ev Kontsevoy 0b75792171 More intelligent node ping
Three changes:

1. Pings are randomized. Note `utils.RandomizedDuration()` function.
2. Sleeps are twice as long between failures.
3. Made tests less vulnerable to sleep times (also sped them up by about
   three seconds)

+ minor refactoring, moved "magic constants" into a proper
constants in `defaults` module.
2016-03-08 09:17:41 -08:00
Ev Kontsevoy 72c61b7d0c Merge remote-tracking branch 'origin/master' into ev/auto-tls
Conflicts:
	lib/service/service.go
	lib/utils/tls.go
2016-03-07 20:25:09 -08:00
Ev Kontsevoy a4b4a020b4 Merge pull request #207 from gravitational/ev/fix-browser-hang-on-https
Fixed browser hang on self-signed https cert
2016-03-07 18:45:21 -08:00
Ev Kontsevoy b440c74f67 Fixed browser hang on self-signed https cert
The problem was:

- Self-signed cert was also used as CA cert.
- This means a browser would add it to its list of CA certs.
- Then I'd delete /var/lib/teleport/*
- And a new CA would be created for the same name, confusing the browser

To fix:

- Certificate isn't marked as CA
- Org name is set to "Acme Co" instead of "Teleport"

Fixes #206
2016-03-07 18:44:34 -08:00
klizhentas 1eb952b89f properly propagate HTTP errors, fixes #172 2016-03-07 17:05:57 -08:00
Ev Kontsevoy 804fcece35 Experimental commit for automatic https on localhost
The idea:

- When creating client's TLS configuration, supply self-signed server
  cert from /var/lib/teleport/.cert

This way if a user is connecting to a proxy running on localhost, he
doesn't need to specify --insecure flag.
2016-03-06 00:33:02 -08:00
Ev Kontsevoy fb7768bc53 Experiment... 2016-03-05 23:51:12 -08:00
Ev Kontsevoy 07d85fd477 Nodes can be reached out by any IP/hostname as long as its routable
Refs #183

Also fixed a bug introduced in the previous commit.
2016-03-04 21:21:12 -08:00
Ev Kontsevoy 6151ab208a Bugfix: --proxy=localhost did not work
`web.SSHAgentLogin(proxyAddr string)` expects proxyAddr string to be a
URL, while everywhere else we address servers by host:port pair.

Because of that, `--proxy=host` sytax was broken.
2016-03-04 20:14:41 -08:00
Ev Kontsevoy 2d66f99f48 Adding new host does not require a name 2016-03-04 18:13:00 -08:00
Ev Kontsevoy cb489851c6 Merge remote-tracking branch 'origin/master' into ev/194 2016-03-04 17:26:00 -08:00
klizhentas 816ed30d73 fix circular dependency 2016-03-04 17:11:03 -08:00
Ev Kontsevoy 376b59e317 Merge branch 'ev/194-a' into ev/194 2016-03-04 17:00:34 -08:00
klizhentas 332212dcd4 add session log 2016-03-04 16:53:11 -08:00
Ev Kontsevoy 42f55959ed Intermediate commit 2016-03-04 16:27:52 -08:00
klizhentas 26331fb539 fixing bugs, refs #180 2016-03-03 18:03:25 -08:00
klizhentas 07fd46bb1d fix orphane processes, fixes #191 2016-03-03 12:28:10 -08:00
Alexander Klizhentas 40b889b68f Merge pull request #188 from gravitational/tls
only support TLS in web proxy
2016-03-02 15:09:44 -08:00
klizhentas 5e8ecd53b0 only support TLS in web proxy 2016-03-02 15:07:59 -08:00
Ev Kontsevoy 7ca1ae16ef Comments and fixed tests 2016-03-02 11:10:07 -08:00
Ev Kontsevoy cb3eddd36b Servers now use read-only UUIDs for their IDs 2016-03-01 23:34:49 -08:00
Ev Kontsevoy bb060fbbde Protection against nodes registering with unreachable IPs
auth:UpsertServer() now uses IP address on the wire if it detects looback or
unspecified IPs.

Refs #183
2016-03-01 17:18:06 -08:00
Ev Kontsevoy 4680296756 RemoteAddr is preserved in SSH->HTTP bridge for Auth API
Got rid of MemoryListener, instead replacing it with a closely tied pair
of "fake socket" and "fake connection", where the connection wraps
around the undrlying SSH channel. This allows me:

- Know exactly when connection.Close() is called (no wait for in-memory pipes)
- Keep the original remote addr around

Most of the changes are in api_with_roles.go
2016-03-01 16:45: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