Commit Graph
17 Commits
Author SHA1 Message Date
Brian Joerger 3a5a285883 Generalize private keys in tsh (PIV integration) (#15334)
Primary Changes:
 - Remove reliance on Private Key PEM:
 - Update native and keygen packages to return PrivateKey instead of PEM key
 - Add new PrivateKey interface which implements crypto.Signer
 - Replace PEM encoded private key usage where possible
 - Replace calls to tls.(Load)X509KeyPair with keys.(Load)X509KeyPair in
client packages

Minor Changes:
 - Remove unused agent.AddedKey return from LoadKey
 - Simplify sshutils and removed unused code paths
 - Add ecdsa and ed25519 key support
2022-08-25 23:26:44 +00:00
Noah Stride af5e2517de Proxy Protocol support for Proxy SSH listener (#14712)
* Add additional debug logging for instantiation of ssh server conn

* Rough out introducing mux to ssh listener

* Catch errors from multiplexer serve

* Adapt multiplexer to support ProxyHelloSignature

* Adjust logging for ssh conn creation

* Adjust tests to use semantically correct assert/require helpers

* Address PR comments

* Check Client addr is properly propagated in mux test
2022-08-01 14:18:34 +00:00
rosstimothy 9b22af6a5e SSH request tracing (#14124)
* SSH request tracing

Add tracing support for ssh global requests and  channels. Wrappers
for `ssh.Client`, `ssh.Channel`, and `ssh.NewChannel` provide a
mechanism for tracing context to be propagated via a `context.Context`.

In order to maintain backwards compatibility the ssh.Client wrapper
tries to open a TracingChannel when constructed. Any servers that
don't support tracing will reject the unknown channel. The client
will only provide tracing context to servers which do NOT reject
the TracingChannel request.

In order to include pass tracing context along all ssh payloads
are wrapped in an Envelope that includes the original payload
AND any tracing context. Servers now try to unmarshal all payloads
into said Envelope when processing messages. If there is an Envelope
provided, a new span will be created and the original payload will
be pass along to handlers.

Part of #12241
2022-07-27 14:56:06 +00:00
Aaron Friel fe66bc8637 Fix panic on equality, add symmetric equality tests (#13588) 2022-07-13 00:07:08 +00:00
Gus Luxton 51b3bc3dda tsh: Also create a PuTTY PPK-formatted keypair on login (#12733)
PuTTY uses its own keypair format which has the extension .ppk on Windows, hence PPK.
The specification for the file format is here: https://the.earth.li/\~sgtatham/putty/0.76/htmldoc/AppendixC.html\#ppk
2022-07-11 23:31:06 +00:00
rosstimothy 9f094aaef6 Add tracing instrumentation for ssh clients/servers (#12434)
* Add tracing instrumentation for ssh clients/servers

Add tracing context to the existing ProxyHelloSignature to provide
span information across ssh connections. To add span context per
ssh session on top of new connections, the same tracing context is
passed in the first global request of the session.

In order to ensure that tracing context is pulled from and inserted
into the proper context.Context, some interfaces and methods were
changed to take one as the first argument.
2022-05-25 12:24:02 +00:00
David Boslee 9d6b093503 Prevent blocking forever when transport channel fails to open (#11875) 2022-04-20 09:26:12 -06:00
Zac Bergquist e45ab655dd Fix reverse tunnel dialing for Windows Desktops
- Ensure that the dial request uses proper "server ID" format,
  which is <uuid>.<cluster_name>
- Update reverse tunnel agent to handle tunnel connections
  to desktops
2022-01-12 13:05:05 -07:00
Forrest Marshall cf7d221b64 improve graceful restart behavior 2021-09-21 11:56:39 -07:00
Roman Tkachenko e1c3f80aa0 Fixes for cert checker and Postgres config builder (#8251) 2021-09-17 13:28:40 -07:00
Brian Joerger 9b8b9d6d0c rollback - Upgrade api version. (#7751) 2021-07-30 15:34:19 -07:00
Brian Joerger c040aca4c1 Upgrade api version. (#7609) 2021-07-28 13:51:21 -07:00
Brian Joerger 455cf84ca5 Fix profile credential loader known_hosts (#7532) 2021-07-20 19:22:32 -07:00
Roman Tkachenko 8230d6e436 Capture postgres extended protocol messages in audit log (#6303) 2021-04-14 13:39:59 -07:00
Andrew Lytvynov 1e7a369b26 web: fix AccessRequest loading on user cert reissue (#6264)
Load access requests from SSH cert instead of the profile. The profile
only exists on CLI clients, but not in the proxy.

Note: theoretically, SSH cert may be missing in some cases for CLI
clients. We should eventually encode access requests in TLS certs too,
which are always present.
2021-04-06 16:20:04 -07:00
Brian Joerger 826ed676fa Refactor ssh.ClientConfig used by tctl and API clients to use the first valid principal as User. 2021-03-30 17:53:29 -07:00
Brian Joerger 2beb991598 API client connection overhaul (#5625)
* Added support for connecting API client through tunnel proxy and web proxy addresses (with identity file).

* Added concurrent dialing logic to dial several possible dialing combinations and seamlessly return the first client to connect.
2021-03-23 14:39:20 -07:00