Commit Graph
26449 Commits
Author SHA1 Message Date
Przemko RobakowskiandEdoardo Spadolini a13ff87916 Refactor command reexecution (#65562)
* Refactor command reexecution

* Review comments

* Review comments

* Document context

* Update lib/srv/bpf_test.go

Co-authored-by: Edoardo Spadolini <[email protected]>

* Update lib/srv/ctx.go

Co-authored-by: Edoardo Spadolini <[email protected]>

* Update session/reexec/reexec.go

Co-authored-by: Edoardo Spadolini <[email protected]>

* Encode json before starting goroutine

* Update session/reexec/reexec.go

Co-authored-by: Edoardo Spadolini <[email protected]>

* Fix ConfigureCommand cleanup

* Use map for extra files

* check nil

* e

---------

Co-authored-by: Edoardo Spadolini <[email protected]>
2026-04-28 20:38:46 +00:00
Alan Parra 2c00ba55a1 Add the subca.ParseCAOverride helper (#66169)
* Add the subca.ParseCAOverride helper

* Add the parseCertificateAndPublicKey private helper

* nit: Comment spacing
2026-04-28 17:58:16 +00:00
Edoardo Spadolini f4b1fc64c5 Add needrestart exception for the session helper (#66189)
* Add needrestart exception for the session helper

* Fix shellcheck linting
2026-04-28 17:39:14 +00:00
Edoardo Spadolini 63adac1061 Use the correct time in SFTPSummary events (#66251) 2026-04-28 17:21:50 +00:00
Erik Tate 261a697111 adding scope support for user cert generation and updating tsh to (#65686)
support user certs without kube principals included
2026-04-28 16:17:26 +00:00
Marek Smoliński 24b2608bf3 Add Reconciler stats (#66161) 2026-04-28 15:29:19 +00:00
Carlisia CamposandMarek Smoliński c55406bcdd Simplify Azure matchers from dynamic configs (#66219)
* Simplify Azure matchers from dynamic configs

Dedup, normalize of Azure matchers for dynamic config.

* Stop mutating caller's regions in Azure matcher

SimplifyAzureMatchers now normalizes regions into a freshly allocated
slice rather than writing back through the caller's input slice, since
Deduplicate may return its input unchanged for short inputs.

* Reuse existing util for Azure region normalization

* Make test parallel

Co-authored-by: Marek Smoliński <[email protected]>

* Dedupe Azure regions after normalization

---------

Co-authored-by: Marek Smoliński <[email protected]>
2026-04-28 15:27:58 +00:00
Bartosz Leper 353d840acd Note that Touch ID is not supported by WEBAUTHN (#66129)
* Note that Touch ID is not supported by WEBAUTHN

* Review

* Review

* Review
2026-04-28 13:53:45 +00:00
Tyler Richardson 61e7ee6e5e [docs] update windows desktop service scaling guide (#66101) 2026-04-28 13:25:26 +00:00
Paul Gottschling 31e2ff0675 Add database-related resource reference docs (#65460)
Add a resource reference generator config for `db_service` and `db`, and
generate pages for those resources.

Configure an introduction for the `db_server` page so that all
database-related resource reference docs have introductions that point
to related pages.
2026-04-28 12:43:30 +00:00
Paul Gottschling f49c71e6f0 Correct install-linux.mdx partial (#66199)
Closes #66104

Replace language about installing a Teleport Agent with language about
installing Teleport binaries. This is more consistent with the purpose
of the partial (instructions for an installation script for Teleport
binaries) and allows us to use it in `tbot` guides.
2026-04-28 12:36:26 +00:00
Paul Gottschling fd6816f48e Update RBAC instructions for the Jira plugin (#65190)
Closes #62251

Edit the Jira plugin guide to note that the role given to the Access
Request plugin must be able to update Access Requests.

- Use the existing `rbac-update.mdx` plugin to explain how to create a
  role that can update Access Requests and impersonate a user with that
  role.
- Inline the Machine ID partial in Step 2 and edit the content to
  include a custom role.
2026-04-28 12:31:40 +00:00
mica e17b120b52 docs: refactor Spanner DB guide (#65118)
* initial draft refactor of Spanner db guide

* heading and formatting changes

* updated examples per variable linter warning

* post-feedback: intro for service account section, formatting

* fixing var entries for linter

* casing issue for linter

* codex issues - db service account description and typo

* changing grep statement to find token role for service act

* moved images to strapi, + some clarification changes

* moved cloudsql db images to strapi, removed images from github

* review edits for consistency and clarity

* cleaning up the troubleshooting section

* cleaning up the troubleshooting section

* restore troubleshooting include

* updating the query to find service account and role

* post-feedback from Gavin
2026-04-28 08:57:52 +00:00
Marco Dinis fc839ff67c GCP Server Installer: don't exit on failure (#66014) 2026-04-28 08:18:47 +00:00
Edoardo Spadolini da24c17c22 Increase timeout in TwoClustersTunnel (#66221) 2026-04-28 08:00:28 +00:00
Ghassan Gedeon Achi 7bea6c9416 feat(client): add Access Graph TLS cert to KeyRing (#65957)
Adds a separate PEM-encoded TLS certificate on KeyRing
(AccessGraphTLSCert) used to authenticate directly to the proxy's
Access Graph API. It reuses TLSPrivateKey and is persisted alongside
the other per-proxy artifacts at
<baseDir>/keys/<proxy>/<username>-access-graph.crt.

Included wiring:
  - KeyRing helpers: AccessGraphTLSCertificate,
    AccessGraphTLSCertValidBefore, and AccessGraphClientTLSConfig.
    AccessGraphClientTLSConfig builds a tls.Config that trusts system
    CAs rather than the cluster CA, since the client is speaking
    directly to the public proxy.
  - FSKeyStore: read, write, and delete of the new cert file. The
    write and read go through a small helper that holds the same
    write/read lock on the TLS key file used by writeTLSCredential,
    so the AccessGraph cert cannot drift from TLSPrivateKey under a
    concurrent key rotation. Load is optional, so keyrings without
    the cert still work.
  - MemKeyStore.GetKeyRing propagates AccessGraphTLSCert for parity
    with the FS store.
  - Store.GetKeyRing parse-validates the AccessGraph cert when
    present, mirroring the existing TeleportTLSCertValidBefore call
    for the main TLS cert. Expired certs round-trip unchanged, matching
    the main TLSCert contract ("it's the responsibility of the
    TeleportClient to perform cleanup").

Note:
  - The identity file format was not updated to carry an AccessGraph
    TLS cert, which would be a breaking change to a long-lived,
    externalizable artifact. The tctl access graph workflow mints the
    cert against the proxy on demand and persists it in the client
    keystore, so identity-file portability isn't needed.

Tests:
  - keypaths.AccessGraphTLSCertPath path formatter.
  - FSKeyStore + MemKeyStore round trip of a distinct AccessGraph cert,
    minted via a new signAccessGraphCert helper that mirrors the
    production identity shape (Usage=UsageAccessGraphAPIOnly plus a
    WebSessionID). Plus delete behaviour for present and absent cert
    files on the FS store.
  - Store.GetKeyRing: absent, valid, expired, and unparseable
    AccessGraph cert paths. Expired round-trips; only unparseable is
    rejected.
  - KeyRing AccessGraph helpers: NotFound paths and tls.Config
    construction (system-CA trust, ServerName=ProxyHost, MinVersion
    TLS 1.2).

This is the client-side plumbing required by the tctl access graph
commands to obtain, persist, and reuse a proxy-facing TLS cert across
runs. Server-side session lifetime decoupling will follow in a
separate change.
2026-04-28 00:11:34 +00:00
Nic KlaassenandErik Tate 6692655872 [scopes] feat: filter scoped roles by name (#65891)
* [scopes] feat: filter scoped roles by name

* fix typo in comment

Co-authored-by: Erik Tate <[email protected]>

---------

Co-authored-by: Erik Tate <[email protected]>
2026-04-27 23:35:37 +00:00
Nic Klaassen 37e6f44908 chore: factor out state and use test package for materializer (#65569) 2026-04-27 23:13:41 +00:00
Tiago Silva 7c198fc9c4 sessionsearch[17]: Add tctl recordings TUI for browsing session summaries (#66016)
* sessionsearch[17]: Add tctl recordings TUI for browsing session summaries

Introduces a `tctl recordings search` subcommand backed by a Bubble Tea
TUI. The list pane shows sessions fetched via the SessionSearchService
(with pagination and filter flags), and the detail pane renders full
session metadata, resource properties, severity colouring, and summary popup.

Signed-off-by: Tiago Silva <[email protected]>

* handle review feedback

* add support for search mode

---------

Signed-off-by: Tiago Silva <[email protected]>
2026-04-27 21:46:54 +00:00
Nic Klaassenandwilliamong-tel d978a0f596 [scopes] feat: tctl scoped assignments list (#66175)
* [scopes] feat: tctl scoped assignments list

This commit adds a new command `tctl scoped assignments list` that lists
scoped role assignments and accepts the following params:
- `--user` filters assignments by the user they assign to
- `--role` filters assignments by assigned role
- `--format` prints text, json, or yaml

* fix typo in comment

Co-authored-by: williamong-tel <[email protected]>

* address comments from william

---------

Co-authored-by: williamong-tel <[email protected]>
2026-04-27 21:26:46 +00:00
Lisa Kim 42b1fbe7c3 tfgen: add support for omitting fields (#65727)
* tfgen: add support for omitting fields

* Support nested list items
2026-04-27 19:38:35 +00:00
Travis Rodgers f82807ba06 docs: adding upsell components to docs pages (#63110)
This commit adds the EnterpriseFeatureWidget upsell component to the top of a few docs pages. It also adds a callout button for the Enterprise Cloud headings in the feature matrics docs page.
2026-04-27 18:46:50 +00:00
Marek Smoliński 564c076d76 Refactor Reconciler metrics (#66136) 2026-04-27 18:40:26 +00:00
williamong-tel 1493bb13f6 add scoped role assignments to terraform (#65632)
fix template

regenerate docs

Update provider.go

address linter issue

lint

delete uuid requirement - fix tests

Update resource.tf

fix tests

fix test

adjust to use envelope types

fix

Update presets.go

Update assignment_terraform.go

make docs
2026-04-27 18:13:23 +00:00
david boslee 247ecf84a8 reversetunnel: add opt-in proxy discovery compaction (#65320)
* reversetunnel: add opt-in proxy discovery compaction

This change adds a unstable envvar "TELEPORT_UNSTABLE_PROXY_COMPACT_DISCOVERY"
to opt-in to discovery compaction.

Discovery compaction sends only the subset of proxies that have been
updated since the last discovery request rather than the full list
of proxies on every discovery request.

To accomplish this a new discoPub struct is introduced which
wraps the generic proxy watcher. A discoSub struct replaces
the previous channel used for proxy discovery fanout.

This new approach also removes the risk of buffer overflow that
could occur with buffered channels.

The default behavior has two notable changes:
1. The initial discovery request is no longer blocked by the first
heartbeat.
2. Periodic resync are now returned from the last set of servers
received from the watcher rather than calling .CurrentResources()

* use synctest to fix pubsub test

its possible (and okay) for a subscriber to receive multiple
notify. using synctest.Wait() we can wait until the publisher
goroutine is blocked on the resourceC channel to guarentee it
is no longer sending events to subscribers.

* update sync interval

* skip empty updates on wait/get

* remove double import

* suggestions to improve readability

* enforce non-nil discoSub

* add logger

* defer locks

* add logging for failed proxy group generation parsing

also removes unused func

* refactor pb->dp

at some point I renamed the struct from proxyBroadcaster to discoPub
hence the lingering var naming in the receiver funcs

* replace rw mutext with atomic pointer

* lock free pub/sub

* rename disco pub/sub

* rename all other references to pub/sub
2026-04-27 18:05:35 +00:00
Tiago Silva 44c4a6990b sessionsearch[20]: Add TeleportRetrievalModelV1 operator reconciler (#66064)
Adds Kubernetes operator support for the RetrievalModel singleton. The
controller implements Get/Create/Update/Delete backed by the summarizer
gRPC service. Because RetrievalModel is a singleton, Get and Delete
ignore the name parameter and always operate on the fixed Teleport
resource.

Introduces withSingletonName(name string) as a typed CRD schema option that
emits a CEL x-kubernetes-validations rule enforcing metadata.name == name at
admission time. This is wired up for TeleportRetrievalModelV1, which must be
a cluster singleton named "retrieval-model".

On Kubernetes < 1.25, x-kubernetes-validations is not a recognized field in
JSONSchemaProps and causes helm to fail with a validation error. The Helm
CRD template now checks .Capabilities.KubeVersion against >= 1.25.0 and
strips the field from every CRD version's openAPIV3Schema before rendering
when the cluster does not support it.

A Mutate hook enforces that the Kubernetes CR must be named
"retrieval-model" before any Teleport call is made, surfacing a clear
status condition on wrongly-named CRs.
2026-04-27 17:09:48 +00:00
williamong-tel 7527516f79 Add scoped role to terraform provider (#65506)
Add Scoped role to terraform

Does not contain upsert rpc yet.
Add a wrapper over accessClient to reduce change blast radius

fix naming

test

deleted accidental commit

Add access client in terraform module

refactor terraform client - extract to client package

Add a terraform specific wrapper for access client

Update terraformclient.go

fix test

Update scoped_role.mdx

revert accidental change

Remove unneded constants

Update role_terraform.go

use new protoc generation

fix build

fix

fix test

fix build and tests

Update presets.go
2026-04-27 16:07:33 +00:00
Paul Gottschling e2ddf7f113 Add S3-compatible service note in Storage Backends (#65982)
Fixes #62957

Update the parenthetical note in the initial table to indicate that
Teleport supports only certain S3-compatible services.

In the body of the page, briefly explain the condition that compatible
services must meet before the Auth Service can support them by default,
and explain the environment variables to assign in order to return to
SDK's behavior prior to the new S3 data integrity protections.
2026-04-27 16:01:06 +00:00
Steven Martin 0eafd2ca81 docs: update self-hosted db (#66204) 2026-04-27 15:19:47 +00:00
Steven Martin 0c326a0d18 docs: update auto discovery (#66177) 2026-04-27 14:48:55 +00:00
Steven Martin 7187868d3d docs: update install pre-req to handle windows powershell (#65880)
* docs: update install pre-req to handle windows powershell

* docs: extra line
2026-04-27 14:47:54 +00:00
Tiago Silva 723043621d sessionsearch[22]: add SearchMode enum to session search protos (#66205)
Adds a `SearchMode` enum to session search protos, allowing clients to choose the search mode that best fits their keywords.

Some searches perform better with embeddings only, while others work better with strict keyword matching. This change lets clients opt into their preferred search method, while keeping hybrid search as the default.

Signed-off-by: Tiago Silva <[email protected]>
2026-04-27 14:30:35 +00:00
Nibras Ohin 06149a61ff feat: add VNetDNSName to DatabaseStatusV3 and implement hashing logic (#65903)
* feat: add VNetDNSName to DatabaseStatusV3 and implement hashing logic

* fix: fixed tests and linter errors

* refactor: to improve readability

* test: added unit test to test the auth server

* chore: updating based on PR feedback to set dns name during db server creation

* chore: minor test updates and refactor based on pr feedback
2026-04-27 14:23:07 +00:00
Chris Thach 67bb1194de Restrict validated MFA challenge replication to only identities from the same cluster (#65991)
* Restrict validated MFA challenge replication to only remote proxy identities from the same source cluster.

Signed-off-by: Chris Thach <[email protected]>

* Catch empty source cluster. Provide more descriptive errors.

Signed-off-by: Chris Thach <[email protected]>

---------

Signed-off-by: Chris Thach <[email protected]>
2026-04-27 13:38:52 +00:00
Noah Stride c69d4941b6 Remove GetWebSession(Info)/DeleteWebSession HTTP RPCs (#66070)
* Remove GetWebSession(Info)/DeleteWebSession HTTP RPCs

* fix up tests

* small comment tweak
2026-04-27 13:25:45 +00:00
Paul Gottschling 5bf5b84f15 Correct node name validation notes (#65457)
Edit the `ssh_service` configuration reference partial and
troubleshooting guide for enrolling servers to address feedback that
came up after we merged #64632.
2026-04-27 13:24:06 +00:00
Paul GottschlingandAatu Väisänen f7ee8a194b Switch to relative links in the TileGrid components (#66100)
Co-authored-by: Aatu Väisänen <[email protected]>
2026-04-27 13:02:12 +00:00
Tiago Silva 665ad24abe remove rejected files from bad patch apply (#66190) 2026-04-27 10:42:42 +00:00
Tiago Silva d28831f04f prevent unauthorized uploads via encrypted recordings service (#66081)
Teleport Auth server allows clients that do not present a certificate to access parts of its API. This deliberate bypass exists to support joining methods or password logins where a user or server does not have a certificate yet but has a secret that can be exchanged for a certificate.

In order to keep the system compatible and reduce the permutations required, Teleport assigned these unauthenticated connections a role called `Nop`. This role has no permissions and the only reason why it exists is so we can still build a context and checker.

This role was historically embedded in a structure called `BuiltinRole`. This struct implements the `Identity` interface and by its documentation is used by teleport services that belong to this particular cluster.

Some of the Auth server handlers are restricted to server identities and the check consists in something like:

```go
	authCtx, err := s.authorizer.Authorize(ctx)
	if err != nil {
		return nil, trace.Wrap(err)
	}

	if b, ok := authCtx.Identity.(authz.BuiltinRole); !ok || !b.IsServer() {
		return nil, trace.AccessDenied("only server identities can verify validated MFA challenges")
	}

```

As seen above, part of the verification consists in type asserting the `authCtx.Identity` to confirm it belongs to a local server and then we check if the role belongs to an actual server.

In our codebase, we have a function called `IsLocalOrRemoteService` with the following body:

```go
// IsLocalOrRemoteService checks if the identity is either a local or remote service.
func IsLocalOrRemoteService(authContext Context) bool {
	switch authContext.UnmappedIdentity.(type) {
	case BuiltinRole, RemoteBuiltinRole:
		return true
	default:
		return false
	}
}
```

Given that unauthenticated users were wrapped in `BuiltinRole`, this function would return true for them. This caused the encrypted recordings service to authorize unauthenticated clients to access the upload handlers. This was the only access check applied, so the bug allowed any client to upload and replace files in the backend storage.

This change fixes that by enforcing proper RBAC checks in the encrypted recordings `CreateUpload`, `UploadPart` and `CompleteUpload` handlers. It also forbids `RemoteBuiltinRole` (remote/leaf cluster identity) from uploading files to root clusters.

This change also moves RoleNop out of the `SystemRole` type and into a new distinct type, `UnauthenticatedRole`, so the compiler prevents it from being used anywhere a real authenticated system role is expected. As a defence-in-depth measure, the middleware now rejects any TLS certificate that claims the Nop role in its Groups or SystemRoles fields.

This PR fixes a separate issue on top of the existing one where certificate rotation of encrypted sessions was available to unauthenticated users.

The protection introduced was `authCtx.AuthorizeAdminAction()`, which verifies if someone has completed the MFA challenge (if required). That was the intended idea, but given how Teleport handles unauthenticated users, they were marked with AdminActionAuthNotRequired, which bypassed MFA checks. Because of that, any client - authenticated or unauthenticated - with the ability to complete the MFA challenge (or if MFA was not required) could rotate the encryption keys for session recordings.

This doesn't significantly affect Teleport since the private keys are never exposed externally and previous keys always remain in the backend object, allowing old recordings to still be decrypted. The main concern is if the keys were rotated so many times that the backend item size exceeds the 400KB limit on DynamoDB. While this would cause the rotation to fail beforehand, it would also prevent any further rotations from succeeding.

This PR introduces proper RBAC for modifying types.KindRecordingEncryption and ensures that unauthenticated users are always assigned AdminActionAuthNotRequired.

Fixes https://github.com/gravitational/teleport-private/issues/2430
Fixes https://github.com/gravitational/teleport-private/issues/2429

Signed-off-by: Tiago Silva <[email protected]>
2026-04-27 09:40:39 +00:00
Steven Martin 6d1484b5e5 docs: update is session-summaries (#66094) 2026-04-27 09:19:28 +00:00
Grzegorz Zdunek 77910c8eb0 Update @xmldom/xmldom to 0.8.13 (#66144) 2026-04-27 07:51:21 +00:00
Julia Ogris 199cd79bec app: Clean up orphaned app servers on startup (#64029)
* app: Clean up orphaned app servers on startup

Delete stale app server heartbeat records on startup so that removed
apps disappear immediately instead of lingering until TTL expiry.

After a SIGHUP reload, the parent process exits with
deleteResources=false (it has a forked child), and the child only
heartbeats its own apps. Add a cleanup step that lists all app
server records for this host and deletes any that do not correspond
to a currently registered app. For agents with dynamic apps
(ResourceMatchers), wait for the first successful reconciliation
cycle before running cleanup so dynamic app records are not
mistakenly deleted. Skip integration-managed app servers (e.g. AWS
OIDC) that share the host UUID in all-in-one deployments.

* app: Improve cleanupOrphanedAppServers comments

Move the high-level explanation of why orphan cleanup exists
into the method godoc, and trim the inline comment to cover
only the timeout rationale.

* app: Address review feedback

Replace "15 minutes" with `[apidefaults.ServerAnnounceTTL]` in the cleanupOrphanedAppServers doc comment for accuracy (the TTL is 10 minutes, not 15). Drop the unused HostUUID field from suiteConfig.
2026-04-27 00:19:17 +00:00
Zac Bergquist 9da22d53a3 Minor Makefile improvmements (#65180)
- Remove unused targets
- Use $(MAKE) for better flag propagation
- Fix error in sloccount target
2026-04-26 03:31:01 +00:00
Tyler Richardson e38ddfd599 [docs] add database service scaling guide (#66103) 2026-04-25 03:15:54 +00:00
williamong-tel fe7add9f2f update PROTOC_GEN_TERRAFORM_VERSION to v3.1.0 (#66174)
* update PROTOC_GEN_TERRAFORM_VERSION to v3.1.0

* Update lint.yaml
2026-04-24 23:04:28 +00:00
Alan Parra 67aee15737 Add the "tctl auth create-override-csr" command (#65902)
* Add lib/subca.SupportedCATypes()

* Add the "tctl auth create-override-csr" command

* Rephrase comment on InitFunc

* Find min hash length before writing files

* Use slices.Clone

* Harden against unexpectedly small/uneven sized hashes

* Avoid using labels

* Output to stdout by default
2026-04-24 21:24:36 +00:00
Alan Parra 3126a84d00 Add CAOverride details to WindowsDesktopSessionStart events (#65862)
* Add CAOverride details to WindowsDesktopSessionStart events

* make grpc
2026-04-24 20:52:06 +00:00
williamong-tel bd752ad322 Change from compare failed error to not found (#66145)
* Change from compare failed error to not found

* change reading in deletion to use backendreader - delete the CompareFailedError code block
2026-04-24 19:00:53 +00:00
charlestp 632893a6b9 Discovery EKS terraform doc (#66114) 2026-04-24 18:49:49 +00:00
Pawel Kopiczko 27e280300f Test plan: Update AWS IC checks (#66133) 2026-04-24 18:45:49 +00:00