Commit Graph
9 Commits
Author SHA1 Message Date
a5370d58fc Allow node to handle old and new way of client IP propagation on the same listener (#22572)
* Allow node to handle old and new way of client IP propagation on same listener

With addition of signed PROXY headers, node was listening on multiplexer, but because
 of that it couldn't processing incoming connection from older proxies
 when ProxyHelloSignature was used, because
 both ends were waiting for the other side to send data first.
 Here we integrate ability to handle PROXY headers into connection itself,
 so we can start ssh server without waiting for multiplexer to detect connection

* Remove unneeded code

* Improve comment's wording

Co-authored-by: Michael Wilson <mike@mdwn.dev>

* Improve comment's wording

Co-authored-by: Michael Wilson <mike@mdwn.dev>

* Fix imports

* Unexport function

* Add godoc

* Remove unneeded comment

* Move ProxyHelloSignature to constants

* Check that proxyline is verified

* Use Warn() instead of Warnf()

* Move ProxyHelloSignature to api/constants

* Add timeout for getting host CA during proxyline verification.

* Rearrange conditions

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>

* Clarify comment.

---------

Co-authored-by: Michael Wilson <mike@mdwn.dev>
Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>
2023-03-07 13:55:02 +00:00
Anton Miniailo 3633c6181e Add secure client IP propagation throughout teleport (#21080) 2023-02-28 20:38:12 +00:00
Anton Miniailo 8bbe8fad63 Change signing cert format from PEM to DER for signed PROXY headers (#20146)
That way we can send less data over the connection.
2023-01-13 02:36:09 +00:00
Anton Miniailo a039ce1cf9 Add secure IP propagation from teleport proxy to auth server via ALPN (#19008)
* Add secure IP propagation from proxy to auth server when using ALPN

We're using PROXY protocol extensions called TLVs to send
signed JWT and proxy's certificate to the auth server. Auth
validates JWT using provided signing certificate and host CA
to make sure that IP information comes from our internal proxy.
2022-12-23 22:12:42 +00:00
Anton Miniailo 7f852b4d58 Add TLV support to ProxyLine (#18494)
Add TLV support to ProxyLine

TLV (Type-Length-Value) is a way to to send custom data through PROXY
protocol defined in the spec, end of section 2.2
2022-11-21 16:17:03 +00:00
Przemko Robakowski 8b601f9cde Read all PROXYv2 header bytes (#12861)
In PROXYv2 protocol there can be more bytes after IP/ports data that can be ignored but need to be consumed. This change handles that.
2022-05-25 01:34:35 +00:00
Przemko Robakowski 17fc073379 Support proxy protocol v2 in MySQL (#12424)
#11684 added support for proxy protocol v2 for SSH and Postgres but MySQL uses different code path and it was missing. This change fixes that.
It also adds tests for v2 protocol support for MySQL, Postgres, Mongo and Redis
2022-05-18 16:04:10 +00:00
Przemko Robakowski 3ff19cf7c4 Support proxy protocol v2 (#11684)
This change add multiplexer support for proxy protocol v2 (binary).

Closes #4904
2022-04-05 00:48:16 +00: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