Commit Graph
24660 Commits
Author SHA1 Message Date
Grzegorz Zdunek 6615e42ecc Connect: close cluster clients when profile changes (#61090)
* Include expiration time in `LoggedInUser`

This will allow the profile watcher to detect when the user relogged.

* Display expiration time in UI

* Add `ClearStaleClusterClients` RPC

* Implement `ClearStaleClusterClients`

* Clear stale clients when profile changes

* Improve session expiration component

* Move refresh button back to top

* `ClearCachedStaleClientsForRoot` -> `ClearStaleCachedClientsForRoot`

* `unchanged` -> `stale`

* Make "closing stale clients" a subtest

* Add `clientcache` test

* Remove `getProfile` error wrapping

* Improve comment

* Convert story to controls
2025-11-17 11:02:40 +00:00
Marco Dinis 1032b8eafd Docs: fix example config for custom SSM Docs in EC2 Discovery (#61366) 2025-11-17 10:13:55 +00:00
Kevin d1d465444b Add support for tsh logout --proxy to work without --user flag when only one identity exists (#60851)
* Added support for `tsh logout --proxy` to work without `--user` when one identity exists

* Fix lint

* Refactor

* Refactor

* Refactor and update log messages
2025-11-14 23:45:22 +00:00
rosstimothy 94de1987ee Populate GOAWAY response body (#61264)
Follow up to https://github.com/gravitational/teleport/pull/61142 which
sets the response body so that clients which only look at the reason and
not the headers will behave appropriately.
2025-11-14 23:38:38 +00:00
Andrew Burke ac20d3770c tctl resource: convert server info handler (#61399) 2025-11-14 23:35:22 +00:00
rosstimothy a986f9fd48 Generate test artifacts (#61296)
Updates test targets to output json and junit files. These files
will be forwarded to a durable storage location in the future to
be consumed for analytical purposes.
2025-11-14 23:19:36 +00:00
Kenneth fccb6da194 Add login_hint to identifier first login for OIDC (#60975)
This ensures that the user's name will be passed to the IdP
so that they don't have to type it in again.
2025-11-14 23:16:21 +00:00
Andrew Burke f21a0c86ec tctl resource: convert static host user handler (#61400) 2025-11-14 22:30:37 +00:00
Edoardo Spadolini ded7698909 Kubernetes forwarding in the Relay Service (#60974)
* Add signaling for supported tunnel types to relay tunnel

* Enable relay tunnel client for kubernetes_service

* Add kube_server to the relay cache

* Add passive forwarder for kubernetes access through the relay

* Add wildcard SNI suffix to kube service SANs if a relay is configured

* Add SNI-dispatching grpc transport for the relay transport server

* Enable kubernetes forwarding in the relay service

* Advertise support for kube tunnels in the relay

* Add tests
2025-11-14 22:25:00 +00:00
Cam Hutchison 396ee57603 update-ami-ids: Skip example dirs without README.md (#61363)
When looking for README.md files to update under
`examples/aws/terraform`, skip any that do not have a `README.md` file
instead of exiting with an error. A new example directory has been added
and it does not have a README.md file and it is causing the update to
fail for the other directories.
2025-11-14 22:00:40 +00:00
Nic Klaassen 26773a7b85 docs: update Oracle join docs for permissionless join method (#60890) 2025-11-14 21:47:28 +00:00
Hugo Shaka c273a7eca6 metrics.Registry.Wrap() handle empty subsystems properly (#61392)
* handle empty subsystems properly

* appeasing our italian engineering team
2025-11-14 21:21:48 +00:00
Pawel Kopiczko ed6711ffdb Improve login errors on missing roles (#61307) 2025-11-14 20:20:39 +00:00
Sakshyam Shah 4bd425c037 tctl resource: convert saml_idp_service_provider handler (#61386) 2025-11-14 20:16:03 +00:00
Andrew Burke 5fa63c3a7e Fix sftp using wrong addr for signing proxy headers (#61077)
This change fixes a bug where file uploads/downloads in the web ui
would fail if proxy protocol was active and the web listen addr
was unset.
2025-11-14 19:22:45 +00:00
Hugo Shaka 517bd1b3a4 remove mislading 'update' command in tctl list-kins (#61382) 2025-11-14 18:58:12 +00:00
rosstimothy 57505d2c70 Fix TestClient_DialHost flakiness (#61373)
Several of the test cases failed with unexpected EOF errors because
the gRPC handler was terminating too early.

The `connection successfully established without agent forwarding`
test case used the following series of events to validate ssh frames
are forwarded correctly.

1) client sends message to server
2) server echoes the data back and immediately terminates the stream
3) client reads a message and validates the data was echoed
4) client tries to read again and gets an EOF error
5) client closes connection

The flakiness was a result of step 2. The server handler exiting
immediately after sending the echo back to the client could result
in the message never being received by the client. To make the test
more reliable the test was updated to the following.

1) client sends message to server
2) server echoes the data back
3) client reads a message and validates the data was echoed
4) client resends the message to the server
5) server receives the second message and terminates the stream
6) client tries to read again and gets an EOF error
7) client closes connection

This guarantees that the server stream handler will be alive after
the echoed data is sent and the client has had a chance to process it.

The `connection successfully established with agent forwarding` test
case was flaking for similar reasons. The gRPC handler spawned a
goroutine to consume and forward agent frames but the handler did not
wait for this goroutine to finish before returning. Depending on the
timing of the test the handler could return prior to all agent frames
being processed which terminated the gRPC stream and resulted in
unexpected EOF errors at the client.

To remedy this logic in the handler was inverted such that processing
the messasges from the gRPC stream is done in a loop in the main goroutine
of the handler. Processing of agent frames is now done in a background
goroutine spawned via an errgroup.Group. The main loop of the handler
blocks waiting for the errgroup.Group to conclude prior to exiting to
ensure all messages are exhausted before exiting.

Fixes https://github.com/gravitational/teleport/issues/32799.
2025-11-14 18:30:20 +00:00
Kevin 976c7eb61d Improve resource name validation for AWS Roles Anywhere and AWS OIDC generate command (#61024)
* Fix resource name validation for AWS Roles Anywhere generate command

* Refactor, fix lint

* Add better UI validation for AWS Integration name; refactor

* Refactor and add leading/trailing whitespace check, add better UI validation for AwsOidc

* Remove unused export
2025-11-14 17:06:39 +00:00
Andrew Burke 10bfff2294 Gracefully handle corrupted private keys (#61126)
This change allows tsh to treat corrupted private keys as though
they were not present (and trigger relogin flows) It also attempts
to prevent said corruption in the first place.
2025-11-14 17:03:28 +00:00
Cam Hutchison be29f547a0 [auto] Update AMI IDs for 18.4.0 (#61362) 2025-11-14 16:24:32 +00:00
Hugo Shakaandrosstimothy ef0441f287 Error message when running tctl rm connector (#61374)
* actionable error message in tctl rm connector

* fixup! Connect: react to tsh actions by watching tsh dir (#60884)

* fixup! Connect: react to tsh actions by watching tsh dir (#60884)

* Update tool/tctl/common/resource_command.go

Co-authored-by: rosstimothy <[email protected]>

---------

Co-authored-by: rosstimothy <[email protected]>
2025-11-14 15:14:35 +00:00
Hugo Shaka bcd0e4dfad alias "tctl delete" -> "tctl rm" (#61376) 2025-11-14 15:12:37 +00:00
Hugo Shaka a721d59d53 add tctl api-resources (#61356) 2025-11-14 15:11:09 +00:00
Marek Smoliński 2e659974b4 Add PutBatch Backend test coverage (#61321) 2025-11-14 14:48:58 +00:00
Pawel Kopiczko 07fa1a72bb Update tctl rm example (#61371) 2025-11-14 14:19:32 +00:00
Edoardo Spadolini 18d2450b24 Update RFD 0153 to use envelopes for gRPC APIs (#61349) 2025-11-14 14:13:25 +00:00
Tiago Silva 08bef4d6fc deflake TestSessionRecordingModes test (#61343)
Fix flakiness in `TestSessionRecordingModes/BestEffort`

`TestSessionRecordingModes/BestEffort` test was extremely flaky because
although the session was already terminated, the `session.leave` and
`session.end` events were never received.

Upon session termination, interactive sessions wait for the terminal
to be closed and also wait for the recorder to leave the session.

https://github.com/gravitational/teleport/blob/4247f2e4a2fe2d430e268c9f5476d83c3d0a6456/lib/srv/sess.go#L1509-L1516

`defaults.WaitCopyTimeout` is equal to 5s.

Due to an incorrect condition, the terminal acquired the lock before
waiting for all parties to leave and then waited on the `sync.WaitGroup`.
This caused the lock to be held indefinitely, as other goroutines also
needed the same mutex, preventing the session writer from closing properly.

Depending on the order of occurence, if the incorrect condition was
acquired before all parties leave the session, it would result in a
deadlock causing the session events to never be emitted within 5
seconds.

Fixes https://github.com/gravitational/teleport/issues/57332

Signed-off-by: Tiago Silva <[email protected]>
2025-11-14 09:24:35 +00:00
Marco DinisandRoman Tkachenko c3e21f0778 Docs: add advanced configuration to Server Discovery (#61221)
* Docs: add advanced configuration to Server Discovery

* Update docs/pages/includes/auto-discovery/aws-ec2-advanced-config.mdx

Co-authored-by: Roman Tkachenko <[email protected]>

---------

Co-authored-by: Roman Tkachenko <[email protected]>
2025-11-14 08:16:18 +00:00
Hugo Shaka 55baa2c030 convert static-or-dynamic configs (#61270) 2025-11-14 03:13:48 +00:00
Brian Joerger 9ab4a82b91 Use FlagsToTwoColumns format option in order to get env var help automatically. (#61344) 2025-11-13 20:28:16 +00:00
Tim Buckley 4247f2e4a2 Add env zero guide for the Terraform provider (#60713)
* Add env zero guide for the Terraform provider

This adds a guide for using Teleport's Terraform provider to join
using the new `env0` join method.

* Update versions based on expected release

* Address review feedback
2025-11-13 18:02:13 +00:00
Grzegorz Zdunek 5fa824911a Connect: react to tsh actions by watching tsh dir (#60884)
* Add `ClusterLifecycleManager`

* Register handlers for adding, removing and logging out from cluster

* Provide `rootCluster` in `useWorkspaceContext`

The handlers in the profile watcher will proceed with updating the cluster store, even if the renderer handlers returned errors.
This check protects us from a runtime error if the renderer fails to remove the workspace.

* Improve docs

* Move processing queue to listener

* Make `will-` operations always interrupt main process actions

* Improve error messages

* Do not remove managing cluster when **only** logging out

The app updater displays all clusters, not just those the user is logged into.

* Revert "Provide `rootCluster` in `useWorkspaceContext`"

This reverts commit cf76d2ba27.

* Rename `logoutWithCleanup` to `cleanUpBeforeLogout`

* Do not pass `AbortSignal` to `this.mainProcessClient.syncRootClusters`

* Lint

* Fix types issues

* Do not stack watcher notifications
2025-11-13 15:00:58 +00:00
Noah Stride 6089b082cf MWI Docs: Rename final reference to "Machine ID" (#61320)
* Remove "Machine ID" terminology from Access and Deployment guides

* Fix up last references to "Machien ID" terminology

* Fix mispelling
2025-11-13 14:25:08 +00:00
Noah Stride d20ce29867 Add "Overview" video to Introduction to Machine & Workload Identity (#61326) 2025-11-13 14:24:01 +00:00
STeve (Xin) Huang 088d93d250 [mcp] ignore well-known requests (#61116)
* [mcp] ignore well-known requests

* strings.Contains -> strings.HasPrefix
2025-11-13 14:22:55 +00:00
Luke Okraszewski 090e12c316 [reversetunnel] Use access point for cert auths (#61274)
This change allows the agent dialer to use cached
results for hostCheckerFunc. In the case of a transient
grpc network failure, this allows the reverse tunnel
to be re-established before the grpc timeout takes place.

Test plan:

- [ ] Spawn two Linux VMs, one for auth/proxy and one for node.
      Simulate network change by toggling one of two interfaces on the node,
      measure time for the reverse tunnel to be functional again.

In local testing with 5 runs this on average brings the recovery time
to 2m39s from 3m45s.

Changelog: Improve reverse tunnel dialing recovery from default route changes by 1min on average.
2025-11-13 10:04:58 +00:00
Dan Share dcc4649275 Add cache for AD SIDs (#60878) 2025-11-13 10:01:41 +00:00
Tim Buckley e1d294c32a Port gitlab join method to new join service (#61203)
* Port `gitlab` join method to new join service

This ports the `gitlab` join method to the new join service.

The `gitlab` package was moved to `lib/join/` with minimal changes,
token verification was moved into `lib/join/gitlab` so it could be
reused between both legacy and new endpoints, and a small adapter was
added to provide backwards compatibility.

See also: [RFD 27e](https://github.com/gravitational/teleport.e/blob/master/rfd/0027e-auth-assigned-uuids.md)

* Fix imports

* Add gitlab to whitelist, reorder entries alphabetically

* Rename checkAndSetDefaults() to validate()
2025-11-13 02:12:57 +00:00
Brian Joergerandrosstimothy b8ffed9838 Coordinate session ID with Node in Proxy recording mode (#59850)
* Generalize PrepareToReceiveSessionID.

* Initialize session ID in the connection context and update it from node current-session-id request.

* Add [email protected] request and ensure new session ID is correctly set in proxy recording mode during the channel request.

* Replace PrepareToReceiveSessionID with simpler in-place logic.

* Don't emit session events or tracker when proxy forwarding to a Teleport Node.

* Fix missing session tracker for outdated Teleport Node.

* Remove extra major version grace period.

* Update integration test.

* Cleanup current session ID handling and fix failing tests.

* Fix tests.

* Address comments.

* Restructure currentSessionID handling.

* Set newSessionID in test server context.

* Fix integration test.

* Fix AuditOn integration test.

* Address comment on channel close.

* Track session on forwarding node.

* Fix web shutdown.

* Fix nil pointer dereference in test.

* Fix test flake.

* Fix nil pointer in test.

* Fix test flake.

* Update lib/srv/ctx.go

Co-authored-by: rosstimothy <[email protected]>

* Forwarding Node accepts client connection after receiving preparing session ID from node. This way, the forwarder can reject client connections if there is an issue preparing the session ID (impossible join sessions).

* Remove check for session.data event which may not be emitted in time for the test.

* Address comments.

---------

Co-authored-by: rosstimothy <[email protected]>
2025-11-13 01:13:25 +00:00
Hugo Shaka 9bc26f74bb convert connectors (#61269) 2025-11-12 22:24:24 +00:00
rob-picard-teleport 42b3226bbf Update bpf session recording security warning to mention egress instead of ingress (#61306) 2025-11-12 22:05:30 +00:00
Hugo Shakaandrosstimothy 8d94614699 Introduce metrics.Registry to pass down registries (#61239)
* Introduce metrics.Registry and use it

* Update lib/metrics/registry.go

Co-authored-by: rosstimothy <[email protected]>

* BlackHole -> BlackHoleRegistry

* merge lib/metrics and lib/observability/metrics

* lint

* address noah's feedback

---------

Co-authored-by: rosstimothy <[email protected]>
2025-11-12 21:38:47 +00:00
STeve (Xin) Huang 30566e28e0 Trust system cert pool for MongoDB Atlas (#61011) 2025-11-12 21:18:03 +00:00
Alan Parra 8f04409d6a chore: Bump go-attestation to v0.6.0 (#61294)
* chore: Bump github.com/google/go-attestation to v0.6.0

* Fix breaking changes from go-attestation

* Bump e/ reference
2025-11-12 20:37:19 +00:00
Erik Tate 302f8c8a5c adding scoped access checks for scoped token CRUD (#60531) 2025-11-12 20:12:48 +00:00
Alan Parra 826b12d329 Add the lib/devicetpm package (#61293)
* Add the lib/devicetpm package

* Add license headers
2025-11-12 18:59:10 +00:00
Bartosz Leper 045d0b6ed0 Unify behavior of the uploaders (#60534)
* Unify behavior of the uploaders

- Changes the behavior of uploaders to allow uploading pending
  summaries. It also makes all uploaders consistently fail to overwrite
  existing recordings and final summaries.
- Upgrades the gofakes3 library to support the If-None-Match headers.
- Copies the MemBuffer utility from the enterprise code.

* Fix a deadlock in gcsessions.Handler

The deadlock occurred when the upload passed a certain number of parts,
in which case the errors channel buffer got saturated and the object
deletion goroutines started piling up, ultimately leading to locking the
main loop that iterated through the object slice when the semaphore
channel got its buffer filled up too.

This deadlock prevented running the GCS uploader integration tests.

* review

* Another review round

- Move the pending session downloading to the caller
- Add a missing MemBuffer test
- Tweaks to the memory uploader (required by the Enterprise change)

* Build fix

* review

* Fix lint and integration tests

* Delete the pending summaries when uploading final, use versioning on s3

* Some comments

* license
2025-11-12 17:33:32 +00:00
Bernard Kim 39dbce7268 RFD 0201 - Time-based automatic reviews (#57334)
* Support time-based AMRs

* Note start and end times are inclusive

* Separate schedules spec

* Revisions reflecting implemented state

* lint
2025-11-12 16:50:57 +00:00
STeve (Xin) Huang 924dd38fcf [docs][mcp] troubleshoot tsh path error (#60874)
* [docs][mcp] troubleshoot tsh path error

* address feedback
2025-11-12 16:01:19 +00:00
Krzysztof Skrzętnicki 0fd1598ef4 Downgrade gosnowflake due to data race issue. (#61287) 2025-11-12 15:24:16 +00:00