Commit Graph
2242 Commits
Author SHA1 Message Date
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
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
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
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 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
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
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
Lisa Kim 78c555306c Add github repo access integration events (#52893) 2025-03-19 23:22:18 +00:00
Hugo Shaka 81494f1051 Add autoupdate trigger/mark-done/rollback commands (#52933) 2025-03-19 18:17:20 +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 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
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
Dan Upton 667fe13406 Workload ID: Systemd Workload Attestation (#52699)
* Add Systemd workload attestor

* More realistic timeout for interacting with the dbus API

* Add missing godoc comments

* Move require into same block

* Add missing godoc comments

* Rename `dialer` for clarity

* Log so the user knows something is happening

* Fix missing logger and lint warning
2025-03-07 14:36:06 +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
Dan Upton c3b593fd2b Workload ID: Docker Workload Attestation (#52292)
* Add attrs for Docker attestor

* Add Docker cgroup parser

* Add Docker workload attestor

* Set the default docker address
2025-03-06 16:39:13 +00:00
Alan Parra c2335808cf chore: Bump golang.org/x/net to v0.37.0 (#52845) 2025-03-06 14:37:27 +00:00
dependabot[bot] c95cff0277 Bump the go group in /api with 2 updates (#52651)
Bumps the go group in /api with 2 updates: [github.com/google/go-cmp](https://github.com/google/go-cmp) and [golang.org/x/net](https://github.com/golang/net).


Updates `github.com/google/go-cmp` from 0.6.0 to 0.7.0
- [Release notes](https://github.com/google/go-cmp/releases)
- [Commits](https://github.com/google/go-cmp/compare/v0.6.0...v0.7.0)

Updates `golang.org/x/net` from 0.34.0 to 0.35.0
- [Commits](https://github.com/golang/net/compare/v0.34.0...v0.35.0)

---
updated-dependencies:
- dependency-name: github.com/google/go-cmp
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-06 13:55:53 +00:00
Marco Dinis 39696a66b5 Truncate DiscoveryConfig.Status ErrorMessage (#52347)
Some fetchers might generate a lot of errors which are aggregated and
sent to the `DiscoveryConfig.Status.ErrorMessage`.

This might cause gRPC clients to fail when listing DiscoveryConfigs with
a `grpc: received message larger than max (xyz vs. 4194304)` error.

Allowing 100KB for the error message should give the user enough context
on what's causing the errors.
2025-03-06 11:56:56 +00:00
Zac Bergquist b0049ecc2a Remove the custom current user lookup function (#52144)
We added this function to mitigate slow user.Current() calls in
Windows Active Directory environments. Go 1.24 ships with an optimized
verison of user.Current, rendering this utility unnecessary.

Closes #41922
2025-03-04 23:43:54 +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
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
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
STeve (Xin) Huang 764f55503b Disable legacy alpn connection upgrade fallback (#52534) 2025-02-28 14:11:33 +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
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
Sakshyam Shah d29496fa2b record access list review and membership role grant events (#52183)
* record access_list review event

* record access list member role grant event

* directly use AccessListReviewCreateEvent event

* update commentry

* update commentry"
gi"

* remove unused AccessListReviewEvent proto def

* fix usagereporter_test

* update test event ingester

* update role grant event commentry
2025-02-26 00:46:45 +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
STeve (Xin) Huang a344745017 GitHub proxy: git to prompt for password when tsh session expires (#51305)
* GitHub proxy: git to prompt for password when tsh session expires

* replace reference

* set ctx
2025-02-25 16:14:15 +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
Alan Parra 97fa0704c3 chore: Bump /x/crypto and /x/oauth2 (#52436)
* chore: Bump /x/crypto and /x/oauth2

* Remove toolchain directives
2025-02-24 20:24:50 +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
STeve (Xin) Huang eab298042b GitHub proxy: cleanup git servers when deleting the integration (#52333)
* GitHub proxy: cleanup git servers when deleting the integration

* use DeleteIntegrationRequest
2025-02-21 15:04:01 +00:00
Dan Upton 03cb742ed5 Workload ID: Podman Workload Attestation (#52192)
* Extract container ID resolution so it can be reused for Podman and Docker

* Support Podman mountfile parsing

* Add client for Podman's REST API

* Podman workload attestor

* Fix lint failures

* Don't recommend putting the Podman socket file in `/tmp`

* Replace `container.Engine` interface with parser function

* Wrap Podman HTTP client with otel for traces

* Set default timeout on Podman API client

* Improve wrapped error messages

* Add explicit JSON tags

* Fix copy-pasted error message

* Move regexes to top of file for discoverability
2025-02-21 12:25:54 +00:00
Marco Dinis 4fc9727324 WebAPI: Add state as filter for UserTasks listing endpoint (#52191)
* WebAPI: Add state as filter for UserTasks listing endpoint

* fix pagination bug

* Add filters param to ListUserTasks
2025-02-20 09:24:06 +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
Noah Stride dac3faaac0 tctl support for Workload Identity revocations (#52122)
* Add support to basic tctl resource commands

* First pass at adding CRUD commands

* Add tests

* Remove unused field
2025-02-19 13:28:07 +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