Commit Graph
2666 Commits
Author SHA1 Message Date
Dan Upton 4860cf3c6b Add DelegationSessionService.GenerateCerts RPC (#64897)
* Add `DelegationSessionService` protobuf definition

* Implement `GenerateCerts` RPC

* Prevent restricted delegation sessions from inheriting administrative privileges

Previously, the `resources` list on a delegation session would restrict regular
access to resources that weren't explicitly included, but not administrative
actions.

Now, we explicitly deny all administrative (rule-authorized) actions for
delegation sessions unless you include a wildcard in `resources`.

* Only permit list/read/readnosecrets for allow-listed resource kinds

* Fix reused extension OID

* Add a small amount of tolerance for clock skew

* Make the "expires must be in the future" message clearer

* Fix linter errors

* Access to a windows desktop implies access to the desktop service

* Add `DelegationSessionID` to the decision package's `SSHIdentity` and `TLSIdentity`

* Wrap `ExtractConditionForIdentifier` for delegation sessions too

* Prevent calling `GenerateCerts` inside a delegation session

* No need for indirection with GenerateUserCerts method now

* Fix import ordering

* Stop delegation service from returning CA certificates

Per @strideynet's request, to avoid replicating existing bad patterns around
conflating the user and host CAs.

* Error messages should start with lowercase letters

* Add `RouteToKubernetes` wrapping message

* Replace expires parameter with TTL

* Remove unnesasary error check

* Fix `AgentScope` extension type assertion
2026-04-14 16:47:32 +00:00
dependabot[bot] 1b8721196d Bump helm.sh/helm/v3 from 3.19.1 to 3.20.2 (#65666)
Bumps [helm.sh/helm/v3](https://github.com/helm/helm) from 3.19.1 to 3.20.2.
- [Release notes](https://github.com/helm/helm/releases)
- [Commits](https://github.com/helm/helm/compare/v3.19.1...v3.20.2)

---
updated-dependencies:
- dependency-name: helm.sh/helm/v3
  dependency-version: 3.20.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-14 13:13:06 +00:00
STeve (Xin) Huang 8f8ca00ce7 pgx migration: all places outside engine + test server (#65596)
* pgx migration: all places outside engine

* tidy

* fix ut ...

* add test server
2026-04-13 14:31:23 +00:00
Steven Martin 717f0c3c4c Update Redis docs url in auth command (#65246) 2026-04-11 16:23:47 +00:00
Roman Tkachenko 17446b130e Add teleport-acl-review skill (#65361) 2026-04-10 23:14:20 +00:00
Nic Klaassen e8d10a184d [scopes] tctl scoped role assignment UX improvements (#65628) 2026-04-10 05:54:01 +00:00
rosstimothy 02a1b0b537 Inject modules into the auth server (#62858)
Contributes to https://github.com/gravitational/teleport/issues/62799.
2026-04-09 20:54:27 +00:00
Krzysztof Skrzętnicki f5ad42bc89 tctl discovery nodes command (#64253)
* `tctl discovery inventory` command

* Address PR review feedback for tctl discovery command, align for additional cloud expansion

* adjust json output

* avoid potentially unsafe cast in tests

* test truncation; drop redundant test cases

* clarify comment

* clarify behaviour with comment

* flip condition

* correct the condition
2026-04-09 15:25:26 +00:00
williamong-tel 1ae8c08279 Clear ssh certs from local key agent when switching scopes (#65154)
* Clear ssh certs from local key agent when switching scopes

* Update tsh_test.go

Update tsh_test.go

* Update tsh.go

* Update tsh_test.go

Update tsh_test.go

* Add test that confirms rescoping changes the certs

* Update tsh_test.go
2026-04-08 22:25:23 +00:00
Noah Stride 4918160602 MWI: Initialize destination before use for tbot keypair create (#65444)
* Initialize destination before use for `tbot keypair create`

* test
2026-04-08 13:12:47 +00:00
Edoardo Spadolini 825b23049e session-helper: move srv.RunAndExit to session/reexec (#65263)
* Move the reexec parts of lib/srv to session/reexec

* Update references to the moved bits of lib/srv

* Avoid testutils in session/reexec

* Shuffle some constants around to avoid imports in session/reexec

* Vendor in the relevant parts of logutils in session/reexec

* Remove unnecessary symlink checks when opening files

* Inline the last two things from lib/utils in session/reexec

* Inline moved constants

* Deprecate group name consts and fix missed inlines

* Add missing session/reexec.TestMain with reexec check

* Reuse existing constants from the log constants package in session

* Fix broken godoc link
2026-04-08 09:40:52 +00:00
Brian Joerger 74ca5bbfdd Remove extra new line in client error messages (#65206)
* Fix formatErrorWriter adding duplicate new lines.

* Address comments.

* Address claude comment.
2026-04-07 19:50:30 +00:00
Brian Joerger 305d777d5a Propagate SFTP errors to the client (#63921)
* Fix sftp errors caused by client closing early; propagate sftp stderr to the client; Fix audit event emitted with closed context.

* Fix sftp remote subsystem graceful exit; Add regression test.

* Capture sftp reexec stderr.

* Add auditContext interface to remove sftp dependency on ServerContext.

* Fix line break for SFTP stderr.

* Address claude comments.

* Use common waitForOutputStreams waitgroup logic for SFTP pipe logic.

* Address comments.

* Address comments.

* Revert overengineered graceful shutdown behavior.

* Address comments.
2026-04-07 19:26:23 +00:00
Forrest 3fc4c4cf3b relax scoped resource write validation (#65333) 2026-04-07 17:28:11 +00:00
Noah Stride 1937190a6a Fix tctl get scoped_token panic when handling tokens with nil status (#65453)
* Avoid panic for non-token type tokens

* Improve table output when secrets omitted

* Tests
2026-04-07 15:35:26 +00:00
Tiago SilvaandNic Klaassen e54bfb9ab7 enforce region validation on all AWS config loading (#64893)
* enforce region validation on all AWS config loading

Replace direct uses of `github.com/aws/aws-sdk-go-v2/config.LoadDefaultConfig`
with the internal `lib/cloud/aws/config.LoadDefaultConfig` wrapper, which
validates any explicitly requested AWS region before use. Enforces this via a
new forbidigo linter rule.

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>

* Apply suggestions from code review

Co-authored-by: Nic Klaassen <nic@nicklaassen.ca>

* fix unit tests

* include underscores and uppercase letters

* add ConfigureRegion

---------

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
Co-authored-by: Nic Klaassen <nic@nicklaassen.ca>
2026-04-07 08:48:47 +00:00
Alan Parra c91288e1ed Add tctl resource support for ca_overrides (#65281)
* Add the api/client.Client.SubCAClient() method

* Implement tctl resource support for cert_authority_override

* Remove `false` booleans

* Change "tctl create" message according to action

* Add support for all 3 forms of "tctl get"
2026-04-06 13:44:30 +00:00
Alan Parra 49aa67e90c Don't t.Parallel() new "tctl edit" subtests (#65346) 2026-04-06 13:41:13 +00:00
dependabot[bot] 51ae934309 Bump nix in /tool/fdpass-teleport in the rust group (#65250)
Bumps the rust group in /tool/fdpass-teleport with 1 update: [nix](https://github.com/nix-rust/nix).


Updates `nix` from 0.31.1 to 0.31.2
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.31.1...v0.31.2)

---
updated-dependencies:
- dependency-name: nix
  dependency-version: 0.31.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rust
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-02 07:39:20 +00:00
Alan Parra 5abac2131f Add the "tctl auth pub-key-hash" command (#65189)
* Add the "tctl auth pub-key-hash" command

* Rename test so it's clearly specific to the pub-key-hash command

* Rename prepareFlags to prepareCommand

* Fix typo on commandState.Stderr
2026-04-01 21:43:31 +00:00
Alan Parra 22956d8984 Fix "tctl edit" multiple resource bugs (#65268)
* tctl edit: Test multi-CA edit

* tctl edit: Fix edit/create fallback

* tctl edit: Key resources by subkind

* Add missing `defer f.Close()`

* Verify keying of new resources

* Remove nolint

* Remove yaml import alias

* Replace inline comment with const

* Use string concatenation
2026-04-01 21:01:40 +00:00
Pavel 791c10e648 Replace TCP socket with unix socket for VNet user-admin IPC for Linux (#64493)
* replace TCP socket with unix socket for VNet user-admin IPC for Linux

* review improvements and fixes
2026-04-01 17:05:16 +00:00
STeve (Xin) Huang dee809f091 Fix an issue tbot start/configure command usage not aligned (#65161) 2026-04-01 13:28:22 +00:00
Edoardo Spadolini 644f415a27 session-helper: submodule preparation and dependencies of lib/srv/reexec.go (#65145)
* Depguard rules for the session submodule

* Move lib/auditd to session/auditd

* Move lib/loginuid to session/loginuid

* Reduce dependencies of lib/utils/envutils

* Move lib/utils/envutils to session/envutils

* Split the SSH utilities of sshutils/x11 into sshutils/x11forward

* Move lib/sshutils/x11 to session/networking/x11

* Move lib/sshutils/networking to session/networking

* Move lib/shell to session/shell

* Move lib/utils/uds to session/uds

* Move lib/utils/host to session/host

* Move lib/pam to session/pam

* Avoid lib/utils/log in session/pam

* Move lib/service/servicecfg.PAMConfig to session/pam/pamcfg.PAMConfig

* Move lib/srv/uacc to session/uacc

* Avoid importing lib/utils in session/uacc

* Move lib/selinux to session/selinux

* Avoid lib/utils and lib/utils/log in session/selinux

* make go-mod-tidy-all

* Update oss-fuzz path for session/networking/x11
2026-04-01 12:34:10 +00:00
Alan Parra 94aa26a705 Add godocs to tool/tctl/common/resources.Handler (#65238)
* Add godocs to tool/tctl/common/resources.Handler

* Change error to mention "tctl rm"
2026-04-01 11:58:20 +00:00
Nic Klaassen d5bc180deb [scopes] feat: add sub_kind for scoped role assignments (#64752)
* [scopes] feat: add sub_kind for scoped role assignments

* make unknown subkinds readable but not writable
2026-04-01 00:28:23 +00:00
Brian Joerger 9bf844fff4 Provide better error message for ambiguous host user creation denial (#62314)
* Provide user friendly error message when host user creation is denied by some, but not all, roles; Add test case.

* Add host user creation error context to any PAM error, not just PAM auth errors; error wrapping on user-facing pam context error.

* Fix test.
2026-03-30 19:31:24 +00:00
Brian Joerger 36feac1a9b Capture stderr from ssh reexec process (#63910)
* Write reexec errors to stderr; Isolate reexec stderr from shell/pam.

* Capture reexec stderr in parent process; Add test.

* Fix flaky test caused by closing the ssh channel before completing stderr copying.

* Remove proxy recording test case to fix test flakes.

* Improve reexec error code handling:

* Don't print Exit Code 255 errors in tsh ssh.

* Don't write exec error to stderr if the exit code happens to be 255.

* Don't print plain exit status in tsh ssh.

* Remove deprecated PTYFile for reexec.

* Wait until stderr from the reexec process is consumed by all parties.

* Fix pipe naming.

* Address comments.
2026-03-30 18:46:55 +00:00
Dan Share e0b8f614af [Browser MFA] Add initial requests for browser MFA process to client tools (#64301) 2026-03-26 20:29:19 +00:00
Dan Upton 4a13ac9eae Support WorkloadIdentity resources in --apply-on-startup and --bootstrap (#64987)
* Support `WorkloadIdentity` resources in `--apply-on-startup` and
`--bootstrap`

* Use `t.Context()`
2026-03-26 16:01:53 +00:00
Dan Share 1c88a1b021 [Browser MFA] Add CompleteBrowserMFAChallenge gRPC (#63873) 2026-03-25 17:13:11 +00:00
Adam Carheden 6360393284 External Audit Storage - Handler Refactor (#64961)
* External Audit Storage - Handler Refactor

* Refactor `tctl` external_audit_storage resource to use Handler pattern

* Made ExternalAuditStorage a non-singleton to prevent deletion without providing a name
2026-03-25 15:36:26 +00:00
Brian Joerger d4c9ed5eed Treat tctl get tokens as a get with secrets. (#64751) 2026-03-24 20:04:17 +00:00
Steven Martin 16b0cbe87c Update tbot, tctl and tsh command descs (#64933)
* Update tctl and tsh descs

* docs: update namespace description

* Update tbot command descriptions
2026-03-24 14:32:44 +00:00
Pavel ce2478a059 Support diag checks on Linux (#64867)
* support diag checks on linux

* add support for tsh vnet --diag

* remove isDiagSupported

* update go.mod for rtnetlink dependency

* skip routes with no output interface
2026-03-23 16:26:38 +00:00
Lion Chen 1e7544f40a Add Documentation for the tsh aws-profile Command (#64450) 2026-03-17 23:38:44 +00:00
Tiago Silva 93accf25b5 tctl recordings: print download path on sucessfull downloads (#64713)
This commit provides a message that tctl recordings download <session-id>
has successfully downloaded a session id to a file.

Closes #64690

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
2026-03-17 14:52:40 +00:00
8385461d56 [vnet] linux support (#63664)
* first build

* add d-bus daemon for vnet

* set up dns server via systemd-resolved d-bus api

* get DNS upstreams via systemd-resolved API

* never forward DNS requests to self

* refactor: move all systemd-resolved logic to a separate package

* refactor: move all polkit logic to a separate package

* filter systemd-resolved loopback upstreams

* add scope for link-local IPv6 adresses for upstreams

* comment updates, small fixes, and typo cleanup

* return uid from D-Bus authorize func

* add typed constants for systemd unit states

* avoid using canceled context for stopping VNet daemon

* refactor: do not store ctx in dbusDaemon

* Improve dbusDaemon lifecycle handling

* Log errors from `dbusDaemon.Wait`

* refactor: reuse shared darwin/linux code for admin process

* reintroduce isDiagSupported

* refactor logging errors from dbusDaemon.Wait

* do not return error for missing TUN during deconfigure

* use d.conn.Context()

* avoid using bare slog logger

* avoid mutating cached upstream nameserver slices

* fix race between dbus Start and Stop

* small fixes

* some refactoring

---------

Co-authored-by: Nic Klaassen <nic@goteleport.com>
Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
2026-03-17 14:23:25 +00:00
Paul Gottschling 7e245bd716 Add generated note to CLI reference docs (#64466)
Make it clear in generated CLI reference docs that they were generated
so authors do not attempt to edit them directly. Edit the template for
generated CLI docs to add a message.

Regenerate CLI references to include the message. This also updates the
references.

Note that the CLI reference doc generation is not yet fully idempotent,
so we cannot enforce generation.

To pass linting, edit the `teleport` CLI to use "Amazon Bedrock" (the
correct product name) in an error message instead of "AWS Bedrock".
2026-03-16 13:09:55 +00:00
Steven Martin cb0d95cfa2 Remove repeated words in cli command descriptions (#64654)
* Remove repeated words in cli command descriptions

* Remove duplicate description word for tctl sso configure
2026-03-16 12:57:36 +00:00
Tim Buckley 5a22c83420 MWI: Add certificate expiry check leeway for tbot (#64293)
* MWI: Add certificate expiry check leeway for app tunnel service

This adds some leeway to the application-tunnel service's certificate
expiration check.

For context, the app tunnel service does not follow Machine ID's
usual certificate renewal cycle and instead opts to renew
certificates just-in-time before completing a request if the
certificate has expired per the local clock.

Unfortunately, the local clock is not always accurate, and if the
certificate or underlying app session has already expired from the
server's perspective, client requests can still fail until the local
clock catches up and the certificate is refreshed.

To mitigate this, this change adds a `leeway` parameter to the
service, configurable via YAML, with a default value of 1m. This is
added to the current time when certificate validity is checked. This
means that, in the worst case, certificates will be refreshed to early
rather than too late.

See also: #64284

* Remove duration pointer and ignore leeway if greater than cert TTL

* Make tbot's leeway parameter global

This makes the leeway parameter global, and additionally uses it in
the main renewal loop (for the expired bot internal identity
detection) and in the database tunnel service.

Also adds some test coverage for app tunnel cert renewals.

* Tweak doc comment for clarity

* Remove unused code

* Ignore excessive leeway values in identity service

* Honor effective lifetime in leeway check

* Fix leeway var reference

* Update golden tests

* Codex reviewer appeasement

Factor in actual cert TTL in the leeway cap.

* Fix failing test

* Fix imports
2026-03-13 00:47:15 +00:00
williamong-tel fee0426568 Add scope aware profiles after tsh login (#64233)
* Add scope aware profiles after tsh login

Update tsh.go

fix some minor issues

Update client_store_test.go

fix rebase

Update client_store.go

Add scope changing feature

Update tsh.go

Update tsh.go

* Remove "none" descoping

Update tsh.go

clean up

* nil the scope pin when "" is in the profile instead of scope pin ""
2026-03-12 19:20:53 +00:00
Edoardo Spadolini ed76e109f3 Forbid semver.New in the forbidigo linter (#64307)
* Forbid semver.New in forbidigo

* Fix type in require.Greater

* Fix missed semver.New in build.assets

* Restore whitespace in Test_formatAzureIdentities

* Re-fix TestAzure
2026-03-11 08:39:00 +00:00
Lion Chen cfa451991a Add AWS Account Name and SSO Region Label Constants (#64397)
* created two AWS IC constants for account and sso region

* fix inconsistency
2026-03-09 23:19:21 +00:00
Steven Martin abc464ce3c Error message spell fixes (#64408)
* Error message spell fixes

* Error message spell fix
2026-03-09 11:03:34 +00:00
Forrest bfd47bc4f8 rework scoped rbac for single-role eval model (#63219) 2026-03-06 18:46:42 +00:00
williamong-tel d63e94dca9 Support scoped tokens in terraform provider (#63957)
* Add scoped token support to terraform provider

Update with examples

Deleted unneeded duration

Fix test

Update presets_test.go

update docs

* clean up

* Update edit_command_test.go
2026-03-06 16:34:02 +00:00
Grzegorz Zdunek b3adaffad6 Connect: install updates via privileged service, add signature verification (#63573)
* Add service commands to tsh

* Install updater service and run updates through it

* Add signature verification

* Disable CTMU for `tsh.exe connect-updater-install-update`

* Force install mode when migrating from one-click to assisted multi-user

* Spawn `tsh.exe connect-updater-install-update` synchronously and catch errors

* Use single parent command, remove args from `service.Start`

* Do not ignore error from closing handle

* Grammar fixes

* Use single command in installer.nsh too

* Use `svc.IsWindowsService()` instead of `isWindowsService`

* Switch from `CertCompareCertificateName` to comparing subject properties

* Log certs if they don't match

* Improve comment
2026-03-06 13:52:51 +00:00
nixpigandMarek Smoliński 4726a384c0 Update suggested reviewers to include owners of JIT access lists (#64046)
* Update suggested reviewers to include owners of JIT access lists

* Replace undefined with empty array so data serialises without error

* Use consistent proto naming

Co-authored-by: Marek Smoliński <marek@goteleport.com>

* Remove unused req return value from reviewer list function

* Remove suggested reviewers logic from OSS API

* Tests and tidy up

* Refactoring

* wip

* Remove changes addresses in a separate PR

* Remove proto for reviewers

* Add godoc

---------

Co-authored-by: Marek Smoliński <marek@goteleport.com>
2026-03-06 10:44:35 +00:00
williamong-tel 7f976c670a Add update scoped token rpc & amend upsert behavior (#64189)
Update and upsert scoped tokens will reject any changes to secret, but will allow requests to come in if status is not present, not changing the secrets.
2026-03-05 22:25:33 +00:00