Commit Graph
28 Commits
Author SHA1 Message Date
David Boslee 743ff71391 add unstable envvars for proxy and auth announce ttls (#63690)
* add unstable envvars for proxy and auth announce ttls

* test setting env vars

* simplify env handling and add test case
2026-02-17 14:55:21 +00:00
STeve (Xin) Huang 5c9dcc43a6 Deprecate custom ALPN upgrade (#52573)
* Deprecate custom ALPN upgrade

* try hack to avoid cspell

* code-blocks -> code-blocks-no-cspell

* header value in error
2025-05-07 20:14:10 +00:00
Gavin Frazar c48fb577bb Add health check config service (#53438)
Adds a backend storage service for health_check_config resources.
2025-03-28 18:56:29 +00:00
Marco Dinis 39696a66b5 Truncate DiscoveryConfig.Status ErrorMessage (#52347)
Some fetchers might generate a lot of errors which are aggregated and
sent to the `DiscoveryConfig.Status.ErrorMessage`.

This might cause gRPC clients to fail when listing DiscoveryConfigs with
a `grpc: received message larger than max (xyz vs. 4194304)` error.

Allowing 100KB for the error message should give the user enough context
on what's causing the errors.
2025-03-06 11:56:56 +00:00
Jakub Nyckowski bfaa3340e8 Remove Assist (#42657)
* Remove assist feature

* Fix some tests

* Remove unused functions

* Fix ut

Remove more stuff
2024-06-10 20:57:05 +00:00
STeve (Xin) Huang 5cabb533a5 TLS Routing native WebSocket connection upgrade support (#36343)
* TLS routing connection upgrade using native websocket

* update ut in api

* lib/web/UT update

* fix typo, lint and race

* deal with subprotocol negotiation

* review comments round 1

* fix lint?

* add UT and address some other comments

* add env var to toggle mode

* fix lint
2024-02-12 18:04:01 +00:00
Forrest 9536add038 variable rate instance heartbeats (#33871) 2023-11-16 01:36:15 +00:00
Justinas Stankevičius 606870b972 Allow configuring number of parallel execution workers (#28151)
* Allow configuring number of parallel execution workers

* Remove an obsolete command

* Revert test: do not check parallel behavior

* Move worker count field into Assist config

* Replace waitgroup and semaphore with errgroup

* Adjust log message

* Switch ACEW to int32, add additional validation
2023-07-12 12:53:48 +00:00
rosstimothy 054bc9e7b5 Reduce DefaultIdleTimeout to 30s (#23943)
An idle timeout of 6m keeps web api connections open too long on
Proxies that have any agents which do not have the changes from
#22832. Because the http.Server.IdleTimeout is set on all release
versions now, even when built with go.19, we experience this issue
because we no longer exercise the bug that was fixed in go1.20.
2023-03-31 23:19:13 +00:00
STeve (Xin) Huang d22f78ceb0 ALPN handshake test improvements (#23348)
* ALPN connect test improvements

* fix typos

* remove extra period

* simplify error check

* fix func name typo

* add a few comments to clarify things

* fix lint
2023-03-29 16:50:39 +00:00
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
rosstimothy 6c4722f18c Make SessionTracker heartbeat loop more robust (#18415)
* Make SessionTracker heartbeat loop more robust

`(*SessionTracker).UpdateExpirationLoop` terminated the first time
it got an error attempting to persist the updated expiry to Auth.
A momentary network outage could prevent the `types.SessionTracker`
from being updated again causing it to have the wrong TTL in the
backend. This could result in sessions sticking around longer than
needed or being assumed to have been terminated prior to the session
actually ending.

A `retryutils.Retry` has been added to allow for retrying to update
a `types.SessionTracker` with some backoff. The retry loop will continue
until the session is closed, the update is successful, or the retry
has occurred for longer than the `types.SessionTrackers` last known
expiry.

`apidefaults.SessionTrackerTTL` was also reduced from 1h to 30m to
reduce the amount of time a stale tracker may linger in the backend.
The added robustness to the update loop should alleviate the need for
the lengthy TTL.
2022-11-17 13:54:25 +00:00
Brian Joerger 9cc58cca44 gRPC conversions - SSO Auth Connectors (#13073) 2022-06-08 01:45:06 +00:00
Roman Tkachenko ec512bafa4 Implement proxy templates (#12848) 2022-06-07 00:06:52 +00:00
rosstimothy 25ec2c8a39 Add client side circuit breaker to auth clients (#10282)
* Add client side circuit breaker to auth clients

In order to apply back pressure we can utilize a circuit breaker that
monitors error responses from auth server. When tripped it will prevent
all outbound requests to auth for a period of time. This can also help
prevent a potential thundering heard when auth is in an unhealthy state.
By default the circuit breaker will only be tripped if 90% of the
requests made in the monitoring interval fail.
2022-06-03 11:55:56 -04:00
Brian Joerger b4eec0d3c5 Add Session tracker to DB, App, and Windows Desktop Sessions (#12304) 2022-05-12 17:03:32 +00:00
Marek Smoliński 33f8a021b1 Fix tunnel address for TLS routing if public tunnel address is present (#8961) 2021-11-15 12:58:22 -08:00
Trent Clarke 3956ed27a6 Fix race condition in integration tests. (#8888)
Some integration tests modify global "constants" to speed up test
execution (e.g. shortening polling intervals). This is occasionally
tripping the Go data race detector, so I have added explicit
serialisation to reading and writing these global settings.

These values are only ever changed in a test environment, and there
should be zero contention for them in a non-test environment.
2021-11-10 11:34:34 +11:00
Brian Joerger 25c9c982db API client tunnel address discovery fix (#7533) 2021-08-11 14:34:50 -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 20a734ec5d Paginated rpcs - Replace GetNodes with ListNodes (#7415) 2021-07-01 14:03:23 -07:00
Brian Joerger 4d36870ff0 Remove remaining API aliases (#7137) 2021-06-08 12:08:55 -07:00
Forrest Marshall bc2203673d ignore dangling tunnel conns 2021-03-26 14:11:02 -07:00
a-palchikov 86908cc2f3 Web UI disconnects (#5276)
* Use fake clock consistently in units tests.
* Split web session management into two interfaces and implement them separately for clear separation
* Split session management into New/Validate to make it aparent where the sessions are created and where existing sessions are managed. Remove ttlmap in favor of a simple map and handle expirations
explicitly.
Add web session management to gRPC server for the cache.

* Reintroduce web sessions APIs under a getter interface.
* Add SubKind to WatchKind for gRPC and add conversions from/to protobuf. Fix web sessions unit tests.
* lib/web: create/insert session context in ValidateSession if the session has not yet been added to session cache.
lib/cache: add event filter for web session in auth cache.
lib/auth: propagate web session subkind in gRPC event.

* Add implicit migrations for legacy web session key path for queries.
* Integrate web token in lib/web
* Add a bearer token when upserting a web session
* Fix tests. Use fake clock wherever possible.

* Converge session cache handling in lib/web

* Clean up and add doc comments where necessary

* Use correct form of sessions/tokens controller for ServerWithRoles. Use fake time in web tests

* Converge the web sessions/tokens handling in lib/auth to match the old behavior w.r.t access checking (e.g. implicit handling of the local user identity).

* Use cached reads and waiters only when necessary. Query sessions/tokens using best-effort - first looking in the cache and falling back to a proxy client

* Properly propagate events about deletes for values with subkind.

* Update to retrofit changes after recent teleport API refactorings

* Update comment on removing legacy code to move the deadline to 7.x

* Do not close the resources on the session when it expires - this beats the purpose of this PR.
Also avoid a race between closing the cached clients and an existing reference to the session by letting the session linger for longer before removing it.

* Move web session/token request structs to the api client proto package

* Only set HTTP fs on the web handler if the UI is enabled

* Properly tear down web session test by releasing resources at the end. Fix the web UI assets configuration by removing DisableUI and instead use the presence of assets (HTTP file system) as an indicator that the web UI has been enabled.

* Decrease the expired session cache clean up threshold to 2m. Only log the expiration error message for errors other than not found

* Add test for terminal disconnect when using two proxies in HA mode
2021-02-04 16:50:18 +01:00
Brian Joerger 74f7c801da api dependency reduction - oidc and predicate (#5366) 2021-01-29 10:00:59 -08:00
Brian Joerger 626ad243eb api dependency reduction - utils constants (#5363)
Moved constants and utils used in /api into /api/constants and /api/utils respectively.
2021-01-29 09:37:01 -08:00
Brian Joerger 3c3ce160d9 Move API types and functionality from lib/services to api/types. (#5143) 2021-01-11 10:02:34 -08:00