Commit Graph
9 Commits
Author SHA1 Message Date
rosstimothy c2fc9a9375 Add idle connection timeouts to http clients and servers (#22885)
Sets `http.Server.IdleTimeout` and `http.Client.IdleConnTimeout`
on clients and servers which didn't have them set. A default of
360s was chosen to be on par with the default of an NLB without
being identical.

This was added as another safety measure to prevent leaking any
idle connections indefinitely as seen in #22757.

`apidefaults.DefaultDialTimeout` was also renamed to
`apidefaults.DefaultIOTimeout` to better reflect its usage.
2023-03-10 16:47:06 +00:00
Anton Miniailo 3633c6181e Add secure client IP propagation throughout teleport (#21080) 2023-02-28 20:38:12 +00:00
24fad0bd0d Use test IP addresses for auth_proxy_test. (#21565)
* Use test IP addresses for auth_proxy_test.

The auth_proxy_test file now uses IP addresses from the block `TEST-NET-3`
as specified in https://www.rfc-editor.org/rfc/rfc5735#section-3. Previously,
it was using `0.0.0.0` IP addresses. This has a chance of actually hitting
locally running services depending on the test runner setup, making the tests
non-deterministic. The hope here is that this change will avoid the spurious
test failures seen in CI.

* Update lib/srv/alpnproxy/auth/auth_proxy_test.go

Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>

* Update lib/srv/alpnproxy/auth/auth_proxy_test.go

Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>

* Update lib/srv/alpnproxy/auth/auth_proxy_test.go

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

* Add in comments about the 203.0.113.0/24 IP range.

---------

Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>
Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>
2023-02-09 20:08:41 +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
9bb07eabd2 Always use auth_servers when proxying an auth connection (#13310)
* Don't GetAuthServers in AuthProxyDialerService

* Don't GetAuthServers in localSite

* Fix lib/web tests

* Connect to a single auth in transport.start

* Review comments

Co-authored-by: Alan Parra <alan.parra@goteleport.com>
Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
2022-06-10 16:03:14 +00:00
Przemko Robakowski 35a9bbc887 Use first available auth server (#11229)
Currently we use random auth server from the list but if it's unavailable (for example it was restarted but there's still entry in cache, dynamodb backend etc) we return error.
This change tries all servers (in random order) and uses first that is available.

Closes #10019
2022-03-18 22:15:54 +00:00
Marek Smoliński e8f9220fe7 Fix ALPN SNI Proxy TLS termination for DB connections (#8303) 2021-09-24 09:42:13 +02:00
Marek Smoliński c142b656c8 ALPN SNI Proxy (#7524) 2021-09-13 11:54:49 +02:00