Commit Graph
8969 Commits
Author SHA1 Message Date
rosstimothy d002d1e43a Require that FnCache keys are comparable (#53565)
Adds an additional type constraint go FnCacheGet and FnCacheGetWithTTL
to enforce that all keys are comparable. This should allow the
removal of various compile time hashability checks that are in
place for existing keys of custom types.
2025-03-29 14:40:32 +00:00
Gabriel Corado 1db489562b Remove unused AWS SDK v1 references (#53537)
* refactor(aws): remove unused sdk v1 references

* refactor(aws): drop unused migration package

* chore: go mod tidy
2025-03-29 02:25:01 +00:00
Gavin Frazar c48fb577bb Add health check config service (#53438)
Adds a backend storage service for health_check_config resources.
2025-03-28 18:56:29 +00:00
Hugo Shaka bfc6bb8c57 fix ec2 installer (#53542) 2025-03-28 17:08:25 +00:00
Erik Tate 59c751e2d0 adding PerSessionMFA to PromptMFARequest proto and disabling the TOTP (#53465)
prompt with a warning message when it's set
2025-03-28 16:22:30 +00:00
Zac Bergquist 213fd7bf53 lib/auth/windows: shrink CRL interface (#53540)
We only call a single method but were requiring an interface with
over a dozen methods.
2025-03-28 15:39:49 +00:00
Edoardo Spadolini 2fca5820ed SPIFFE X.509 issuer override: CRUD (#53088)
* SPIFFE X.509 issuer override: CRUD

* tctl support for workload_identity_x509_issuer_override

* Define audit log events

* Emit audit log events

* Add comments to point at the e implementation

* audit events fixtures

* Use DisallowUnknown in tctl
2025-03-28 13:26:09 +00:00
Dan UptonandTiago Silva ae13b4021e Workload ID: Support custom claims in JWT-SVIDs (#52861)
* Support additional claims in JWT-SVIDs

* Exclude the `extra_claims` field in Terraform

* Add a maximum nesting depth

* Add comment to clarify behavior of `PrivateClaims`

* Combine declaration with nil check

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

---------

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>
2025-03-28 11:23:11 +00:00
STeve (Xin) Huang 5060fdc0c4 Change GitHub SSHA CA sig algo for legacy to be compatible with KMS (#53444)
* Change GitHub CA sig algo

* revert change for balanced-v1
2025-03-28 00:31:11 +00:00
Zac Bergquist 2244cd39f9 Clean up LDAP packages (#53497)
When we originally broke some of the desktop access code out into
a shared windows package to help with MS SQL access we pulled too
much code. This commit just moves code that is only needed in one
package to the package where it is used, and un-exports it.

No functional changes.
2025-03-27 19:42:03 +00:00
Gavin Frazar d16a2ab752 Support health check config audit events (#53437) 2025-03-27 18:34:49 +00:00
Edoardo Spadolini ccffd6b5be Allow unknown fields when unmarshaling protojson resources (#53469)
* Prohibit implicitly strict protojson unmarshaling

* Avoid jsonpb.Unmarshal

* Define marshal option to disallow unknown fields

* Avoid protojson.Unmarshal

* Disallow unknown fields in tctl create

* Disallow unknown fields in the web UI
2025-03-27 14:35:37 +00:00
Edoardo Spadolini 70a0d18413 Deflake lib/auth.TestRollback (#53486) 2025-03-27 14:12:24 +00:00
rosstimothy 4547f444cc Promote Items to backend.Backend interface (#53414)
Now that all backends implement backend.BackendWithItems the
temporary interface is removed and the Items method is included in
backend.Backend. All wrapper implementations, and backend mocks were
updated accordingly.

The backend reporter used to tally prometheus metrics was updated
with new metrics to track streaming requests since reusing the
batch read requests wouldn't make sense for iteration. This means
that once upstream consumers of the backend start switching from
GetRange to Items the batch read metrics will not be the complete
source of truth. The streaming metrics also lack some of the same
observability since chunk sizes and latency of reads cannot be
known at the reporter level. The only way to provide the same
batch metrics that we have today would require each backend
implementation to be responsible for updating the metrics when
performing their internal reads to supply the Items iterator.
2025-03-26 20:36:08 +00:00
Gabriel Corado 6cdb4b9de8 Unmarshal DynamoDB events legacy checkpoint key without AWS SDK V1 (#53264)
* refactor(dynamoevents): manually parse legacy dynamodb attributes

* refactor(dynamoevents): review suggestions

* refactor(dynamoevents): use aws sdk function to convert strings slice
2025-03-26 20:34:26 +00:00
Forrest 704fdfc23f rate limit resource cleanup (#53463) 2025-03-26 19:25:20 +00:00
Zac Bergquist 8b3a416274 Decouple LDAP from cert generation (#53306)
No functional changes, just a better abstraction. LDAP can be used to
fetch metadata that is included in certificate requests, but LDAP is not
required in order to issue certificates.
2025-03-25 22:18:40 +00:00
Forrest b615f23e4d fix hot keepalives (#53298) 2025-03-25 20:25:48 +00:00
Noah Stride 7cbb46d2ed Support configuring StaticJWKS for the GitLab join method (#53386)
* Update protobuf

* Implement and test ValidateTokenWithJWKS

* Update join logic to use new method for static jwks

* Update Terraform Provider

* Update operator docs/files

* Update goldenfile
2025-03-25 18:03:09 +00:00
rosstimothy a5f425a221 Rename backend.IterateParams to backend.ItemsParams (#53402) 2025-03-25 17:32:08 +00:00
rosstimothy 66891d2633 Reduce log spam from pgbk connection test (#53400)
Closes https://github.com/gravitational/teleport/issues/47991
2025-03-25 17:18:30 +00:00
rosstimothy 13c98fe817 Add iteration support to firestore (#52597)
This builds on top of #52199 by updating the firestore backend to
implement backend.BackendWithItems. Only GetRange, and not DeletRange,
was refactored to use Items to retrieve a range.

The iteration logic is slightly more complex here to ensure that
documents in the collection are produced in the correct order no
matter how the key was stored in the collection. Over the years the
key has been stored in three different formats, and no single query
will pull the items from all keys. There was a background migration
task introduced in v17 to convert all keys to a single format. The
iteration logic can be simplified once said migration is removed
and all keys can be assumed to be of a single type.
2025-03-25 16:10:07 +00:00
Noah Stride eb90f7c179 Workload Identity: Roles Anywhere tbot service. (#52426)
* Add config for WorkloadIdenttiyAWSRAService

* Add CLI command

* Start hacking on service impl

* Write credentials in AWS credentials file format

* Fix go.mod/go.sum

* Go mod tidy

* Add ARN validation

* Add specific config for AWS session duration/renewal

* Update golden file

* Fix gomod/gosum

* Refactor CheckAndSetDefaults

* Initialize service

* Update CLI flags

* Refactor & add tests

* Use *Context slog calls

* Update service name to include full `roles-anywhere`

* Add mocked AWS rolesanywhere API based test

* Validate region
2025-03-25 15:06:20 +00:00
Dan Upton 5c257c2604 Workload ID: Add binary_path and binary_hash to Unix workload attestor (#52736)
* Capture the binary path and SHA256 checksum in the Unix workload attestor

* Increase binary size limit to 1GiB

* Make maximum binary size configurable

* Remove error-prone mount namespace check

* Document that `binary_hash` is hex-encoded

* Handle wrapped errors properly
2025-03-25 15:04:48 +00:00
rosstimothy be8fe5c76d Join Kubernetes sessions in the web ui (#52993)
Adds the ability to join existing Kubernetes sessions in the web ui
as peers, observers, or modertators.

Closes #52315.
2025-03-25 14:14:48 +00:00
Forrest c18cab4acd impl new iterator-based stream package (#52622) 2025-03-24 21:39:33 +00:00
Steven Martin 6200145432 Update tar install to include enterprise suffix (#53323) 2025-03-24 11:31:47 +00:00
Marco Dinis 85f92c3154 Improve error message for invalid application names (#53269)
* Improve error message for invalid application names

* fix tests
2025-03-24 09:44:45 +00:00
rosstimothy 6d13e969a5 Reduce resource consumption of ListUnifiedResources (#53213)
The changes here were a result of examining CPU and memory profiles
of BenchmarkListUnifiedResources. The biggest inefficiencies stemmed
from the authorizer and `(types.Server) MatchSearch`.

When the authorizer computes lock targets it will call `(types.LockTarget) Equals`,
which was relying on proto.Equals to determine if nine strings were
equivalent. The fields are now individually checked and a test
was added to ensure that if any new fields are added they must
be added to the check for the test to pass.

ListUnifiedResources attempts to be smart and evaluate whether the
user has read/list access to a particular resource kind once. However,
it was always checking if users had access to _all_ supported resources
instead of just the resources that the user was requesting. While most
of the checks are not very expensive, checking all resources is still
worse than only checking the required resources.

Lastly, the `(types.Server) MatchSearch` implementation is no longer
allocating a slice of search fields and using `types.MatchSearch`.
Instead a variant of the loop from `types.MatchSearch` is inlined.
While this was only applied to `types.Server` it should likely
be extended to other resource types in the future - or `types.MatchSearch`
should be refactored in a way that does not require callers to allocate.

```bash
$ benchstat old.txt new.txt
goos: darwin
goarch: arm64
pkg: github.com/gravitational/teleport/lib/auth
cpu: Apple M2 Pro
                                              │   old.txt   │               new.txt               │
                                              │   sec/op    │   sec/op     vs base                │
ListUnifiedResourcesFilter/labels-12            195.0m ± 6%   173.3m ± 2%  -11.12% (p=0.000 n=10)
ListUnifiedResourcesFilter/predicate_path-12    230.6m ± 3%   210.8m ± 4%   -8.57% (p=0.000 n=10)
ListUnifiedResourcesFilter/predicate_index-12   229.8m ± 5%   209.0m ± 7%   -9.08% (p=0.000 n=10)
ListUnifiedResourcesFilter/search_lower-12      600.6m ± 3%   364.3m ± 1%  -39.35% (p=0.000 n=10)
ListUnifiedResourcesFilter/search_upper-12      687.0m ± 2%   423.4m ± 1%  -38.37% (p=0.000 n=10)
geomean                                         335.7m        259.5m       -22.69%

                                              │    old.txt     │               new.txt                │
                                              │      B/op      │     B/op      vs base                │
ListUnifiedResourcesFilter/labels-12              868.8Ki ± 0%   414.1Ki ± 0%  -52.34% (p=0.000 n=10)
ListUnifiedResourcesFilter/predicate_path-12      7.731Mi ± 0%   7.287Mi ± 0%   -5.74% (p=0.000 n=10)
ListUnifiedResourcesFilter/predicate_index-12     7.731Mi ± 0%   7.288Mi ± 0%   -5.74% (p=0.000 n=10)
ListUnifiedResourcesFilter/search_lower-12      22106.9Ki ± 0%   486.8Ki ± 0%  -97.80% (p=0.000 n=10)
ListUnifiedResourcesFilter/search_upper-12      22107.0Ki ± 0%   486.3Ki ± 0%  -97.80% (p=0.000 n=10)
geomean                                           7.494Mi        1.371Mi       -81.70%

                                              │    old.txt    │               new.txt               │
                                              │   allocs/op   │  allocs/op   vs base                │
ListUnifiedResourcesFilter/labels-12             11.401k ± 0%   4.865k ± 0%  -57.32% (p=0.000 n=10)
ListUnifiedResourcesFilter/predicate_path-12      161.5k ± 0%   155.0k ± 0%   -4.04% (p=0.000 n=10)
ListUnifiedResourcesFilter/predicate_index-12     161.5k ± 0%   155.0k ± 0%   -4.04% (p=0.000 n=10)
ListUnifiedResourcesFilter/search_lower-12      162.212k ± 0%   5.277k ± 0%  -96.75% (p=0.000 n=10)
ListUnifiedResourcesFilter/search_upper-12      162.224k ± 0%   5.275k ± 0%  -96.75% (p=0.000 n=10)
geomean                                           95.22k        20.07k       -78.93%

```
2025-03-21 19:20:55 +00:00
rosstimothy f4b72d2450 Paginate unified resource cache iteration (#52473)
The internal pagination allows the read lock to be held for
shorter intervals, and most crucially, cannot be held open while
consuming the iterator. This eliminate issues that may arise by
executing slow operations during iteration which may starve writes.
2025-03-21 18:55:13 +00:00
Nic Klaassen 2b30fe5c55 fix: fix flaky TestCreateSignedSTSIdentityRequest (#53265)
This commit prevents the test from loading an AWS config file that may
set a region that conflicts with the test cases.
2025-03-21 15:42:57 +00:00
Steven Martin 2c170c65cc Update install instrs on package name removal (#53266) 2025-03-21 14:58:00 +00:00
Bartosz Leper d01bf383bb Update references to renamed features (#53144)
* Update references to renamed features

Renames:
- Teleport Policy to Teleport Identity Security
- Teleport Identity to Teleport Identity Governance

* Capitalize the constants

* satisfy Go lint

* Rename FeatureNames to FeatureName
2025-03-21 14:33:49 +00:00
STeve (Xin) Huang 5ea6361215 make sure db route is converted from tlsca to proto (#53246) 2025-03-21 14:20:37 +00:00
Edoardo Spadolini 4e7685b1a4 Clean up some request handling in the reverse tunnel agent (#53200) 2025-03-20 23:31:14 +00:00
STeve (Xin) Huang 46a528fe11 Avoid Postgres Web Access to dial proxy public address (#52724)
* prototype

* add server name and fix ut

* reduce scope

* fix ut and check client ip

* minor refactor

* remove extra check

* fix GetClusterName after merge

* fix lint
2025-03-20 18:50:27 +00:00
Sakshyam Shah 593ccca057 Web UI: support SAML app launch URLs (#52877)
* feat: MenuLoginWithActionMenu component

* update MenuLogin to accomodate changes for MenuLoginWithActionMenu

* handle samlAppLaunchUrls in makeapp.ts

* update saml app login button

* update app.go to return SAMLAppLaunchURLs

* resource action button:
- added test and story
- handles both action and non-action buttons

* launchExternalUrl props for MenuLogin to open url with <a> tag

* handle memu login onClick to apply onClose callback

* use same comment over be and fe, app_test.go

* add isExternalUrl to LoginItem type instead of MenuLoginProps

* use text-align:left, update story

* proper js comment tag

* extend MenuInputType with NONE value

* update resourceActionButton story

* address review comments

* remove unused waitfor
2025-03-20 18:47:33 +00:00
Noah StrideandMarco Dinis 0586278cde Migrate GetClusterName to gRPC (#53164)
* Adjust GetClusterName method signature to include context.Context

* Start hacking on gRPC GetClusterName impl

* Fix test mocks to match signature

* Fix integration tests

* Fix integrations tests

* Missing ctx

* New GetClusterName RPC implementatin

* Add fallback cluster name

* Correct godoc comment

* Remove unused method

* Remove unused import

* Fix E2E test

* Fix tests

* Fix deferred context cancel in test conflicting with parallel subtests

* Fix import

* Fix imports

* Update lib/auth/auth_with_roles.go

Co-authored-by: Marco Dinis <marco.dinis@goteleport.com>

---------

Co-authored-by: Marco Dinis <marco.dinis@goteleport.com>
2025-03-20 10:07:02 +00:00
Krzysztof Skrzętnicki 7d7e9d3fe3 Support -oSendEnv in tsh (#53010)
* Support `-oSendEnv` in `tsh`

* Fix spelling
2025-03-20 07:52:45 +00:00
Michael 46437e307a Add UseAnyProxyPublicAddr to app spec (#52693)
This adds a new field, UseAnyProxyPublicAddr, that will be used to
tell the web api/ui to rebuild the request app's FQDN based on the proxy
public addr that the request came from (upcoming PR to consume this)
2025-03-20 00:40:06 +00:00
Hugo Shaka c20095e9d6 Align semver libs (#52795)
* Convert autoupdate version handling to coreos/go-semver

* get the right version in installer endpoint + get rid of x/mod/semver

* depguard x/mod/semver

* Add nolint rules for existing x/mod/semver usages

* Add depguard explanation
2025-03-19 18:03:35 +00:00
Hugo Shaka 5e73eaf342 Add autoupdate version and config support to TF provider (#53007)
This commit adds two new singular resources to the Terraform provider:
teleport_version and telpeort-config.
Both got added using the resource 153 pattern (new protoc-X.yaml file)
and it went pretty seamless.

The only specific is that I had to add a provider feature to
automatically set singular resource names as we don't run
CheckAndSetDefaults() locally anymore. This got merged in a separate PR.
2025-03-19 17:55:33 +00:00
Hugo Shaka f6dccd8da0 Add Trigger, Rollback, ForceDone autoupdate RPCs (#52931)
* Add Trigger, Rollback, ForceDone autoupdate RPCs

* Add all_started_groups bool + switch to group set

* fix error type
2025-03-19 17:27:52 +00:00
Stephen Levine ca30c3d84a [teleport-update] Additional log message and UX cleanup (#53180)
* More teleport-update UX cleanup

* cleanup overwrite error

* cleanup

* more cleanup
2025-03-19 17:04:50 +00:00
Stephen Levine fd12d782b0 Use quoting style supported by pre-2015 systemd (#53179) 2025-03-19 15:09:18 +00:00
Noah Stride f0f3e5c2a6 Remove deprecated ReverseTunnel functions (#53084)
* Remove deprecated ReverseTunnel functions

* Add notimplemented handler
2025-03-19 14:42:00 +00:00
Noah Stride cbf3f2b6de Remove unused SetClusterName HTTP RPC (#53146)
* Remove unused SetClusterName HTTP RPC

* Fix tests

* Fix spacing

* Fix suite test
2025-03-19 10:02:08 +00:00
Hugo Shaka f5cfbf66ed Add rollout mutation functions (#52930) 2025-03-19 09:11:39 +00:00
Noah Stride b1837eaf43 Remove unused SearchEvents and SearchSessionEvents HTTP RPCs (#53112)
* Remove unused HTTP events RPCs

* Remove accidentally committed comment
2025-03-19 09:04:36 +00:00
Noah Stride bd4d7a44d4 Remove deprecated HTTP RegisterUsingToken Auth RPC (#53110) 2025-03-18 18:13:29 +00:00