100 Commits
Author SHA1 Message Date
rosstimothy 0e7339eb21 Guard against enterprise code being imported in OSS (#432)
Export-Source-Commit: 3c11f109f6efba5f875993e47171e52119ed9378
2026-08-25 11:35:10 -05:00
rosstimothy 37c3a8a456 Terraform: convert auto update version to generic provider (#69514)
Contributes to https://github.com/gravitational/teleport/issues/69301.
2026-08-13 02:43:07 +00:00
rosstimothy 17df2634f5 Terraform: convert ui config to generic provider (#69507)
Contributes to https://github.com/gravitational/teleport/issues/69301.
2026-08-13 00:21:42 +00:00
rosstimothy 9c1fc271b5 Remove Firestore key migration (#69590)
In preparation for 19.0.0 this removes all references
to legacy or broken record keys. The background key
conversion will have already converted all legacy or broken
keys thus allowing the removal of the migration and the key types.
2026-08-12 21:24:08 +00:00
rosstimothy b3cf83c163 Terraform: convert recording config to generic provider (#69491)
Contributes to https://github.com/gravitational/teleport/pull/69403.
2026-08-12 17:25:52 +00:00
rosstimothy be98bed86e Terraform: convert classifier to generic provider (#69423)
Contributes to https://github.com/gravitational/teleport/pull/69403.
2026-08-12 17:06:52 +00:00
rosstimothy 5dd08bd2e2 Stop honoring teleport.cache.enabled (#69439)
Caching has become an integral part in functionality provided
by teleport. Allowing users to disable the cache was never something
that was a recomended configuration - it was predominately used
as a stopgap to address an outage. However, over time the cache
has become more stable and the need to bypass it should never
arise.

Additionally, this toggle causes several architectural difficulties
that increase complexity and maintainability of teleport. By always
enforcing that the cache is on, we can eventually separate the gRPC,
backend, and caching layers - a frequent developer experience nightmare.
Moving to a world where the cache is always guaranteed to be present
and available we will be able to remove layers of abstraction and
increase performance.


We do still honor `teleport.cache.max_backoff`. While it was tempting
to remove all teleport.cache knobs, it seemed that still allowing users
to control the backoff interval could alleviate any caching related
issues that lead to or are contributing to an outage. This seemed rather
important to still offer now that the ability to disable caching no
longer exists.
2026-08-12 02:12:37 +00:00
rosstimothy 6b9793e1bb Terraform: convert trusted device to generic provider (#69427)
Contributes to https://github.com/gravitational/teleport/pull/69403.
2026-08-11 20:12:14 +00:00
rosstimothy 654ec63590 Fix tsh ls -R -v formatting (#69562)
https://github.com/gravitational/teleport/pull/69282 incorrectly moved the
columns for recusrive listings which resulted in the data being presented
incorrectly. Equivalent golden tests for non-recursive listings have been
added to catch and prevent future regressions.
2026-08-11 19:55:45 +00:00
rosstimothy 5a674cded9 Terraform: convert networking config to generic provider (#69488)
Contributes to https://github.com/gravitational/teleport/pull/69403.
2026-08-11 17:46:12 +00:00
rosstimothy 4631a36d1e Terraform: convert login rule to generic provider (#69426)
Contributes to https://github.com/gravitational/teleport/pull/69403.
2026-08-10 21:33:01 +00:00
rosstimothy 2b37573345 Terraform: convert workload identity to generic provider (#69416)
Contributes to https://github.com/gravitational/teleport/issues/69301.
2026-08-10 21:02:28 +00:00
rosstimothy e739b487a0 Udpate tsh ls output to display the SQN (#69282)
Removes the scope column in favor of displaying the SQN in the
Node Name column.

Before:

```console
$ tsh ls
Scope          Node Name   Address    Labels
-------------- ----------- ---------- -----------------------------------
/example/basic tunnel-node ⟵ Tunnel   arch=,env=test,os=mac

$ tsh ls -v
Scope          Node Name   Node ID                              Address    Labels
-------------- ----------- ------------------------------------ ---------- --------------------------
/example/basic tunnel-node 48e6d07d-6f64-472f-93b1-1d4dd991b4a1 ⟵ Tunnel   arch=arm64,env=test,os=mac

```

After:

```console
$ tsh ls
Node Name                   Address    Labels
--------------------------- ---------- --------------------------
/example/basic::tunnel-node ⟵ Tunnel   arch=arm64,env=test,os=mac

$ tsh ls -v
Node Name                   Node ID                              Address    Labels
--------------------------- ------------------------------------ ---------- --------------------------
/example/basic::tunnel-node 48e6d07d-6f64-472f-93b1-1d4dd991b4a1 ⟵ Tunnel   arch=arm64,env=test,os=mac

```
2026-08-10 20:18:12 +00:00
rosstimothy 977ca737f7 scopes: allow nodes to be retrieved via ListResources (#69479)
Resolves https://github.com/gravitational/core/issues/151
2026-08-10 19:59:52 +00:00
rosstimothy 4dd11deb01 Terraform: convert db object import rule to generic provider (#69421)
Contributes to https://github.com/gravitational/teleport/issues/69301.
2026-08-10 19:49:14 +00:00
rosstimothy 242ba1839c Terraform: convert okta import rule to generic provider (#69402)
Contributes to https://github.com/gravitational/teleport/issues/69301.
2026-08-10 18:35:42 +00:00
rosstimothy 42541eb876 Terraform: convert trusted cluster to generic provider (#69399)
Contributes to https://github.com/gravitational/teleport/issues/69301.
2026-08-10 15:41:06 +00:00
rosstimothy 15ca6d0bbd Terraform: convert health check to generic provider (#69419)
Contributes to https://github.com/gravitational/teleport/issues/69301.
2026-08-07 21:02:57 +00:00
rosstimothy 47ac6c451f Terraform: convert access monitoring rules to generic provider (#69418)
Contributes to https://github.com/gravitational/teleport/issues/69301.
2026-08-07 21:00:19 +00:00
rosstimothy 4e2a29cd4a Terraform: convert dynamic desktops to generic provider (#69401)
Contributes to https://github.com/gravitational/teleport/issues/69301.
2026-08-07 20:12:44 +00:00
rosstimothy e98fa3e28a Terraform: convert role to generic provider (#69397)
Contributes to https://github.com/gravitational/teleport/issues/69301.
2026-08-07 17:23:39 +00:00
rosstimothy e07791dd5b Terraform: Makefile improvements (#69468)
1) Allow make gen-tfschema to run offline by removing -u from go list
2) Prevent stale codgen by deleting previously generated code prior to
   executing go run ./gen/main.go

As a result of 2, some files that don't have an existing payload registered
in gen/main.go have been removed.
2026-08-07 17:14:48 +00:00
rosstimothy 94ee3ab815 Terraform: convert installer to generic provider (#69403)
Contributes to https://github.com/gravitational/teleport/issues/69301.
2026-08-07 17:01:12 +00:00
rosstimothy 9d29ffb5c5 Terraform: convert static host user to generic provider (#69404)
Contributes to https://github.com/gravitational/teleport/issues/69301.
2026-08-07 16:04:57 +00:00
rosstimothy 1ab9183cdd Terraform: convert user to generic provider (#69400)
Contributes to https://github.com/gravitational/teleport/issues/69301.
2026-08-07 16:02:36 +00:00
rosstimothy fed581a3ec Terraform: Convert Lock to generic provider (#69398)
Contributes to https://github.com/gravitational/teleport/issues/69301.
2026-08-07 15:55:01 +00:00
rosstimothy 13be5bd0fe Terraform: convert database to generic provider (#69396)
Contributes to https://github.com/gravitational/teleport/issues/69301.
2026-08-07 14:37:15 +00:00
rosstimothy ebb728fbd2 Terraform: Convert Auth Preference to generic provider (#69099) 2026-08-07 13:19:03 +00:00
rosstimothy e930cf7591 docs: Updates Scoped RBAC guide (#69201)
- Add deatils about SQNs
- Ensures resources are referenced by SQNs
- Updates IaC section to cover additional scoped resources.
- Fixes a reference to a scoped token with a ~ separator
- Add acl users to supported commands
- Fix workload_identity permissions
2026-08-03 18:14:01 +00:00
rosstimothy 6864bdefab Terraform: improve identifier type safety (#69125)
The IdentifierFromPath and IdentifierPolicy functions no longer rely on
positional arguments to improve type safety. Path inputs are now combined
into a single struct with named fields to better catch mistakes. Return
types from IdentifierPolicy functions are now a single struct with named
fields instead of returning multiple strings.
2026-08-03 15:10:19 +00:00
rosstimothy 51f935d920 tctl: output resource SQN instead of resource name (#69148)
Updates tctl get/create/rm to consistently use the SQN instead
of the resource name alone.
2026-07-29 22:32:10 +00:00
rosstimothy 93db5e0278 Namespace scoped tokens (#68981)
* Namespce scoped tokens

Scope tokens are now referred to by SQNs and presented as an SQN to
users in all flows. Collisions between unscoped and scoped tokens
are no longer possible. The ScopedToken Get and Delete APIs have been
updated to take a request object, and the IaC tooling has been updated
to exclusively consume namespaced scoped tokens.

* fix: validate static scoped tokens

* use new scopes.MaybeSQN to determine if an identier is a SQN or not

* fix: get scoped token secrets in TF

* fix: scoped events delete parsing

* fix: scoped token cursors

* add commentary and TODOs

* fix: bound key pair lock name

* fix: only consume legacy tokens when scopes are disabled
2026-07-27 21:46:14 +00:00
rosstimothy c97d53fd48 Terraform: convert scoped resources to generic provider (#68866)
The currently supported set of scoped resources: ScopedRole, ScopedToken,
ScopedRoleAssignment, KubernetesCluster, and App have all been migrated
to the new generic terraform provider mechanism. This is required for those
resources to properly provide the name and scope pair which uniquely identifies
a scoped resource.

Note: not all scoped resources currently support being identifier by a the
(name, scope) pair. However, this conversion is a prereq for when they do.
At such a time, those resources should only require changing the identifier
type and plumbing the name and scope into the Get and Delete requests.
2026-07-27 19:37:20 +00:00
rosstimothy 11b776b515 operator: Support namespaced scoped roles and role assignments (#68909) 2026-07-23 17:52:45 +00:00
rosstimothy 149630fb35 Terraform: Introduce generic provider handling (#68716)
This is in preparation for migrating to non-template based
Teleport resource implementations of Terraform DataSourceTypes
and ResourceTypes. The existing files were moved from terraform/provider
to terraform/provider/internal/legacy.

The terraform driver has been decoupled from Teleport and all the
hacks that the templates used. Instead the driver uses a series
of optional interfaces to perform actions at specific points
of the terraform lifecycle. For now, only a subset of the hooks
from the legacy templates have been adapted to minimize scope.
The hooks chosen were selected out of necessity for the first
resources that will be migrated off the legacy templates.

The other main change introduced here is around how resources
are identified. The legacy templates originally assumed that
all resources were only identified by name. That broke when
access list members were introduced. That now also breaks for
scoped resources. Identifiers used by the driver are now an
interface over a generic type. There are several concrete
implementations that cover the current cases for Teleport
resources: A singleton identifier with a constant name, a
named identifer that maps to a Teleport resource metadata name,
a composite identifer that maps to a name and a prefix, and
now a scoped identifier that maps to a name and a scope. Each
DataSource and Resource implementation can chose the appropriate
one and the driver doesn't care. This is also extensible if
there comes along another resource with a different identifier shape.
2026-07-21 18:49:52 +00:00
rosstimothy 4651772587 Update charlievieth/strcase to v0.0.6 (#68801)
The new version is a prereq to be able to use Go 1.27. The
new version of Go makes changes to unicode which cause
charlievieth/strcase to panic.
2026-07-20 17:46:10 +00:00
rosstimothy d6b730b3a3 Add prereq scope namespacing support for Kube Operator (#68116)
The Kube Operator APIs were updated to support Get and Delete
operations that may operate on a name and a scope. For now
there is no support for actually providing or consuming the scope.
This simply updates the plumbing so that in a follow up change
resources that are scoped will be able to operate.

Note: The operator is still limited in that it cannot have two
resources with same names in the same scope in the same
Kubernetes namespace.
2026-07-18 00:07:40 +00:00
rosstimothy e7ffa17a9c ci: cancel superseded PR workflow runs (#68773)
Specifies concurrency in GitHub workflows such that a PR can
only have one active set of workflows at a time. Prior to this,
if a PR had multiple successive commits pushed, CI would run to
completion for _all_ commits. Now CI will only runn for the latest
commit, any workflows running from previous commits will be terminated.
2026-07-17 23:28:35 +00:00
rosstimothy 7309862f42 Update AGENTS.md (#68449)
RFD 153 is often not followed, and only caught after the fact. In an effort to catch deviations sooner than later, AGENTS.md was updated in an attempt to get the review bot to catch these deviations.
2026-07-09 21:08:55 +00:00
rosstimothy b249a7349a Address CVEs from dependencies (#68509)
Bumps golang/go.opentelemetry.io/otel to 1.44.0
Bumps oras.land/oras-go/v2 to 2.6.1

The updates were performed via socket fix --ecosystem=go --all --json

```
{
  "ok": true,
  "data": {
    "fixedAll": true,
    "ghsaDetails": [
      {
        "type": "applied-fixes",
        "fixes": {
          "GHSA-xf85-363p-868w": [
            {
              "purl": "pkg:golang/oras.land/oras-go/[email protected]",
              "fixedVersion": "2.6.1"
            }
          ],
          "GHSA-vh4v-2xq2-g5cg": [
            {
              "purl": "pkg:golang/oras.land/oras-go/[email protected]",
              "fixedVersion": "2.6.1"
            }
          ],
          "GHSA-fxhp-mv3v-67qp": [
            {
              "purl": "pkg:golang/oras.land/oras-go/[email protected]",
              "fixedVersion": "2.6.1"
            }
          ],
          "GHSA-8xwf-rjm4-xvhv": [
            {
              "purl": "pkg:golang/oras.land/oras-go/[email protected]",
              "fixedVersion": "2.6.1"
            }
          ],
          "GHSA-jxpm-75mh-9fp7": [
            {
              "purl": "pkg:golang/oras.land/oras-go/[email protected]",
              "fixedVersion": "2.6.1"
            }
          ],
          "GHSA-5wrp-cwcj-q835": [
            {
              "purl": "pkg:golang/go.opentelemetry.io/[email protected].0",
              "fixedVersion": "1.44.0"
            }
          ]
        }
      }
    ]
  }
}
```
2026-07-09 20:18:58 +00:00
rosstimothy 6619a58699 Atempt to reduce flakiness of TestMigrationCheckpoint (#68218)
The test was made more deterministic by using a single worker, removing
a shared context with a 10 second timeout for all subtests, using a
unique and per-subtest directory to avoid file collisions, simplifying
checkpoint assertions.
2026-07-02 12:59:50 +00:00
rosstimothy 29307296c7 Atempt to reduce flakiness of Test_consumer_sqsMessagesCollector (#68210)
The tests were refactored to leverage synctest instead of a fake
clock, use a single worker for tests that aren't exercising scheduling,
and remove all require.Eventually uses.
2026-06-30 13:16:04 +00:00
rosstimothy a0581abcf7 Remove deprecated scopes.AssertFeatureEnabled (#68219)
The function was left around until teleport.e used
scopes.Features. The last usage has since been converted
and is now safe for removal.
2026-06-30 12:12:52 +00:00
rosstimothy 6d27a8eb57 Add ScopedOnly mode to the generic scope-aware service (#68096)
The ScopeAwareService and ScopeAwareServiceWrapper no have an
option ScopedOnly flag. When set, the service ignores all items
in the unscoped key range. This is useful for _new_ scoped items
that will never have any resources exist in an unscoped key range,
i.e. ScopedTokens, ScopedRoles, and ScopedRoleAssignments.
2026-06-26 14:22:02 +00:00
rosstimothy 13f5758939 Add scope to ScopedToken get/delete APIs and token abstractions (#68097)
In preparation for making ScopedTokens fully namespaced this adds
a scope field to GetScopedTokenRequest and DeleteScopedTokenRequest.
Additionally, the provision.Token interface was updated to include a
GetScope method that will be consumed to populate APIs that require
a scope in follow up changes.
2026-06-25 21:42:16 +00:00
rosstimothy be037192d5 Fix DynamoDB DeleteRange unprocessed item handling (#66954)
The BatchWriteItem API can return a response with items that failed to
be written without returning an error. DeleteRange could silently
allow items to never be removed under certain conditions because it
never consumed the response.

A new batchWriteItem helper now manages interactions with the BatchWriteItem
API. Any responses with UnprocessedItems are now retried with backoff.

Resolves https://github.com/gravitational/pressure-washing/issues/137.
2026-06-24 23:47:40 +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
rosstimothy 2a44d71345 Bump github.com/oracle/oci-go-sdk/v65 to v65.117.1 (#67816)
This pulls in the latest OCI SDK in order to interact
with recently introduced regions.

This includes the following regions:

- ap-kulai-2
- sa-riodejaneiro-1
- af-casablanca-1
- me-alrayyan-1
2026-06-16 15:51:30 +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
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
rosstimothy 614fe26e4e Convert existing non-gogo codegen to the Hybrid API (#67267)
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.
2026-06-01 18:21:08 +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
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
rosstimothy 3f03489943 Inject build type into teleportassets.DistrolessImage (#66693)
This is purely mechanical change to inject the build type as a
depency instead of relying on modules.GetModules().BuildType().

In addition to contributing to https://github.com/gravitational/teleport/issues/62799
this also serves as a prerequisite to future work that will provide
a user supplied build type that is not based on the modules to
retrieve the correct image.
2026-05-28 14:17:34 +00:00
rosstimothy e82eceb456 Make resolved access requests immutable (#66736)
Prevent access requests in APPROVED, DENIED, or PROMOTED states from
being updated through SetAccessRequestState, including same-state
updates that could otherwise mutate resolution metadata.
2026-05-28 14:11:41 +00:00
rosstimothy c7a82f9325 Use text template for installer script rendering (#67136)
Render `/webapi/scripts/installer/:name` responses with the text
template engine instead of the HTML template engine. The endpoint emits
shell script content, so HTML entity escaping can corrupt rendered values
containing characters such as `&`, `<`, or `>`.

Resolves https://github.com/gravitational/pressure-washing/issues/195.
2026-05-27 19:33:21 +00:00
rosstimothy 10d7a5d2db Replace FileConfig.DebugDumpToYAML with YAMLString (#66903)
Returns the marshal error to the caller instead of panicking, and
removes the unused Config.DebugDumpToYAML method.
2026-05-27 13:39:33 +00:00
rosstimothy b4955bd6a0 Fix: scoped remote conn cleanup (#66990)
The agent scope was never specified in removeRemoteConn which
prevents cleaning up tunnels when scoped resources are disconnected.
2026-05-26 19:01:34 +00:00
rosstimothy b7ec3c26e6 Update AGENTS.md (#67024)
Add an additional entry to Reliability regressions to catch nil
pointer dereferences.
2026-05-26 17:22:47 +00:00
rosstimothy 7279874b17 Extend kube mock server with a generic resource store (#66902)
Replaces the per-type clusterrole/secret handlers with a generic
in-memory store keyed by GVR and namespace/name. Registers
standard CRUD routes for serviceaccounts, configmaps, secrets,
services, roles, rolebindings, clusterroles, clusterrolebindings,
deployments, statefulsets, daemonsets, replicasets, jobs,
networkpolicies, and poddisruptionbudgets. Advertises the apps,
batch, networking.k8s.io, and policy API groups via discovery.
Updates handler errors metav1.StatusReason so client-go can
classify NotFound/AlreadyExists/BadRequest responses.
2026-05-22 14:21:44 +00:00
rosstimothy 37f58b5279 Add preliminary Scoped RBAC documentation (#66444)
This adds a getting started guide with a a high level primer on
scopes, prequisites needed to test scopes today, and examples on how
to use the currently supported scoped features.
2026-05-21 13:57:01 +00:00
rosstimothy 4d7ec05ced Fix sqlite backend KeepAlive revision mismatch (#66930)
Ensures the backend table and events table use the same revision when
updating items during KeepAlive operations. Previously a revision was
generated for _both_ tables causing watchers and Get calls to observe
different revisions.

The backend test suite was updated to validate revisions in the event
stream match revisions in the backend.

Resolves https://github.com/gravitational/pressure-washing/issues/139.
2026-05-21 13:52:38 +00:00
rosstimothy daf519b4ec Fix memory backend value aliasing (#66926)
Ensures the memory backend does not expose or retain caller
owned values by cloning them prior to storing, on gets, and
replicating to watchers.

Resolves https://github.com/gravitational/pressure-washing/issues/143.
2026-05-21 13:50:20 +00:00
rosstimothy d90f946b83 fix: Use pointer types for generated protobuf messages (#66777)
Converts non-pointer protobuf generated Go types to pointers
via `open2opaque rewrite -levels=red ./...`. This contributes to
https://github.com/gravitational/teleport/issues/66776 and was done
separately to isolate per proto file migrations in the future.
2026-05-20 18:28:42 +00:00
rosstimothy 423a964eaf cache: expand pagination coverage for Resource153 (#66775)
Enable pagination tests for Resource153 cache resources by default and fix
resource-specific test setup that previously skipped or bypassed pagination.

This also fixes two issues found:

UserTask upstream fallback listing honors the requested page size and
token.

WorkloadIdentity cache listing forwards the page size and token instead
of infinitely loading the first page.
2026-05-15 18:16:43 +00:00
rosstimothy 9a26d566ba cache: fix pagination test harness leaving cache in an unhealthy state (#66719)
The testResourcePagination helper exercised fallback upstream reads by
setting the cache in an unhealthy state, but never restored the cache
to a healthy state before completing. This resulted in all tests that
supported pagination being exercised against the upstream backend instead
of the cache.
2026-05-13 20:13:57 +00:00
rosstimothy d5d97c1f74 Use the Go Opaque API for all new protos (#66582)
All existing protos have an explicit override for the Open API to
preserve behavior. These protos will be migrated one by one if it
is possible to do so.

Forcing all new APIs to use Opaque by default is a protection mechanism.
The code generated from the Opaque API does not export any of the
fields in the message. All interactions happens via Getters and Setters.
This eliminates a whole class of potential misuse leading to a nil
deference and a panic.
2026-05-11 16:45:18 +00:00
rosstimothy 0a7251aa83 Fix sudoers files not being written (#65998)
Teleport validates the contents of sudoers files by using visudo to
check the contents. The binary is invoked from disk using arguments
-c -f - which indicate to validate the content passed via stdin.

Ubuntu 25 and newer uses sudo-rs by default. This causes problems
because the version shipped in Ubuntu 25 does not contain the fix
for https://github.com/trifectatechfoundation/sudo-rs/issues/1358.
This causes visudo to attempt to read a file with the literal name
`-` instead of from stdin. As a result all Teleport sessions which
try to write a sudoers file entry get a file does not exist error
from visudo.

The sanest way to work around this issue without added burden to
end users is to stop using stdin with visudo. All sudoers entries
are first written to a temporary file on disk and that file is
provided to visudo.
2026-05-04 21:04:16 +00:00
rosstimothy ed41e6c9d5 Enable DCE for most binaries (#66033)
The linker is now able to perform DCE for all binaries except tsh
and teleport. A change to enable DCE for teleport will come in the
future. DCE for tsh will be harder to achieve until kubectl dependencies
are capable of DCE.

This udpates e to include https://github.com/gravitational/teleport.e/pull/8447
which removes the last template usages in enterprise code. Now that
templates are no longer imported a depguard rule has been added to
prevent it from being imported in the future.

The last step to eliminate DCE was to add the grpcnotrace build tag
to all binaries.
2026-04-23 00:15:07 +00:00
rosstimothy fc72fdcdc2 Update tests to inject modules instead of relying on modulestest.SetTestModules (#65976)
This is a pass on replacing modulestest.SetTestModules with supplying modules
where already possible. Some additional uses of modules.GetModules were also
replaced with localized modules injection to permit the removal of
modulestest.SetTestModules in tests. Most of the changes here are mechanical,
the one notable change is in TestSSHCommands. The test was not passing locally
because the shell (fish) builtin echo behaves differently. The easiest way
to produce expected output was to change the command invocation to use
/bin/echo to bypass any shell builtins for consistent behavior.

Inject modules into tool tests

Inject modules into integration tests

Inject modules into join server

Remove superflous enterprise modules in TestAuthenticationConfig_Parse_deviceTrustPB

Inject modules into signature algorithm config tests

Inject modules into TestGithubConnectorCRUDEventsEmitted

Inject modules into TestGetHierarchyForUser

Inject modules into kube proxy tests

Inject modules into controller tests

make fix-imports

add integration/app/fixture as test package
2026-04-22 17:38:51 +00:00
rosstimothy 5870768c88 Stop using text/template and html/template to enable DCE (#65401)
All existing template usage was converted to make use of
github.com/DataDog/datadog-agent/pkg/template. The DataDog package
is a fork of the stdlib template packages with method calling
removed so that reflect.MethodByName does not prevent DCE.

There were a handful of method calls in our templates that were trivially
changed to use custom functions defined via FuncMaps or specifying the
calculated value to the template instead of calling a function in the template.

A future change will add linter rules to prevent new text/template or
html/imports from landing. They have not been included here so as
to not to break enterprise code while it is migrated.
2026-04-22 15:54:43 +00:00
rosstimothy 88d82cf476 Configure kingpin to allow DCE (#65897)
* Update kingpin

* Convert CLI formatting to use kingpin UsageRenderers

Avoiding the legacy kingpin text/templates allows for DCE to be used
by the linker. The existing formatting has been matched with a
pure Go UsageRenderer.
2026-04-22 14:57:55 +00:00
rosstimothy af38e3841a Remove go-cmp from production code (#65960)
Updates e to include https://github.com/gravitational/teleport.e/pull/8354
and removes the last go-cmp depguard exception. All uses of go-cmp
are now exclusively in tests or test helper packages.
2026-04-20 22:46:09 +00:00
rosstimothy 30a56a5c91 Update Access List and Access List Member equality operations (#64715)
Adds an additional accesslist.EqualAccessListsOption,
accesslist.WithIgnoreOktaUserManagedFields to support equality checking
which ignoring Spec.Owners, Spec.MembershipRequires, spec.OwnershipRequires,
and Spec.Audit. This will be used to replace the current go-cmp usage
to determine whether modification of Okta Access Lists are allowed.

(AccessListMember) IsEqual has been restored with a goderived implementation
which checks full equality. This was removed in https://github.com/gravitational/teleport/pull/64542
to prevent accidental use with a services.Reconciler. As of
https://github.com/gravitational/teleport/pull/65151, the Reconcilers
require an explicit comparison function instead of implicitly using
an IsEqual implementation the concerns which led to removing the IsEqual
are slightly mitigated.
2026-04-20 18:04:21 +00:00
rosstimothy c1c5c039aa Stop consuming global modules in auth packages (#65883)
This removes the last few places in lib/auth/* that were
consuming modules with modules.GetModules and setting
them via modulestest.SetTestModules.

Contributes to https://github.com/gravitational/teleport/issues/62799.
2026-04-20 17:01:56 +00:00
rosstimothy 7691ff5a1c Remove dependency on github.com/buger/jsonparser (#65830)
The library has had a number of CVEs recently and uses shady
dependencies. https://github.com/gravitational/teleport.e/pull/8513
removed the dependency pulled in via teleport.e. This updates the
e_imports.go to reflect that change which moved buger/jsonparser to
an indirect dependency.

To remove the dependency entirely, mark3labs/mcp-go was updated to
the latest version. In that version they have replaced
github.com/invopop/jsonschema, which brough in buger/jsonparser,
with github.com/google/jsonschema-go. As a result buger/jsonparser
is no longer in our dependency tree.
2026-04-20 15:55:16 +00:00
rosstimothy 3672719968 Update examples to use moby/moby instead of docker/docker (#65856) 2026-04-16 21:06:57 +00:00
rosstimothy a363e3410a Remove services.CompareResources (#65151)
All remaining reconcilers relying on the default
ReconcilerConfig.CompareResources function have been updated to
provide one explicitly. All direct uses have been replaced with
equivalent functionality via the appropriate IsEqual function.

The golangci-lint depguard rules have been updated to
remove the current exclusions.
2026-04-16 20:10:09 +00:00
rosstimothy 6fc28e0c05 Bump e (#65790) 2026-04-15 17:56:16 +00:00
rosstimothy 76a5ef03a7 Expose IsEqual for AccessRequests (#64141)
`(AccessRequestV3) IsEqual` was added with a partially goderived
implementation to remove go-cmp comparisons outside test files.
This was not as straightforward as other resources due to
goderive not being able to handle interfaces. Due to the
oneof in AccessRequestsV3 goderive would silently fail
with a partially generated equality function for access requests.

The TeleportEqual derive plugin was updated to ignore the details
field. They are manually validated in `(AccessRequestV3) IsEqual`
if all other fields match.

`resourceAccessIDEqual` manually validates the constraints fields and
relies on goderived equality functions for each concrete type.
2026-04-09 21:30:50 +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
rosstimothy 252a0d91af Add codeowners for go.mod files in examples (#65544)
Dependabot reviewers are determined by codeowners. Since there were
no owners defined for the examples modules Dependabot PRs created
for security alerts were going unnoticed because nobody got assigned
to review them.
2026-04-09 15:00:46 +00:00
rosstimothy c4d6c13720 Prevent races in TestRefreshRemoteCluster (#65566)
Replaces global variable with struct fields on the auth.Server which
can be injected. The newTestAuthServer helper used by trusted cluster
tests specifies the limits directly so tests no longer have to modify
the globals causing races.

Closes https://github.com/gravitational/teleport/issues/65564.
2026-04-09 13:52:51 +00:00
rosstimothy 5c45ae789e Bump golang.org/x/net from v0.50.0 to v0.52.0 (#65408)
This resolves https://pkg.go.dev/vuln/GO-2026-4559.
2026-04-06 20:25:17 +00:00
rosstimothy 1859826506 Cover all binaries in the bloat check (#65383)
The check was not updated with fdpass-teleport and teleport-update
when they were introduced.
2026-04-06 18:05:10 +00:00
rosstimothy c4b3c7a8d1 Bump aws-lc-rs from 1.15.0 to 1.16.2 (#65044)
This is required to bump the transitive aws-lc-sys to 0.39.0
to resolve several security issues.
2026-03-26 15:15:24 +00:00
rosstimothy ceda3ad980 Bump github.com/buger/jsonparser to v1.1.2 (#64915)
This resolves GHSA-6g7g-w4f8-9c9x.
2026-03-25 15:16:43 +00:00
rosstimothy 92a7187d16 [fix] Use provided registry in metrics.RegisterCollectors (#64919) 2026-03-24 14:17:20 +00:00
rosstimothy 03e3daea74 [docs] Note hsm-v1 in HSM migration guides (#64723)
Add a note to HSM guides that the signature_algorithm_suite in
the cluster_auth_preference must be set to hsm-v1 before
rotating CAs during the migration. Without doing this users
can get confusing errors about unsupported key algorithms for
Ed25519.
2026-03-18 20:59:06 +00:00
rosstimothy 813a507d95 Stop comparing AccessListMembers with go-cmp (#64542)
Replaces `(AccessListMember) IsEqual` with a local goderived
implementation in local/services. All reconcilers
have been previously updated to specify their own comparison
function to prevent this change from breaking enterprise in
https://github.com/gravitational/teleport.e/pull/8233.

IsEqual was not updated to use the goderived implementation because
different use cases have different ideas about equality. A single
API to support them all is untenable and confusing. As a result the
callers are now responsible for adhering to their own equality
definitions. If in the future another use case arises that requires
full equality IsEqual may be reconsidered.
2026-03-16 18:50:02 +00:00
rosstimothy 433da078e6 Add modules.Modules to Auth config (#64420)
The modules are not yet consumed, and default to modules.GetModules(),
if not provided. Their existence is meant to bridge the transitional
period without breaking enterprise. Once this lands, enterprise will
be updated to both inject the modules to Auth and specify them via either
modules.SetModules or modulestest.SetTestModules. This will ensure
that enterprise does not break when Auth exclusively consumes the
dependency injected modules over the global modules. After the
enterprise update lands a follow up will convert Auth.
2026-03-13 12:44:13 +00:00
rosstimothy eb59c3b204 Stop comparing Users with go-cmp (#64127)
`(UserV2) IsEqual` was added with a goderived implementation to
remove go-cmp comparisons outside test files. This was not as
straightforward as other resources due to a goderive not being able
to handle interfaces. Due to the Device oneof in LocalAuth goderive
would silently fail with a partially generated equality function for
users.

The TeleportEqual derive plugin was updated to ignore the devices
field. They are manually validated in `(UserV2) IsEqual` if all other
user fields match. `mfaDevicesEqual` manually validates device fields
and relies on goderived quality functions for each concrete device type.
2026-03-12 20:45:35 +00:00
rosstimothy aa8f2c9a46 Expose IsEqual for more resource types (#64520)
Before services.CompareResources can be removed all places
currently relying on it must be provided an alternative. Some
resources already implemented an IsEqual method but did not
expose it in the resource interface. Other resources have
had new equality methods created which defer to a goderive
generated function.
2026-03-11 17:54:10 +00:00
rosstimothy 2e358b6d8c Clean up unused symbols (#64445)
* Clean up unused symbols

Update enterprise imports

* Update enterprise imports
2026-03-09 22:07:12 +00:00
rosstimothy ac156bab4d Add a default PR template (#64401)
The template includes an entry for the Changelog and Manual Test Plan
both to serve as a reminder that they should be included and also
so users don't have to go and look up the expected format.
2026-03-09 13:05:57 +00:00
rosstimothy 10e59ea337 Add manual test plan validation workflow (#64010)
The new workflow is runs on any code change and validates
the PR description contains a fully completed manual test plan.
The test plan is expected to be in the following format.

```
## Manual Test Plan

### Test Environment

Deployed changes on this branch to rjones.cloud.gravitational.io.

### Test Cases
- [x] foo
- [x] bar
- [x] baz
```

If a change is a noop, i.e. it only modifies _test.go
files, then a `no-test-plan` label can be applied to
the PR and the bot will be disarmed.
2026-03-09 13:03:09 +00:00
rosstimothy efe8eb82b4 Bump the bot to workflows/v0.0.3 (#64012)
Diff of v0.0.2 and v0.0.3 is [here](https://github.com/gravitational/shared-workflows/compare/workflows/v0.0.2..workflows/v0.0.3).

This is a preemptive change to get all existing workflows on
the latest version of the bot. Future changes to existing
workflows or new workflows will be making use of v0.0.3.
2026-03-06 20:21:34 +00:00
rosstimothy 8a7f07e648 Bump e (#64341) 2026-03-05 23:30:09 +00:00
rosstimothy 2a8d82e42b Replace github.com/fatih/color with github.com/charmbracelet/lipgloss (#64218)
Part of an effort to consolidate overlapping dependencies. Since tctl
already makes heavy use of charm for TUIs (i.e. tctl top) lipgloss
was chosen over color.
2026-03-05 20:31:23 +00:00