2770 Commits

Author SHA1 Message Date
Yassine Bounekhla c33da95ee3 Fix Auth Connectors UI UX papercuts related to MFA (#67593)
* improve auth connector mfa UX

* CR

* fix e2e

* add more tests

* CR
2026-07-02 07:45:35 +00:00
Nick Marais 8a67cffc31 feat: Add tctl integrations test command (#68086)
* Extract bold util

* Add `tctl aws test-oidc` command

* Update docs

* Drop `FPrint` errors

* Move to `tctl integrations test` command

* Fix lint

* Move integration name to arg

* Replace explicit `testIntegrationOutput` interface

* Change "operational" to "healthy"

* Update cli docs

* Use snapshots
2026-07-01 14:33:36 +00:00
Chris Thach 25931088b3 Add AuthCallback to SSH clients to perform in-band MFA (#65904)
* Add AuthCallback to SSH clients for in-band MFA.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Name return val. Rename to createPerformer. Add lint rule num.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Document why mfaPromptCount is 2. Use cmp to compare got/want conf.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Convert to table test for TestAuthCallback.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Replace terminal.WSConn with *terminal.Stream.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Update comment to reflect uniqueness. Normalize test indentation.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Clean nolint gosec, proposal comment and dead MFAServiceClient method.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Comments for AuthCallback more future proof. Restore MFACeremonyPerformer.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Reuse ClusterClient.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Increase timeout when MFA might happen.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Extend timeout for only the SSH handshake and preserve timeout for TCP dial.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Unexport timeout const.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Restore named error.

Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>

* Use AuthCallbackConfig. Remove helper and restore inlining.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

---------

Signed-off-by: Chris Thach <chris.thach@goteleport.com>
Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
2026-06-29 14:28:54 +00:00
Alan Parra ff63bc8499 Add the tctl auth update-override command (#68024)
* Add the `tctl auth update-override` command

* make cli-docs

* Use proto opaque API

* Use subca.NormalizePublicKey
2026-06-29 12:09:15 +00:00
Gavin Frazar 36c4549240 Add Azure label helper functions (#68023)
* Add Azure label helper functions

* Remove misleading Azure label comments

The internal labels serve a different purpose than the visible
labels - they are not superseded by visible labels.
2026-06-26 23:14:42 +00:00
Lisa Kim e170b2e1f2 Add tctl acl update for access list (#67656)
* Move from e/builder.go to open source

* map to Labels converter

* Introduce new update flags

* Implement update logic

* Add test

* Address review and improve update text

* Fix lint, fix audit start date, reorder member update
2026-06-26 05:50:15 +00:00
Alex Carrithers bc79a013f6 tctl: add structured output to selected mutation commands (#67261)
* tctl: add structured output to selected mutation commands

* tctl: update workload identity commands to use legacy resource wrapper for consistent output formatting

* tctl: fix workload identity revocation to use opaque proto builders

* tctl: update device enrollment token output to include asset tag name

* tctl: update workload identity revocation test to use UnmarshalOptions for unknown fields

* tctl: move structured-output tests off slow integration tests to fix flaky timeout

* Address PR feedback

* Fix lint errors
2026-06-25 13:42:10 +00:00
Michael Patterson-Muir c384a8b4b0 discovery: split tctl discovery nodes command wiring (#68000)
* removed presence check for IntegrationName as this can be empty when the fetcher is using ambient credentials.

* refactor command to support multiple subcommands

* lint fix
2026-06-24 17:02:27 +00:00
Lisa Kim 6931d6fc77 Add tctl rm support for access list (#67463)
* Add tctl rm support for access list

* fix lint
2026-06-23 18:29:33 +00:00
Aleksei Kozadaev 9325334ab2 tsh: add "tsh apps logins" command. (#67899) 2026-06-23 14:46:13 +00:00
Ghassan Gedeon Achi 94528c8145 fix: tctl help message broken with investigate (#67930) 2026-06-22 17:15:19 +00:00
Alan Parra 76aad3bbcf Add the tctl auth delete-override command (#67923)
* Add the `tctl auth delete-override` command

* make cli-docs

* Use proto opaque API
2026-06-19 18:05:00 +00:00
Alan Parra 72d22e600a Add the tctl auth create-override command (#67907)
* Add the `tctl auth create-override` command

* Improve add help strings

* make cli-docs

* Use proto opaque API
2026-06-19 16:19:20 +00:00
Trent Clarke c3975a937b [AWSIC] Tightened filter validation and application (#67234)
Fixes a couple of issues discovered the Identity Center resource filtering code:

 1. The regex-based filters compile their regexes on every search, rather
    than once up front. This is not as bad as it sounds due to Teleport's
    regex cache, but it is still not ideal.
 2. The filter validation and execution steps behave differently, so that
    it is possible for an invalid filter to make in past validation and
    only be discovered while the plugin is running.
 3. The volume log spam generated by a poorly-formed filter that managed
    to make it past validation would *astronomical*.

This patch addresses those issues by

 1. Compiling the wire-format, protobuf filter objects from the plugin
    spec into a known-good filter at construction time, and using that
    as the runtime definition of the filter.
 2. Compiling the filter regexes during this construction-time setup
    rather than just hoping that they are cached by Teleport
 2. Validating the filter stack once during this compilation phase,
    rather than forcing the runtime matching code to be super very
    defensive. This also removes inconsistent behaviour between the
    validation at construction time vs. run time.
2026-06-19 03:48:01 +00:00
rosstimothy c5fd8b9088 [3] Final migration to the Opaque API (#67385)
All of the changes here are mechanical conversions generated from
open2opaque rewrite -levels=red./.... This concludes the conversion of
teleport to consume the opaque APIs. The corresponding changes in
teleport.e must be completed prior to switching entirely to opaque codegen.

See https://protobuf.dev/reference/go/opaque-migration/ for more details.

The Lint job was also updated to prevent any Open API uses until we can
fully convert to the Opaque API.
2026-06-18 19:41:17 +00:00
rosstimothy 510859bfb8 Improve Scoped Token UX (#67819)
Removes any externally visibile notions to end users that a
token name and token secret are two different entities. This
removes the need to output a token_name and token_secret value
from `tctl scoped tokens add` as well as removing the token_secret
from teleport.yaml and teleport CLIs.

Internally, the name of a scoped_token is still NOT a secret. The
secret is a separate field in the scoped_token.status. When the
token is presented to a user it is done so as `<token_name>:<base64(token_secret)`.
The leading token_name is not encoded to allow users to visually
dentify tokens they may have created with a specific name. The `~`
separator was chosen because it is neither a valid backend key, scope
separator, and does not need any special encoding if included in a URL.
The token_secret is base64 encoded so that it appears as opaque text
to users and can be included in a URL.

Additionally, the tctl scoped ref parsing has been updated such
that tctl get/edit/rm honors both `<token_name>` and `<token_name>:<base64(token_secret)>`

This does contain a few breaking changes. The token_secret has been removed
from the teleport.yaml file config and its equivalent CLI flags have been
removed. Since scopes are still under active development and this only impacts
scoped_tokens and not traditional tokens the impact of this change should be
minimal.
2026-06-18 16:17:40 +00:00
Dan Share 5a9dde3e7c Fix TestSSHOnMultipleNodes flaking (#67503) 2026-06-18 15:23:47 +00:00
Aleksei Kozadaev 3425f61d07 Add interative mode to tsh apps login aws-console (#60151) (#67755) 2026-06-18 11:52:23 +00:00
Ghassan Gedeon Achi 0405d1e2b9 feat: add tctl access-changes get command (#67329) 2026-06-17 23:12:32 +00:00
Ghassan Gedeon Achi a7300c4b94 feat: add tctl access-changes ls command (#67328)
Mirror the web UI's filtering by accepting a repeatable flags. And
adding the `--filter` as an envelope that allows combining filters
(AND semantics). Multiple distinct flag filters are OR'ed together.
2026-06-17 21:13:20 +00:00
Ryan Clark a02aeaac3b Change classifier terraform/YAML handling to accept friendly values (#67884)
* Accept and return booleans for Classifier action modes in tctl

* Accept short risk levels and strict booleans for Classifier in tctl
2026-06-17 13:58:34 +00:00
Pavel b5071fba5a [vnet] Add DNS routing diagnostic check (#66851)
* add dns diagnostic check proto

* add DNSServerSuffix and DNSServerPort constants

* handle dns diagnostic probe queries

* add dns diagnostic check

* enable dns diagnostic check in Connect

* run dns diagnostic check in tsh vnet

* render dns diagnostic check in Connect

* fix some nits

* move ssh diag check after dns check

* handle dns diagnostic probe A queries

* add dns diagnostic check proto for A queries

* refactor dns diagnostic check to also check A records

* refactor Connect to also render dns diagnostic A records

* drop trailing dot from dns diag probe

* add tests for dns diag text rendering

* do not fail dns diag if any nameserver is reachable

* Adjust spacing between DNS diag success/warning rows

* fix some nits

* improve rendering of dns reachability errors

---------

Co-authored-by: Maja Cieślak <maja.cieslak@goteleport.com>
2026-06-17 10:56:34 +00:00
Ryan Clark 129d150383 Add Classifier backend storage, cache, gRPC service, and tctl support (#67761)
* Add Classifier backend storage, cache, gRPC service, and tctl support

* Fix formatting in lib/services/summarizer_test.go

* Replace Cache.AllClassifiers with RangeClassifiers using genericLister

* Validate that the filter is a boolean expression

* Code review fixes: sync test, range fallback
2026-06-16 14:47:39 +00:00
Noah Stride 9fe6985113 Adjust provision.Token interface to unsplit Bot accessors in preparation for SQN (#67746)
* Adjust `provision.Token` interface to unsplit Bot accessors in preparation for SQN (variant b)

* add todo godocs
2026-06-16 08:28:45 +00:00
Hugo Shaka 3f85510a0c Convert trusted cluster to tctl handler format (#67646) 2026-06-15 15:33:44 +00:00
Ghassan Gedeon Achi 821d50f902 feat: add geo filters to stats endpoint (#67523) 2026-06-12 20:53:04 +00:00
Ghassan Gedeon Achi 708dbb1bd9 tctl-investigate[2]: add text output, geo filters, and --skill (#67220)
* feat: text output, geo, and `--skill` support

Layer three orthogonal additions on top of the core command:

  - Text rendering: period header, matches summary, wrapped facet
    panel, events table. `--all-facets` opts out of the top-5
    truncation.
  - Geo filter (`--latitude`/`--longitude`/`--radius`, all three
    required together). Geo applies to events only; the stats endpoint
    has no geo params, so facet counts and `total` cover the
    window+query without geo. Text output prints a Note when geo is
    active.
  - `--skill` prints an embedded Markdown skill for LLM agents and
    skips the backend entirely.

* fix: update skill to follow RFD 0037e

* fix: small fixes reported in PR review

* fix: small suggestion about code comment

* feat: iteration based on notion/customer request

* feat: add sanitization to text rendering

* fix: small fix to the access request review

* fix: typos and PR suggestions

* fix: help message indentation
2026-06-11 18:27:12 +00:00
Ghassan Gedeon Achi f583472e9a tctl-investigate[1]: add activity-log search command (#67219)
* feat: add `tctl investigate` command

Add a tctl subcommand that searches Teleport's Identity Security
activity logs. The command exposes structured filter flags mirroring
the Identity Security UI: ~19 include/exclude pairs mapping to Lucene
fields (user, resource, IP, country, etc.). Multiple values on the
same flag are OR'd; different flags are AND'd.

`--query` accepts a raw Lucene expression for cases the structured
flags can't express (wildcards, regex, OR across fields) and is
mutually exclusive with the structured filters.

Facets and events are fetched in parallel via errgroup. `total` is
derived from the `event_type` facet on the stats endpoint, so it can
drift a few percent from `len(data)` on long windows.

This PR ships JSON/YAML output only. Text rendering, the geo filter,
and the `--skill` flag land in the next PR in the stack.

* fix: address codex suggestions

* fix: update flag description
2026-06-11 17:47:21 +00:00
Edoardo Spadolini 8ddaac3698 Use unwrapped connections to the Auth API in agents connected to a control plane in multiplex mode (#64177)
* Run the connection upgrade test with reversetunnelv2

* Use unwrapped connections to the auth in multiplex listener mode

* Clarify wording in debug log

* Add a test for ALPN used in direct and proxy mode

* Update godocs

* Change struct names for better clarity
2026-06-11 14:25:34 +00:00
Noah Stride a43fd71911 Migrate GetTunnelConnections/GetAllTunnelConnections to gRPC (#66066)
* hack on migrating list RPC

* Fix tests

* Tidy up/fix tests

* Use `clientutils.CollectWithFallback`

* Use clearer c.APIClient rather than rely on embeding

* Cover ListTunnelConnections in cache test

* tweak logging

* update deprecation version

* Move fallback impls

* fix span ctx prop

* fix pagination bug when unmarshal bad

* USe t.Context()

* fix ctx propagation

* Update tunn conns to use range pattern - thanks luke

* fix unneeded dependency

* fix deprecation

* env: dev
use opaque API
2026-06-11 12:44:50 +00:00
Forrest 52f4a21526 scope-qualified names (#67364) 2026-06-10 18:25:05 +00:00
nixpig 6f88342fca Add Okta assignment target status to tctl resource output (#67498) 2026-06-09 09:19:44 +00:00
Alex Carrithers 8de3b4f238 tctl: add structured output to status commands (#67201)
* tctl: add structured output to status commands

* tctl: use test context in auto update agent status tests
2026-06-09 08:36:53 +00:00
Pavel 2265165125 Improve role expressions validation (#66030)
* add session filter, access predicate, impersonate checks; fail fast on invalid expressions at create/update

* add list indexes to role validation error messages

* reject wildcards in search_as_roles and preview_as_roles

* validate join_sessions and require_session_join fields

* include index and tool value in mcp.tools validation error

* update commentary

* aggregate errors in ValidateRole

* aggregate errors in ValidateAccessPredicates

* validate linux_desktop_logins templates
2026-06-08 17:35:49 +00:00
rosstimothy 02a758b23a [2] Migration to the Opaque API (#67384)
* Convert existing non-gogo codegen to the Hybrid API

Contributes to https://github.com/gravitational/teleport/issues/66776.

All existing protos explicitly set to API_OPEN have been change to
API_HBYRID. The new codegen was performed via make grpc. There are no
other functional changes to the code to start consuming the Hybrid API
those will come later. The intent is to get all Hybrid codegen in and
backported to ease the transition.

* Initial migration to the Opaque API

Contributes to https://github.com/gravitational/teleport/issues/66776.

All of the changes here are mechanical conversions generated from
`open2opaque rewrite -levels=green ./...`. There will be a follow up
to this in teleport.e which does the same. Once all changes have been
merged the process will be repeated with -levels=yellow followed by
-levels=red.


See https://protobuf.dev/reference/go/opaque-migration/ for more
details.

* [2] Migration to the Opaque API

Contributes to #66776.

All of the changes here are mechanical conversions generated from
open2opaque rewrite -levels=yellow./.... There will be a follow up
to this in teleport.e which does the same. Once all changes have been
merged the process will be repeated with -levels=red.

See https://protobuf.dev/reference/go/opaque-migration/ for more details.
2026-06-08 13:21:41 +00:00
Tiago Silva 679d627839 Fix tctl recordings search pagination and surface fetch errors (#67545)
"Load more" in the recordings search TUI (and --resume-token) failed with
"start_time is required" after the latest access graph update.
Follow-up pages were sent with only the batch_token, relying on the
proto comment that claimed all other filter fields are ignored
once batch_token is set. That contract is wrong: the server validates
and applies start_time/end_time and every other filter on each request,
and the access graph re-checks that the checkpoint falls
within the requested time range.

The batch token is intentionally only a cursor and does not carry the full
search state - encoding every filter into the token would let it grow to
very large sizes. So the original request must be replayed with the
batch_token set on each page. Build the request once and have the fetcher
clone it and attach the token for the initial page, resume, and load-more,
fixing both the TUI and --resume-token.

Also surface the fetch error back to the user: a failed "load more" now
opens a popup with a red header and the server message rendered as code,
instead of silently swallowing the error behind a "(retry)" label.

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
2026-06-08 12:10:40 +00:00
rosstimothy 4f17314a11 Initial migration to the Opaque API (#67279)
* Convert existing non-gogo codegen to the Hybrid API

Contributes to https://github.com/gravitational/teleport/issues/66776.

All existing protos explicitly set to API_OPEN have been change to
API_HBYRID. The new codegen was performed via make grpc. There are no
other functional changes to the code to start consuming the Hybrid API
those will come later. The intent is to get all Hybrid codegen in and
backported to ease the transition.

* Initial migration to the Opaque API

Contributes to https://github.com/gravitational/teleport/issues/66776.

All of the changes here are mechanical conversions generated from
`open2opaque rewrite -levels=green ./...`. There will be a follow up
to this in teleport.e which does the same. Once all changes have been
merged the process will be repeated with -levels=yellow followed by
-levels=red.


See https://protobuf.dev/reference/go/opaque-migration/ for more
details.
2026-06-05 14:52:58 +00:00
Tiago Silva 7fd409da6b tctl recordings search: rename time flags and add JSON/YAML pagination (#67501)
Rename --from/--to to --from-utc/--to-utc on `recordings search` to
match the `recordings ls` flag naming convention. The old names are
kept as hidden aliases for backward compatibility.

For JSON and YAML output formats, automatically paginate through result
batches until up to 500 sessions are collected rather than stopping
after the first batch. When results are truncated, a --resume-token
hint is printed to stderr so the caller can continue from where the
previous run left off.

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
2026-06-05 10:36:24 +00:00
Noah Stride 4bb3181f74 Fix missing assignment of ctx including tracing span (#67469)
* Fix missing assignment of ctx including span

* unoffend linter

* Use nolint instead
2026-06-05 09:05:10 +00:00
dependabot[bot] 9a9829a9f3 Bump nix in /tool/fdpass-teleport in the rust group (#67361)
Bumps the rust group in /tool/fdpass-teleport with 1 update: [nix](https://github.com/nix-rust/nix).


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

---
updated-dependencies:
- dependency-name: nix
  dependency-version: 0.31.3
  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-06-04 16:22:11 +00:00
Lisa Kim b0b6b8b663 Move tctl acl command into its own directory (#67334)
* Move tctl acl command into its own directory

Create a accesslist preset file to be referenced later
in future acl commands

* Remakes the original acl_command.go file

This is so that during merging, the enterprise build doesn't break
This file will be removed once all merging is complete.
2026-06-04 01:06:03 +00:00
Lion Chen e2114f2116 Add a Shared User Display Formatter for the CLI (#67293)
* Add FormatUserDisplay helper for CLI user identity output

* refactor: reuse terminal control sequence handling

* update FormatUserDisplay output format for clarity

* fix tests

* test: update TestFormatUserDisplay_CanonicalForms to include empty input case
2026-06-03 21:10:30 +00:00
Kevin 49f98b260e Fix tsh request show output formatting (#66232) 2026-06-03 16:39:57 +00:00
Edoardo Spadolini 5c1c9d157d Disable the embedded session helper by default (#67386) 2026-06-03 09:56:48 +00:00
rosstimothy 58126ad723 Remove lib/client as a dependency of lib/config (#67257)
Relocates client.ParseLabelSpec to lib/utils/parse. This results in
a net 5MB reduction in the weight of lib/config. This may not
have a correlation in binary size since lib/client is heavily consumed
by other packages.

```bash
$ goda cut './lib/config:all' | rg '^github.com/gravitational/teleport/lib/client\b|^ID'
github.com/gravitational/teleport/lib/client   InDegree=1   Cut.PackageCount=75   Cut.AllFiles.Size=5.3MB   Cut.Go.Lines=129512
```
2026-05-29 15:42:50 +00:00
Alex Carrithers 3b2b7d1882 tctl: document existing format flags (#67163) 2026-05-29 13:48:14 +00:00
Grzegorz Zdunek 8c15be1f1a Properly escape resource names in predicate expressions (#67227) 2026-05-29 13:38:48 +00:00
rosstimothy 45a427eedc Rework scopes feature flags (#67073)
Replace the functions in the scopes package to infer if scoped features
are enabled with a concrete struct that is injected to consumers. This
permits tests to toggle scopes features without having to specify environment
variables.
2026-05-29 13:37:25 +00:00
Ghassan Gedeon Achi 47bfc60239 feat: add detection get command to tctl (#66888)
Adds the `tctl detections get` command that allows you to retrieve the
details of a security alert from Access Graph.
2026-05-28 21:58:12 +00:00
Ghassan Gedeon Achi 23c42032f7 feat(tctl): add detections ls for Access Graph (#66885)
Adds the first user-facing Access Graph tctl command, listing security
detections with filters and a time window.

Talks to Access Graph through the web proxy and relies on the backend's typed
501/credential errors (see access-graph#1998) instead of a pre-emptive
features.json probe, so the CLI stays stateless.
2026-05-28 21:04:32 +00:00