Commit Graph
2782 Commits
Author SHA1 Message Date
Gavin Frazar 6b16584c58 Add health check config to cache (#53879) 2025-04-09 22:10:41 +00:00
David Boslee 100aaabe85 auth: prevent cnc agent connection count updates on cloud (#53858) 2025-04-09 20:37:42 +00:00
Noah Stride ee6e527eaf WMI: Allow max TTL for X509 and JWT SVIDs to be configured (#53787)
* Add maximum_ttl fields to the WorkloadIdentity resource

* Update issuer service to respect configurable max TTLs

* Add tests for TTL specification

* Add validation logic & tests

* Update terraform provider

* Fix tbot max ttl limitations

* Clarify name of `ignoreMaximumTTL`

* Introduce `defaultTTL` constant

* Fix generation of jwt

* Update operator resources
2025-04-09 17:28:51 +00:00
Michael a41ca41c62 Allow cloud to update access graph settings (#53800) 2025-04-09 13:55:18 +00:00
Pawel Kopiczko 75507d66ec Okta: Align sync settings methods (#53763)
So the same interface can be used for PluginOktaSyncSettings, CreateIntegrationRequest and
UpdateIntegration request for checking scopes.
2025-04-08 10:54:22 +00:00
Gavin Frazar b0564dcc39 Add health check config gRPC service (#53554) 2025-04-08 01:12:18 +00:00
Brian Joerger 58f71101d8 feat: Hardware Key Agent - Add api/utils/keys/hardwarekey package (#53671)
* Move hardware key files into new hardwarekey package.

* Tidy up PIVSlot logic and remove its piv-go dependency.

* Add godoc comments to cliPrompt methods; Update cliprompt.go license year.

* Add godocs.
2025-04-07 19:31:11 +00:00
Andrew Burkeandjoerger b4b79e3928 Enable SSO MFA for headless (#53741)
This change adds support for SSO MFA in headless mode.

Co-authored-by: joerger <bjoerger@goteleport.com>
2025-04-07 19:26:21 +00:00
Stephen Levine de1092c250 set cmc to mon-thu (#53734) 2025-04-07 16:18:27 +00:00
Noah Stride c74a033e20 No longer show "Fatal error" on normal closure of SPIFFEFederationSyncer (#53751) 2025-04-07 13:16:44 +00:00
Zac Bergquist 693d110642 fix: use Go 1.18+ build tag syntax (#53746)
All of our supported release branches are well past Go 1.18, so
we don't need to support the old build tag syntax.

Changes made by running `go fix ./...`.
2025-04-07 12:35:51 +00:00
rosstimothy 3f6fb5517f Remove Resource153Unwrapper interface (#53699)
Converts all remaining uses of Resource153Unwrapper to
Resource153UnwrapperT.
2025-04-04 21:11:22 +00:00
Pawel Kopiczko a4af36c80d Handle Access Requests in Okta read-only mode (#53597)
Changes:

When Okta read-only is enabled (bidirectional sync is disabled):

- don't display Okta-originated resources in "All Resources" view
- don't display Okta-originated resources in "New Request" view
- error if Okta-originated resource access is requested

Note: this is still possible to request a role which allow access to an Okta-originated resource,
but the team made a decision to allow this case.
2025-04-03 13:53:33 +00:00
Pawel Kopiczko 7dc6abb010 Auth: Rework resourceAccess to unifiedResourceLister (#53590)
There are no semantic changes whatsoever.

While I was working on support Okta read-only in Access Requests I needed to understand the way we
handle unified resources listing. While figuring this out I refactored the code so it is now easier
to comprehend to me. Hopefully it's also easier to comprehend to others.

This is a part of my branch with changes for Okta read-only support in Access Requests.
2025-04-01 20:43:56 +00:00
Maxim bbba8debd0 chore: Type changes for Bidirectional Sync for Okta Integration (#52873)
- Add `enableBidirectionalSync` field to Okta Integration spec type
2025-04-01 19:29:33 +00:00
rosstimothy e7069792bc Add a parameterized types.Resource153UnwrapperT (#53567)
Provides a type safe resource 153 unwrapping variant to replace
types.Resource153Unwrapper. Most uses have been switched over to
the new type, though a few still exist and may be harder, if not
possible to convert without a considerable amount of change.
2025-04-01 14:39:44 +00:00
Gavin Frazar 635894b38b Add health check config API client (#53553) 2025-03-31 20:12:45 +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
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
Edoardo Spadolini 70a0d18413 Deflake lib/auth.TestRollback (#53486) 2025-03-27 14:12:24 +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
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
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
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
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
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 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
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
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
Noah Stride df5bbfcce5 Remove deprecated ProcessKubeCSR HTTP RPC (#53111)
* Remove deprecated ProcessKubeCSR HTTP RPC

* Remove unused field
2025-03-18 16:26:21 +00:00
Noah Stride 8f5bd02b96 Workload ID: Include attributes in issuance audit events (#53016)
* Hack on including attrs in svid issuance

* Add attrs to JWT SVID issuance

* Fix comparison in tests

* Improve comment on attributes field of event proto
2025-03-18 09:45:14 +00:00
Noah Stride 3ba99bc4fa Fix flaky test in Revocations service. (#53071)
* Touch test to trigger it in CI/CI

* Add revocations event monitoring ch for tests
2025-03-18 08:22:50 +00:00
Erik Tate 7f3eb19d61 removing TOTP as a valid MFA method when using per-session MFA (#52602) 2025-03-11 17:50:25 +00:00
Forrest ee8fd94082 implement ssh access decision method prototype (#52542)
* implement ssh access decision method prototype

* improve internal ssh extension handling
2025-03-11 10:31:55 +00:00
e793e1eb9b Include AD/non-AD status in certificate (#44549)
* ad/non-ad

* use separate OID for AD status

* Update lib/auth/windows/windows.go

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>

* Update lib/srv/desktop/windows_server.go

Co-authored-by: Edward Dowling <EdwardDowling@users.noreply.github.com>

---------

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
Co-authored-by: Edward Dowling <EdwardDowling@users.noreply.github.com>
2025-03-07 18:44:51 +00:00
rosstimothy 95c51840d6 Expose configuration to set maximum number of PKCS#11 sessions (#52768)
The PKCS#11 that we use defaults to allowing 1024 concurrent
sessions. If an HSM is configured with a lower limit it results in
broken UX since the PKCS#11 library does not reuse open and available
sessions until it has opened the maximum number of sessions that it
can. While the library behavior is out of our control, we now allow
users the ability to specify what their desired max and propagate it
on to the PKCS#11 library so that it will not open more sessions
than the HSM will allow.

The auth config reference was updated to include `ca_key_params`.
While these config options were somewhat discoverable via individual
HSM guides, they were not mentioned in the auth reference.
2025-03-06 18:02:35 +00:00
Yassine Bounekhla bdd25bc326 fix access list reminder notifications for access lists more than 8 days overdue (#52820) 2025-03-06 16:58:34 +00:00
Zac Bergquist cc3122e2fa Remove unnecessary keysIn helper (#52671)
* Remove unnecessary keysIn helper

* Remove slices.Any

It's a carbon copy of the standard library's slices.ContainsFunc.
2025-03-03 14:31:30 +00:00
Bernard Kim bd8933ef51 access_monitoring_rule: Support spec.automatic_approval field (#52274)
* Support automatic_approval in AMR spec

* Support filter by automatic_approval_name

* Update AMR validation

* Update terraform schema

* Fix import

* Add additional test case

* Improve amr spec godocs

* make -C integrations/terraform docs
2025-02-27 19:04:24 +00:00
Dan Upton 74fb5be7cb Workload ID: Support Predicate Language (#52460)
* Add new `expression` package in workload identity service

* Add traits to the `Attrs` proto message

* Add support for user traits to the `expression` package

* Use `expression` package to template Workload Identities

* Add support for expressions to Workload Identity rules

* Update terraform docs

* Error instead of returning zero value for unset fields

* Fix linting failures

* Codify edge cases
2025-02-27 10:52:08 +00:00
rosstimothy 967053bb94 Use b.Loop in benchmark tests (#52520)
Prefer using b.Loop instead of b.N style benchmarks now that we are
using Go 1.24.

See https://pkg.go.dev/testing#B.Loop for more details.
2025-02-26 19:08:05 +00:00
rosstimothy 48d685ebf4 Fix test flakes related to Kubernetes user cert generation (#52442)
#52109 added a dependency on the unified resource cache to user
cert generation to reduce resource consumption. A number of tests
that exercise generating Kubernetes user certs were either not
waiting for the Kubernetes resources to exist prior to authentication
and getting lucky, or checking that the resources were in the auth
cache, but not the unified resource cache.

This attempts to cover any tests which generate Kubernetes user
certificates to verify that the unified resource cache contains
the expected cluster before proceeding.

Fixes #52157.
Fixes #52441.
2025-02-26 18:51:10 +00:00
Hugo ShakaandMarco Dinis 6c0916ff0f Use install.sh in discovery's default installer (#52368)
* Use install.sh in discovery's default installer

* fixup! Use install.sh in discovery's default installer

* Address marco's feedback

* Update lib/auth/grpcserver.go

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

* Update lib/srv/server/installer/defaultinstallers.go

* apply edoard's feedback + write script to file

* Execute the downloaded shell script

* Add snapshot tests

* fixup! Add snapshot tests

---------

Co-authored-by: Marco Dinis <marco.dinis@goteleport.com>
2025-02-26 17:48:09 +00:00
Vadym Popov 6f6f8ad375 Fix total counter for system clock reconciliation (#52494) 2025-02-26 15:44:41 +00:00
Noah StrideandDan Upton 0fb8f91c29 Workload Identity Revocations Signing (#52353)
* Add initial implementation of CRL signing

* Clarify

* Add basic support for streaming signed CRL to `tctl`

* Add log messages

* Start adding CRL support to tbot

* Wire in CRL support to workload-identity-x509

* Wire up crlCache to dependent services

* Fix missing cluster name injectiont

* Run the background goroutine

* FIx notification mechanism

* Add CRL assertions to TestBotWorkloadIdentityX509

* Add appropriate backoff to RevocationService

* Start work on TestRevocationService_CRL

* Change comparison in test

* Finish TestRevocationService_CRL

* Add CRL assertion to TestBotWorkloadIdentityAPI

* Fix linter complaint

* Update lib/tbot/service_workload_identity_api_test.go

Co-authored-by: Dan Upton <daniel.upton@goteleport.com>

* Update lib/tbot/service_workload_identity_api_test.go

Co-authored-by: Dan Upton <daniel.upton@goteleport.com>

* Rename KeyStorer

* Trigger CRL signing every ten minutes

* ADd SVIDCRLPemPath to Describe

---------

Co-authored-by: Dan Upton <daniel.upton@goteleport.com>
2025-02-26 11:03:01 +00:00