32 Commits
Author SHA1 Message Date
Maxim 34a1ebbeef [Access Requests] Tolerate unknown constraint kinds when decoding ResourceAccessIDs (#68785)
* feat: tolerate unknown resource constraint kinds

Certs carrying constraint kinds unknown to the current build previously
failed the whole identity decode, and stored access requests carrying
them failed reads outright. Unknown content now degrades to a non-nil
Constraints with nil Details. Enforcement denies only the affected
resource, re-encoding preserves the marker, and stored requests stay
readable. Creation and storage writes remain strict, keeping the marker
from overwriting newer constraint content in the backend.

* refac: Address review feedback
2026-07-31 21:08:00 +00:00
Forrest f80d4cf39e prepare scoped roles/assignments for namespacing (#68457) 2026-07-16 17:41:49 +00:00
Noah Stride 25347ffd67 Encode Bot Scope into TLS/SSH identity (#68385)
* Encode Bot Scope into TLS/SSH identity

* fix
2026-07-06 17:27:36 +00:00
Tiago Silva cf35a5f9ba feat(beams): carry beam_id through identity certificates (#67972)
* feat(certs): thread beam_id through identity certificates

Carries the beam identifier from a delegation session's BeamIDLabel into
issued SSH/TLS certificates and back out via the cert extensions/ASN.1 OID,
exposes it on tlsca/sshca Identity and the decision PDP identities, propagates
it through scoped cert reissue (auth_with_roles), and surfaces it on event
UserMetadata for attribution.

* handle missing event cases

* prevent overriding beams_id cert extension with roles cert extensions

* handle code review comment
2026-06-23 13:36:36 +00:00
Erik Tate b72bc9faaf fixing issues with determining primary system role, disabling health (#67680)
check manager for kube service, and porting
GetClusterNetworkingConfig, GetClusterName, InventoryControlStream,
WatchEvents, and GetSessionRecordingConfig RPCs
2026-06-16 17:18:09 +00:00
rosstimothy 4f17314a11 Initial migration to the Opaque API (#67279)
* Convert existing non-gogo codegen to the Hybrid API

Contributes to https://github.com/gravitational/teleport/issues/66776.

All existing protos explicitly set to API_OPEN have been change to
API_HBYRID. The new codegen was performed via make grpc. There are no
other functional changes to the code to start consuming the Hybrid API
those will come later. The intent is to get all Hybrid codegen in and
backported to ease the transition.

* Initial migration to the Opaque API

Contributes to https://github.com/gravitational/teleport/issues/66776.

All of the changes here are mechanical conversions generated from
`open2opaque rewrite -levels=green ./...`. There will be a follow up
to this in teleport.e which does the same. Once all changes have been
merged the process will be repeated with -levels=yellow followed by
-levels=red.


See https://protobuf.dev/reference/go/opaque-migration/ for more
details.
2026-06-05 14:52:58 +00:00
Forrest 87f8a28487 scoped agent pins (#66590) 2026-05-28 15:48:36 +00:00
Maxim 7e124be755 Always populate AllowedResourceIDs on decoded Identity (#66870)
* fix: Always populate AllowedResourceIDs on decoded Identity

- TLS and SSH cert decoders populated AllowedResourceAccessIDs but left
  AllowedResourceIDs nil. Any path decoding an identity and re-encoding
  via Subject() would result in the encoder injecting a sentinel value
  into the legacy field, and storing all resources under the new
  AllowedResourceAccessIDs field only.

  This specifically broke database access in mixed-version clusters:
  Proxy would decode user cert, build a CSR (Subject()), send it to Auth
  for signing (FromSubject() then Subject() again). This dropped
  AllowedResourceIDs, storing all under the new extension, so older
  database agents received the cert with only the sentinel in the legacy
  extension, and unaware of the new extension, denied access.

  Fix by populating AllowedResourceIDs at decode time in both decoders
  via UnwrapResourceAccessIDs, ensuring and unconstrained resources
  persist across decode-re-encode cycles.

* refac: tidy ca_test encode/decode test
2026-05-21 18:13:15 +00:00
Chris Thach 9a77c5b3ce Fix headless login when in-band MFA is required (#66168)
* Fix headless login when in-band MFA is required.

* Set HeadlessAuthenticationID in headless cert and allow bypass of in-band MFA if set.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Update proto to fix test.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

* Delete useless assert.

Signed-off-by: Chris Thach <chris.thach@goteleport.com>

---------

Signed-off-by: Chris Thach <chris.thach@goteleport.com>
2026-05-08 17:25:55 +00:00
MaximandMarek Smoliński 63552f6a1f [Access Requests] Fix sentinel in legacy cert extension replacing actual resource IDs (#66556)
* fix: sentinel in legacy cert extension replacing actual resource IDs

* Add better test coverage - testCertExtensionResourceIDs

* Update Deprication version comment

---------

Co-authored-by: Marek Smoliński <marek@goteleport.com>
2026-05-08 16:53:04 +00:00
Dan Upton 4860cf3c6b Add DelegationSessionService.GenerateCerts RPC (#64897)
* Add `DelegationSessionService` protobuf definition

* Implement `GenerateCerts` RPC

* Prevent restricted delegation sessions from inheriting administrative privileges

Previously, the `resources` list on a delegation session would restrict regular
access to resources that weren't explicitly included, but not administrative
actions.

Now, we explicitly deny all administrative (rule-authorized) actions for
delegation sessions unless you include a wildcard in `resources`.

* Only permit list/read/readnosecrets for allow-listed resource kinds

* Fix reused extension OID

* Add a small amount of tolerance for clock skew

* Make the "expires must be in the future" message clearer

* Fix linter errors

* Access to a windows desktop implies access to the desktop service

* Add `DelegationSessionID` to the decision package's `SSHIdentity` and `TLSIdentity`

* Wrap `ExtractConditionForIdentifier` for delegation sessions too

* Prevent calling `GenerateCerts` inside a delegation session

* No need for indirection with GenerateUserCerts method now

* Fix import ordering

* Stop delegation service from returning CA certificates

Per @strideynet's request, to avoid replicating existing bad patterns around
conflating the user and host CAs.

* Error messages should start with lowercase letters

* Add `RouteToKubernetes` wrapping message

* Replace expires parameter with TTL

* Remove unnesasary error check

* Fix `AgentScope` extension type assertion
2026-04-14 16:47:32 +00:00
Brian Joergerandrosstimothy cb1c27e6ed Fix IP Pinning Bypass w/ direct dial to Node (#65087)
* Enforce IP Pinning for SSH connections if deemed necessary by the Decision Service.

Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>

* Fix missing IP Pinning permit builder; Fix keyboard interactive.

---------

Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
2026-04-10 20:35:26 +00:00
Forrest bfd47bc4f8 rework scoped rbac for single-role eval model (#63219) 2026-03-06 18:46:42 +00:00
Erik Tate e7ecc19c19 adding immutable labels to scoped tokens and host certificates (#62941) 2026-02-06 20:57:03 +00:00
Maxim 7d2d2a891d Access Requests: Add Resource-Scoped Constraints (#60123)
* feat: Extend `AWSRole` struct w/ `RequiresRequest`

- Differentiate between already-granted vs. requestable AWSRoles when
  including requestable resources in `clusterUnifiedResourcesGet`
  req

* feat: Implement Resource Constraints support for Proxy, Auth

* fixup: Fix tests

* test: Add tests for resourceaccessid-related helpers

* fixup: Address code review feedback

* test: Update identity/events tests for new `ResourceAccessID` fields

* fixup: Expand/improve godocs/comments for sentinel ResourceID handling

* fixup: Address code review feedback

* feat: Conv ResourceID->ResourceAccessID at cert decoding

- Convert ResourceIDs present on certs to ResourceAccessIDs at decoding
  time, rather than at each callsite. Update tests/usages of tlsca/sshca
  Identities to reflect this.
2026-01-27 14:51:52 +00:00
Erik Tate 198c0cd651 adding support for scoped joining of SSH nodes using dynamic tokens (#60362) 2025-10-28 22:00:18 +00:00
Nic Klaassen 6a117aaba8 feat: initial new join service backend (#58520)
* feat: initial new join service backend

* lib/join/server -> lib/join

* separate host and bot params

* minor proto edits

* internal packages

* use authtest server

* fix typos

* don't export GRPCConn

* lib/join/legacyservice -> lib/join/legacyjoin

* use 2 loops

* 5x test timeouts

* delete joincerts package

* add typed request helper

* use LogAttrs

* tidy event-handler go.mod
2025-09-18 18:38:07 +00:00
Forrest 51b743be56 scope pinning prep (#58123) 2025-09-05 20:23:51 +00:00
Dan Upton dbb5f478d5 Device Trust: add required-for-humans mode (#56907)
* Device Trust: add `required-human` mode

* Add `device_trust.mode=required-human` to the test plan

* Add `IsBot` methods to TLS and SSH identities

* Fix `required-human` mode on roles

* Rename mode to `required-for-humans` for clarity

* Undo premature changes to device trust guides

* Default `deviceVerificationPassed` false to avoid accidents when adding new modes

* Handle `BotName` and `BotInstanceID` in `lib/auth/authtest`

* Fix stray reference in test

* Fix reference to `config.DestinationMemory`

* Handle empty device trust mode
2025-07-28 12:43:16 +00:00
Guillaume J. Charmes b849116331 Add support for CRDs in access requests. (#54891) 2025-07-07 15:58:31 +00:00
Tim Buckley 1b2785b41d MWI: Add lock targets for join token name and bot instance ID (#56021)
* MWI: Add lock targets for join token name and bot instance ID

This adds two new lock targets meant to help lock specific bot
instances without affecting all bots sharing a single user:
- Bot Instance ID: Targets a bot instance UUID, which has been
  assigned automatically to unique bot instances for some time
- Join token name: Targets the join token through which the bot
  joined

Bot instance ID locks are most useful for traditional token-joined
bots, since tokens are single use and bots have no way to onboard
again without human intervention if their old certs (and old bot
instance) expire.

Join token locks are useful for bots using delegated join methods.
They are particularly useful for bound keypair joining, where there
is a direct 1:1 relationship between a "bot instance" and a token,
even though that bot ID will change each time a recovery takes place.

Note that this does not currently set the join token for nodes even
though that would theoretically be possible. We could consider
supporting node locking in the future if there's demand.

* Set join token cert request field for non-renewable bot identities

* Fix ASN ID and pass through join token name in impersonated certs

* Tweak docstrings and add missing references for lib/decision

* Clarify docstrings

Clarifies various docstrings and makes sure they mention `token`
joined bots cannot be targeted.

* Fix failing tests
2025-06-26 22:58:02 +00:00
Forrest 33b2bb4ee0 refactor lib/srv to adopt pdp-style patterns (#54081) 2025-05-06 16:37:03 +00:00
STeve (Xin) Huang 4696be3655 GitHub proxy: emit rbac failure event and add prometheus counters (#51878)
* GitHub proxy: emit rbac failure event and add prometheus counters

* move device metadata to sshca.identity
2025-02-21 16:15:44 +00:00
Forrest b9232c3013 transition ssh enforcement to sshca.Identity (#51468) 2025-02-04 18:01:53 +00:00
Forrest 5791a9888a Add host fields and protos for ssh identities (#51024)
* add host fields to sshca.Identity

* add ssh identity proto
2025-01-27 18:51:37 +00:00
Forrest a26c2a94e8 add ssh identity object (#50787) 2025-01-09 22:30:37 +00:00
Zac Bergquist ec28ab5441 keygen: removed unused context (#39922)
* keygen: removed unused context

* Remove keygen.Close
2024-03-28 22:53:01 +00:00
fheinecke b178b8b732 Updated Teleport codebase to AGPL3 license (#35259)
Signed-off-by: Fred Heinecke <fred.heinecke@goteleport.com>
2023-12-01 17:48:14 +00:00
Isaiah Becker-Mayer fc33246807 Fixes dissonance between disconnect_expired_cert vs require_session_mfa (#18607) 2022-12-07 17:00:38 +00:00
Joel 99116409d4 Remove needlessly complex key generation scheme (#12113) 2022-04-25 09:26:10 +00:00
Russell Jones b139f72cab Create single instance of keygen per process. Use cache of precomputed
certificates when using recording proxy.
2018-02-15 21:23:30 +00:00
Sasha Klizhentas 0130c6aa41 Mutual TLS Auth server and clients.
This commit introduced mutual TLS authentication
for auth server API server.

Auth server multiplexes HTTP over SSH - existing
protocol and HTTP over TLS - new protocol
on the same listening socket.

Nodes and users authenticate with 2.5.0 Teleport
using TLS mutual TLS except backwards-compatibility
cases.
2017-12-27 11:37:19 -08:00