Commit Graph
1317 Commits
Author SHA1 Message Date
Sakshyam Shah 5afa67e8cf add Microsoft Entra ID SAML service provider preset (#53676)
* add microsoft-entra-id saml service provider preset

* run make fix-imports

* add t.Helper() in getFirstNameID func
2025-04-08 15:18:24 +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
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
rosstimothy 3f6fb5517f Remove Resource153Unwrapper interface (#53699)
Converts all remaining uses of Resource153Unwrapper to
Resource153UnwrapperT.
2025-04-04 21:11:22 +00:00
Bernard Kim d6a850f4d4 access_monitoring_rule: Restructure the automatic review spec (#53601)
* Update proto

* Restructure AMR

* lint

* Update ts types
2025-04-04 00:18:12 +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
Michael 6e970e7eff Add DemoMode and Status to AccessGraphSettings (#53371) 2025-04-01 15:27:40 +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 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
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
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
Gavin Frazar ba5b13faae Add audit event protobufs for health_check_config (#53315) 2025-03-26 22:52:30 +00:00
Gavin Frazar 8d38eac6ce [docs] Fix role reference request_access docs (#53471)
* Fix request_access godoc

* Update terraform docs

* Update operator CRD docs
2025-03-26 22:43:56 +00:00
Gavin Frazar 034b47f915 Add protobufs for db health checks (#53305) 2025-03-25 23:31:36 +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 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
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
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
Zac Bergquist 60c5a1361e Support context path for Kubernetes app discovery (#52897) 2025-03-17 21:47:48 +00:00
Andrew LeFevreandErik Jankovic 822e941c1f [buddy] Make sure (*Struct).Fields map is not nil before assignment (#53035)
* fix: make sure Fields map is not nil

* move new test to existing file, allocate map for struct up front

* make linter happy

---------

Co-authored-by: Erik Jankovic <erik.jankovic@gmail.com>
2025-03-13 17:30:48 +00:00
Trent ClarkeandZac Bergquist 2a0b76e749 Adds AWS Role ARN to IC Integration settings (#53024)
* Adds AWS Role ARN to IC Integration settings

The Identity Center integration needs to be able to assume an AWS role
when using the ambient system credentials. This patch updates the IC
integration protobuf definition to include the role ARN, by refactoring
the settings block to replace the CredentialSource enumeration with a
`Credentials` type containing a `oneof` union of System and OIDC credential blocks.

The CredentalSource value is preserved for backwards compatibility with previous
Teleport releases.

This patch includes
- the updated protobuf message and generated types
- update tests, etc
- updated `tctl` to handle new plugin settings structure

Chagnges required to actually use this information are coming in a later PR.

* Apply suggestions from code review

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

* Rename role ARN

---------

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
2025-03-13 15:14:12 +00:00
Trent Clarke 1ce0649944 Adds IC plugin status value to trigger IC group import (#52682)
* Adds IC plugin status value to trigger IC group import

The IC plugin automatically imports IC groups into Teleport on its
first run, and uses the plugin status block to mark the import as complete,
and is not required the next time the plugin starts up.

New functionality in `tctl` allows Teleport admins to edit the IC plugin
resource in order to modify group, account and permission set filters.
At the moment, the group filters are only applied during tis initial import,
so changing them has no effect.

In order to allow changes to group import filters to have an effect, this this
patch adds a new value to the `AWSICGroupImportStatusCode` enueration that
indicates that the import process should be re-run the next time the plugin
restarts.

* Break out import status code validation

* Remove import status enum validation
2025-03-07 02:25:44 +00:00
Zac BergquistandJoao Ubaldo a297c17a3f Support setting the public addr for apps discovered in Kube clusters (#52642)
Signed-off-by: Zac Bergquist <zac.bergquist@goteleport.com>
Co-authored-by: Joao Ubaldo <me@joaoubaldo.com>
2025-03-03 15:42:47 +00:00
Marco Dinis cee39b792c Improve perf on label key validation (#52579)
* Improve Valid Label Key check

* use pre-go1.24 testing.B because API module is 1.23

* improve godoc, fix edge case
2025-03-03 11:24:43 +00:00
Steven Martin 3acf2af450 Fix spelling identity center assignment desc (#52674) 2025-03-03 00:41:23 +00:00
Trent ClarkeandMarek Smoliński af764c78f5 Adds edit support for IC plugin to tctl edit (#52243)
* Adds edit support for IC plugin to `tctl edit`

This patch expands the plugin resource unmarshaler in `tctl` to handle the
heterogenous filters used by the Identity Center plugin settings. It also adds
support for the IC status block.

These changes allow a user to edit the plugin resource via `tctl edit` after
installation.

* Why not use protojson? Well...

* Update collection.go

* Add json.(un)MarshalJSON implementations father than structure unpacking

* Dead code removal

* Apply suggestions from code review

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

* Apply review feedback

---------

Co-authored-by: Marek Smoliński <marek@goteleport.com>
2025-02-28 01:15:18 +00:00
Sakshyam Shah 1f69fd5612 emit user_origin for local login event (#52124)
* emit user_origin for local login event

* ignore unspecified origin while allowing overriding with a defined origin value

* abstract origin getter

* test: emit unspecified origin value to test the initial value is preserved
2025-02-25 20:53:29 +00:00
Krzysztof Skrzętnicki 329844741b Add support for RDS-hosted Oracle and update related RDS handling (#52374) 2025-02-25 13:23:37 +00:00
Andrew Burke 217d014a95 Import Oracle Cloud tags (#52283)
This change adds the ability to import tags when running on an
Oracle Cloud compute instance.
2025-02-24 18:51:41 +00:00
Sakshyam Shah e3ff2c04be Identity center resource sync event definition and UI formatter (#52059)
* feat: identity center resource sync event

* Web UI event formatter

* let the emitter send user message to be used in the ui

* review: plural total count names

* review: make distinctive failure event

* review suggestion:
- spell out completed and failed event description
- write resource import counts
- use  code for error

* spell fix
2025-02-19 19:25:27 +00:00
Pawel Kopiczko 0af5a894d2 Add OktaUserSyncSource.IsUnknown (#52160) 2025-02-18 11:30:19 +00:00
STeve (Xin) Huang 8f6c0709d8 git session prehog event (#51794) 2025-02-14 19:11:23 +00:00
Andrew LeFevre eecd072cc0 verify cluster name of TLS peer certificates (#52128) 2025-02-13 21:25:52 +00:00
Noah Stride d1d81ee1e2 Add backend WorkloadIdentityX509Revocations service (#51997)
* Add `lib/services` implementation

* Fix GoDoc comments

* Wire up events support

* Add TestValidateWorkloadIdentityX509Revocation

* Wire up new WorkoadIdentityX509Revocation service

* Add TestWorkloadIdentityX509RevocationMarshaling

* Add tests for WorkloadIdentityX509RevocationService

* Avoid lib/services/local/events.go exploding in size

* Switch to regex based validation

* Fix TestWorkloadIdentityX509RevocationService_List

* Actually fix TestWorkloadIdentityX509RevocationService_List
2025-02-12 11:06:53 +00:00
Noah Stride 5bbb386730 Add protobufs for Workload Identity Revocation (#51996)
* Add protos for workload identity revocations

* Add event marshal/unmarshaling

* Restore lexical order

* Add more detailed comments to messages
2025-02-11 10:58:12 +00:00
Andrew Burke 68cf11be7b Add oci join server auth (#51446)
This change adds the server side of the auth ceremony for the
Oracle join method.
2025-02-07 18:09:44 +00:00
Pawel Kopiczko fef450d761 Add PluginOktaSyncSettings.UserSyncSource (#51642) 2025-02-05 19:28:15 +00:00
Forrest b9232c3013 transition ssh enforcement to sshca.Identity (#51468) 2025-02-04 18:01:53 +00:00
rosstimothy 2cced62805 Fix violations of non-constant format strings linter (#51812)
Depends on https://github.com/gravitational/teleport.e/pull/6006.
Now that we are compliant, the ignore rule was removed from the
golangci-lint config to prevent future regressions.
2025-02-04 16:43:35 +00:00
STeve (Xin) Huang 1fc1c80a1d GitHub proxy: web apis for enrolment (#51423)
* GitHub proxy: web apis for enrolment

* github integration update

* updates

* add ut

* add overwrite test

* fix lint

* add generic field size check

* fix lint

* update log for using existing oauth id
2025-02-03 19:12:08 +00:00
Yassine Bounekhla 5b4dee8bd0 periodically create access list reminder notifications when needed (#51581) 2025-01-31 15:59:23 +00:00
Pawel Kopiczko a24fe3e258 Okta API: Remove unused fields and update docs (#51637)
* Okta API: Remove unused fields and update docs

* Add temporary protobuf liter exception
2025-01-30 20:46:15 +00:00
Andrew Burke a67d70b436 OCI join - add proto and client (#51444)
This change adds protos, the client, and a bunch of boilerplate
for the Oracle join method.
2025-01-29 20:11:16 +00:00
Edoardo Spadolini cc77fcebdf Stable UNIX users: functionality (#51200)
* wiring the API client through

* tctl stable-unix-users ls

* stable UID fallback for Teleport SSHD

* stable_unix_user.create event

* fix-license

* Require and test audit log message

* Add stable_unix_user_config to fileconf

* Avoid saying "fallback UID" in logs

* Avoid saying "fallback UID" in error messages

* Avoid racing writes in the mock emitter

* pnpm lint-fix

* fix lib/auth tests that broken during rebase
2025-01-29 18:15:57 +00:00
Yassine Bounekhla c907235a5e add access list reminder notification type (#51426) 2025-01-29 05:27:28 +00:00
Edoardo Spadolini 8858cee029 Stable UNIX users: storage and auth API (#51102)
* add config field in cluster auth preference

* extend ClusterConfiguration to support checking auth preference in AtomicWrite

* stable UNIX users storage

* auth API and auth-side business logic

* move server implementation to a subpackage

* Use proto3 and the default (open) API

* remove type alias for ClusterConfiguration

* Move new AuthPreference validation into a Validate method

* Check the StableUnixUserConfig before use

* use Config instead of Params

* Don't rely on error types for the retry logic

* Fix TestStableUNIXUsersBasic

* Use free functions for Validate

* make grpc

* black-box testing that includes authz
2025-01-28 17:08:20 +00:00
Zac Bergquist d71293f964 Replace usages of x/exp/maps with stdlib maps package (#51448) 2025-01-28 14:54:40 +00:00
Marek SmolińskiandTrent Clarke 1c0ae9a051 AWS IC: Add groups filter (#51484)
* AWS IC: Add groups filter

* Silence `buf breaking` while renaming field in unreleased protobuf

* Preserve Marek's better name ('include' vs 'filter')

* typo fix

---------

Co-authored-by: Trent Clarke <trent@goteleport.com>
2025-01-28 11:38:49 +00:00
Trent Clarke 8acec8a9b8 Adds account list to IC plugin settings (#51405)
* Adds account filter to IC plugin settings

* Apply review feedback, also expand to allow for group filtering later on

* doco fixups
2025-01-28 01:59:17 +00:00