Commit Graph
722 Commits
Author SHA1 Message Date
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 034b47f915 Add protobufs for db health checks (#53305) 2025-03-25 23:31:36 +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 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
STeve (Xin) Huang 764f55503b Disable legacy alpn connection upgrade fallback (#52534) 2025-02-28 14:11:33 +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
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
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
Noah StrideandGavin Frazar ad96ac15d0 Allow Machine ID to be configured to issue reissuable identities (#51951)
* Proto changes

* Pipe AllowIssue thru from config to GetUserCerts call

* adjust yaml test

* Add tests

* Update lib/tbot/config/service_identity.go

Co-authored-by: Gavin Frazar <gavin.frazar@goteleport.com>

* Add CLI flag for allow-reissue

* Improve outdated comment

---------

Co-authored-by: Gavin Frazar <gavin.frazar@goteleport.com>
2025-02-13 11:59:40 +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
Michael 801bd8fc76 Add env var to disable Role Visualizer (#51880)
This is a temporary escape hatch to disable the role diff visualizer.
2025-02-07 15:21:43 +00:00
Alan Parra 983c29ab89 chore: Bump google.golang.org/protobuf to v1.36.5 (#51916)
* chore: Bump google.golang.org/protobuf to v1.36.5

* Update generated protos
2025-02-06 14:23:06 +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
Alan Parra cd25712705 chore: Bump google.golang.org/protobuf to v1.36.4 (#51460)
* chore: Bump google.golang.org/protobuf to v1.36.4

* Update generated protos
2025-01-24 17:13:08 +00:00
Matt BrockandTiago Silva bc3a767f18 Adding OIDC auth functionality to the Azure integration (#51219)
* Protobuf and configuration for Access Graph Azure Discovery

* Fixing rebase after protobuf gen

* Updating to use existing msgraph client

* PR feedback

* Using variadic options

* Removing memberOf expansion

* Expanding memberships by calling memberOf on each user

* PR feedback

* Rebase go.sum stuff

* Go mod tidy

* Fixing go.mod

* Update lib/msgraph/paginated.go

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

* PR feedback

* Protobuf and configuration for Access Graph Azure Discovery

* Adding Azure sync functionality which can be called by the Azure fetcher

* Protobuf update

* Linting

* PR feedback

* PR feedback

* Updating to use existing msgraph client

* PR feedback

* Using variadic options

* Removing memberOf expansion

* Expanding memberships by calling memberOf on each user

* PR feedback

* Rebase go.sum stuff

* PR feedback

* Protobuf and configuration for Access Graph Azure Discovery

* Protobuf gen fix

* Rebase fixes

* More cleanup

* e ref update

* Invoking token generation and returning the response

* Quick test with a message to make sure RPC is invoked

* Skeleton of new Azure OIDC RPC call

* Fetching the Azure OIDC token during fetcher creation and establishing a credential assertion approach

* PR feedback; restricting token requests to auth, discovery, and proxy roles.

* Lint

* Fixing mocks

* Fix imports

* Fix test

* Rebase fxes

* Adding back OIDC fetching, accidentally removed it during rebase

* e ref

* Lint

* Fix imports

---------

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>
2025-01-23 18:03:16 +00:00
Yassine Bounekhla f143c9c06c add set as default functionality to auth connectors (#50751) 2025-01-20 14:55:16 +00:00
Paul Gottschling 70d70a2d60 Fix outdated docs URLs (#50923)
- Web UI source
- README
- lib
- api

Do not touch docs URLs in test case names or test data where we don't
expect users to navigate to the URLs.
2025-01-16 18:17:35 +00:00
Alan Parra a638366c27 chore: Bump google.golang.org/protobuf to v1.36.3 (#51072)
* chore: Bump google.golang.org/protobuf to v1.36.3

* Update generated protos
2025-01-15 18:40:45 +00:00
Noah Stride 5bd6c59025 Workload Identity: Add workload-identity-x509 service to tbot (#50812)
* Add config for new output

* Add tests

* rename

* rename

* Add simple impl for WorkloadIdentityX509Service

* Add support for label based issuance

* Add support for specifying selectors via cli

* Add `TestBotWorkloadIdentityX509`

* Add note on removing hidden flag

* Add more thorough logging

* Remove unnecessary slice copy

* Update terminology

* Reshuffle and rename

* Fix broken build

* Fix more building

* Rename name/label selector

* Rename selector

* Add godocs

* Nicer error messge
2025-01-15 10:05:34 +00:00
STeve (Xin) Huang f0abbce0fd GitHub proxy part 6: proxing Git using SSH transport (#49980)
* GitHub proxy part 6: proxing Git using SSH transport

* better command parsing and update suite

* refactor

* revert unnecearrty files

* address review comments

* ut fix

* revert localsite_test.go

* change special suffix to teleport-github-org for routing

* fix routing ut

* minor typo edit

* fix ut after sshca change

* add UT to sshutils

* minor review comments

* fix api ut because of special suffix change

* GitServerReadOnlyClient

* downgrade error to warning

* run go mod tidy. not sure why it's needed

* rename mock.go to mock_test.go
2025-01-14 21:48:04 +00:00
rosstimothy ef859498bc Vendor gravitational/trace/trail in api (#51032)
* Vendor gravitational/trace/trail in api

Pulling in the trail package directly in api will allow the trace
module to shed the grpc-go dependency. This needs to land prior
to https://github.com/gravitational/trace/pull/112 being included
in a new version of trace.

There should be no noticable change in the api depdency tree since
it already depends on grpc-go. Some additional items from the
trace/internal package were also vendored within trail as needed.
Additionally, some of the public api of trail that was not being
consumed has been made private.

* fix: appease linters
2025-01-14 21:04:01 +00:00
Alan Parra e5966d8f0a chore: Bump google.golang.org/protobuf to v1.36.2 (#50841)
* chore: Bump google.golang.org/protobuf to v1.36.2

* Tidy modules

* Update generated protos
2025-01-08 13:50:45 +00:00
Alan Parra d070ce0ec3 chore: Bump google.golang.org/protobuf to v1.36.1 (#50540)
* chore: Bump google.golang.org/protobuf to v1.36.1

* Update generated protos
2024-12-23 15:17:42 +00:00
Bernard Kim a221604dc5 Add UpsertTrustedClusterV2 RPC (#49789)
* Add UpsertTrustedClusterV2 rpc

This supersedes UpsertTrustedCluster rpc. V2 performs resource name
validation.

* Replace confusing UpsertValidationTrustedCluster name

* Use UpsertTrustedClusterV2 in tests

* Address feedback

- Remove unnecessary ping
- Update error messages
- Use skipNameValidation consts
- Validate cluster name before establishing trust
- Do not reveal cluster name in error message
- Use BadParameter instead of CompareFailed

* Use webclient.Find

* Fix test/lint

* Allow label updates

* Fix test

* Fix error handling

* Implement CreateTrustedClusterV2 and UpdateTrustedClusterV2

* Address feedback

* Minor fixes

* Move V2 RPCs to the trust service

* Update comment

* Drop V2 suffix

* Require matching revision

* Fix upsert/update revision

* Drop V2 from Create and Update APIs

* Lint: Fix typo
2024-12-21 04:24:29 +00:00
Noah Stride 3796023d01 Add support for WorkloadIdentity resource to the Teleport Terraform Provider (#50382)
* First pass at trying to generate terraform provider

* Wire up types

* Fix generation of docs

* Add godoc comments

* Add tests

* Tflint and add example
2024-12-20 18:37:20 +00:00
rosstimothy c61461b4fd Improve client tools host resolution (#50175)
Host resolution performed because labels, fuzzy search, or predicate
expressions were supplied to commands that establish connections to
a single host has historically been performed client side in tsh.
While that works in most cases, it can prevent correctly
resolving hosts in some situations, i.e. when there are ambiguous
hosts and tsh is unaware that the cluster routing strategy is set
to ROUTE_TO_MOST_RECENT.

To improve the experience, a new ResolveSSHTarget was added to
Auth to allow host resolution to be performed server side. The
resolution works in a similar manner to, and was inspired by
GetSSHTargets. In the event that the new RPC is not implemented,
because the client is newer than Auth, tsh has also been updated
to pull the cluster networking config and address any host
ambiguity if allowed.

As a result tsh scp and tsh proxy ssh should be much more
tolerant to, and still permit access in situations where
ambiguous hosts are present for some amount of time. Prior to
this the only way to connect in these situations was to find
the UUID of the correct target instance and try again after
seeing an ambiguous host error.
2024-12-20 15:57:26 +00:00
Alan Parra 0aaca3fcce Add the decisionv1.Service boilerplate (#49912)
* Add the decisionv1.Service boilerplate

* Wire decisionv1.Service to auth.GRPCServer

* Wire decisionpb.DecisionServiceClient to client.Client

* Add basic service testing
2024-12-17 14:13:16 +00:00
Alan Parra 79e993b52b chore: Bump google.golang.org/protobuf to v1.36.0 (#50288)
* chore: Bump google.golang.org/protobuf to v1.36.0

* Update generated protos
2024-12-16 19:17:25 +00:00
STeve (Xin) Huang 80a58fc82c GitHub proxy part 5: OAuth flow to retrieve GitHub identity (#49849)
* GitHub proxy part 5: OAuth flow to retrieve GitHub identity

* review comments round1

* review comments round 2 and update tsh git list

* make -C integrations/operator crd

* make -C integrations/terraform docs

* fix flaky test
2024-12-10 17:31:32 +00:00
Noah Stride 35e934c1db Add basic tctl commands for WorkloadIdentity resource kind (#49828)
* Add basic tctl commands for WorkloadIdentity resource kind

* Add `tctl workload-identity ls`

* Add `tctl workload-identity ls`

* Fix message strings to be consistent

* Add tests for `tctl workload-identity` functionality
2024-12-10 17:19:05 +00:00
Trent Clarke 10925bbaae Add Identity Center Account Assignments to Unified Resource Cache (#49580)
Adds Identity Center Account Assignments to the Unified resource cache
so they can be requested in access requests.

Unfortunately we can't just include an `identitycenterv1.AccountAssignment`
directly in the resource cache ListResources output because the legacy
protobuf codegen used for the authservice and the new codegen used for
identitycenter/v1 produce incompatible serialization code, so resulting
generated code does not compile.

To get around this issue, this change introduces a parallel (and slightly
simplified) definition of an IdentityCenterAccountAssignment in the authservice
protobuf spec to act as the wire format for this type. The cached
`identitycenterv1.AccountAssignment` resources are copied into a
`proto.IdentityCenterAccountAssignment` on a cache read.

Includes:
 - adding resources to cache
 - adding account assignment paginated resource
 - account assignment role condition matching for RBAC
2024-12-09 12:02:36 +00:00
Noah Stride 7a3fce975a Workload ID: Add Protos for WorkloadIdentity resource, CRUD and events (#49650)
* Add protos for resource and resource svc

* Add field for encoding the created/updated workloadidentity in audit
events

* Remove redundant package qualifier

* Add UpsertWorkloadIdentity

* Appease linter

* Add TrimToMaxSize implementation
2024-12-06 11:42:44 +00:00
Hugo ShakaandStephen Levine a33473dde9 Make the proxy read from autoupdate_agent_rollout (#49380)
* Add autoupdate_agenbt_rollout support

* fix ping proxy tests

* address creack's feedback

* Address sclevine's feedback

Co-authored-by: Stephen Levine <stephen.levine@goteleport.com>

* fix panic in tests

---------

Co-authored-by: Stephen Levine <stephen.levine@goteleport.com>
2024-12-05 22:21:07 +00:00
STeve (Xin) Huang 8f50cf15e8 GitHub proxy part 4: tsh git ls with unified resource (#49596)
* GitHub proxy part 4: tsh git ls

* fix ut

* update username note

* fix
2024-12-05 17:40:03 +00:00
Trent Clarke e1be633ac0 Exposes Identity Center accounts as Apps in Unified Resource Cache (#49301)
* Exposes Identity Center accounts as Apps in Unified Resource Cache

    For the purposes of the UI, Identity Center accounts and account
    assignments are treated like special Apps. This patch exposes
    Account Assignments to the UI via the Unified Resource Cache.

    Includes:
    - Generating an App resource from an Identity Center Account resource
    - General plumbing from backend through to cache and UI

* lint
2024-12-05 12:23:56 +00:00
STeve (Xin) Huang c4d0dc4f00 GitHub proxy part 2.5: git_server cache (#49564)
* GitHub proxy part 2.5: git_server cache

* revert event

* fix getAll

* review comments
2024-12-05 03:18:50 +00:00
STeve (Xin) Huang 903fee053f GitHub Proxy part 3: gen github user cert and export CA (#49396)
* GitHub Proxy part 3: gen github user cert and export CA

* address pr comment

* minor refactor

* use cache

* fix build and cache
2024-12-03 18:17:21 +00:00
STeve (Xin) Huang b5a6c679fe GitHub Proxy part 3.5: caching PluginStaticCredentials (#49472)
* GitHub Proxy part 3.5: caching PluginStaticCredentials

* fix lint
2024-12-03 15:32:00 +00:00
Alan Parra 3cf8f2ac33 chore: Bump google.golang.org/protobuf to v1.35.2 (#49694)
* chore: Bump api/ Go modules

* Tidy dependent modules

* chore: Bump google.golang.org/protobuf to v1.35.2

* Update generated protos
2024-12-03 15:09:47 +00:00
Rafał Cieślak 0ade3a8f58 Add TargetPort to RouteToApp & use it to route connections to multi-port TCP apps (#49047)
* Add TargetPort to RouteToApp and AppMetadata proto messages

* Pass TargetPort during cert generation

* Refactor Pack.makeTLSConfig to accept struct

This will make it easier to add targetPort to it.

* Add labels to UUIDs used by appaccess test pack app servers

This makes them easier to distinguish when routing doesn't work as expected.

* Refactor Pack.CreateAppSession to accept a struct

* TestTCP: Create app session within test

If we kept the old code, we'd need to manually create a session for each
target port, which would create a lot of duplication.

* Prepare integration test fixtures for multi-port tests

* Add api/utils/net.IsPortInRange

* Use TargetPort when routing TCP connections

* Inline dialMultiPortTCPApp, centralize logic

* Check target port when connecting to single-port app

* Reorder check in IsPortInRange

* Use int instead of uint16

* Extract picking dialTarget to separate function

* addr → uriAddr

* Improve err msg for single-port apps when targetPort != uriPort

* Fix unnecessary conversion to int
2024-12-03 13:55:00 +00:00
Alan Parra 90076ba5e0 Fix TestDynamicIdentityFileCreds for Go 1.23 (#49597) 2024-12-02 14:14:47 +00:00
Vadym Popov af6a6ea734 Add monitoring of the servers time drifting (#44489)
* Add monitoring of the servers time drifting

* Refactor monitor to use inventory stream

* Add command for inventory control stream for time reconciliation

* Reuse ping/pong logic for time reconciliation

* Add integration test to check if global notification is created

* Limits notification length, renaming

* Return system clock instead of time difference
Add parallel requests to ping the nodes
Fix issue with locking inventory store while making ping request

* Refactor to make time reconciliation part of the inventory control stream

* Fix tests

* Rewrite tests
Return inventory store iterator

* Naming adjustments

* Fix test

* Drop timeReconciliation in order to use direct handler functions

* Make time reconciliation with variable duration

* Replace with duration type in proto
Add test cleanup for possible goroutine leak
Add comment about half request duration

* Format notification message

* Add UpstreamInventoryPong.SystemClock check
2024-11-28 21:18:24 +00:00
STeve (Xin) Huang fae535b3df GitHub Proxy part 2: git_server resource, service, and RBAC (#49393)
* git_server resource and role.allow.github_permissions

* implicit RO on KindGitServer

* review comments

* fix ut

* make -C integrations/operator crd

* fix ut again

* make crds-up-to-date and make -C integrations/terraform docs
2024-11-27 16:12:30 +00:00
Hugo Shaka 7d102ca45c introduce webclient.ReusableClient (#49296) 2024-11-27 15:22:22 +00:00
Edoardo Spadolini e4378bef23 Preparation for variable rate heartbeats (#49433)
* Revert "Add unstable envvar to disable server keepalives (#43342)"

This reverts commit 1e2d7724e7.

* Allow changing a VariableDuration by more than one

* Get rid of control log pings

* Dedicated lightweight jittered ticker for the inventory

* Split off per-protocol tickers

* Tests for jittered ticker

* Use a start barrier in TestVariableDurationIncDec

* Explain value to be passed to Advance

* Add explanations in jitteredticker tests

* Rename jitteredticker to delay
2024-11-27 10:43:07 +00:00
Edoardo Spadolini 0f3d691a79 Periodically check connectivity between peer proxies (#48838)
* Add ping RPC to grpc proxy peering

* Periodically check connectivity between peer proxies

* Replace deprecated jitter functions
2024-11-13 17:46:14 +00:00
Brian Joerger 169128dc17 feat: SSO MFA - Moderated Sessions (#48646)
* Add sso client redirect url to maintain session rpc.

* Handle sso client redirect URL in maintain session presence RPC.

* Add client implementation of SSO MFA for moderated sessions.

* Cleanup.
2024-11-12 20:08:50 +00:00
Sakshyam Shah 3757080c6d feat: identity center and provisioning service gRPC client with deleteAllxxx methods (#48714)
* feat: identity center and provisioning service gRPC client with deleteAllxxx methods

* DeleteAllPermissionSets

* run make fix-imports
2024-11-12 16:57:47 +00:00