Skip to content

MWI: Add new JWT CA for signing bound keypair documents#54822

Merged
timothyb89 merged 3 commits intomasterfrom
timothyb89/bound-keypair-ca
May 15, 2025
Merged

MWI: Add new JWT CA for signing bound keypair documents#54822
timothyb89 merged 3 commits intomasterfrom
timothyb89/bound-keypair-ca

Conversation

@timothyb89
Copy link
Copy Markdown
Contributor

This adds a new JWT CA for issuing JWT documents related to bound keypair joining, particularly client state document that clients are expected to present back to auth when rejoining.

This adds a new JWT CA for signing JWT documents related to bound
keypair joining, particularly client state document that clients are
expected to present back to auth when rejoining.
@timothyb89 timothyb89 added machine-id no-changelog Indicates that a PR does not require a changelog entry labels May 15, 2025
@github-actions github-actions bot requested review from boxofrad and greedy52 May 15, 2025 01:59
@github-actions github-actions bot added size/sm tctl tctl - Teleport admin tool labels May 15, 2025
Comment thread lib/cryptosuites/suites.go Outdated
Comment thread tool/tctl/common/auth_command.go Outdated
Removes `bound_keypair` from the list of exportable CAs in tctl, and
switches the `legacy` suite algorithm to ECDSAP256 due to hsm
compatibility requirements.
@timothyb89 timothyb89 added this pull request to the merge queue May 15, 2025
Merged via the queue into master with commit cc9712c May 15, 2025
41 checks passed
@timothyb89 timothyb89 deleted the timothyb89/bound-keypair-ca branch May 15, 2025 19:30
timothyb89 added a commit that referenced this pull request Aug 16, 2025
* MWI: Add new JWT CA for signing bound keypair documents

This adds a new JWT CA for signing JWT documents related to bound
keypair joining, particularly client state document that clients are
expected to present back to auth when rejoining.

* Fix issues from code review

Removes `bound_keypair` from the list of exportable CAs in tctl, and
switches the `legacy` suite algorithm to ECDSAP256 due to hsm
compatibility requirements.

* Add note about FIPS/HSM compatibility for CA suites
timothyb89 added a commit that referenced this pull request Aug 16, 2025
* MWI: Add new JWT CA for signing bound keypair documents

This adds a new JWT CA for signing JWT documents related to bound
keypair joining, particularly client state document that clients are
expected to present back to auth when rejoining.

* Fix issues from code review

Removes `bound_keypair` from the list of exportable CAs in tctl, and
switches the `legacy` suite algorithm to ECDSAP256 due to hsm
compatibility requirements.

* Add note about FIPS/HSM compatibility for CA suites
github-merge-queue bot pushed a commit that referenced this pull request Aug 28, 2025
* MWI: Bound Keypair Joining - Minimal Client Implementation (#54372)

* MWI: Bound Keypair Joining - Minimal Client Implementation

This contains a minimal client-side implementation of bound keypair
joining for `tbot`. This first iteration supports only preregistered
keys, and so adds a new `tbot keypair create` subcommand that
generates a keypair and prints a public key that can be copied into
a token.

In an effort to still take advantange of tbot's secure filesystem
abstraction and to not permanently tie the new join method to it,
this includes a minimal filesystem wrapper to adapt tbot's
destinations to a generic file read/write interface.

* Rebase join client to handle interactive rotation messages

This updates the client implementation to handle the revised challenge
handler signature. Rotation still isn't implemented (see TODOs), but
the message handler now explicitly accounts for rotation-type requests
from the server.

* Fix breakage after upstream changes, idempotent key generation

The `keypair generate` command is now idempotent and will not generate
a new keypair if one already exists in the specified destination.

Also, added a `--format=json` flag to print the key as
machine-readable JSON.

* Remove unnecessary whitespace

* Small TODO and doc comment updates

* Fix lints

* Mark `keypair create` as a hidden command for now

This hides it from `tbot help` so we can opt to tweak the CLI contract
before fully releasing the feature. It will be unhidden in the near
future.

* Fix typo

* MWI: Add new JWT CA for signing bound keypair documents (#54822)

* MWI: Add new JWT CA for signing bound keypair documents

This adds a new JWT CA for signing JWT documents related to bound
keypair joining, particularly client state document that clients are
expected to present back to auth when rejoining.

* Fix issues from code review

Removes `bound_keypair` from the list of exportable CAs in tctl, and
switches the `legacy` suite algorithm to ECDSAP256 due to hsm
compatibility requirements.

* Add note about FIPS/HSM compatibility for CA suites

* MWI: Issue and verify join state documents (#54940)

* MWI: Issue and verify join state documents

This adds join state document issuance and verification to the bound
keypair joining process. This is described in more detail in the
[RFD], but in short, this adds a mechanism similar to the generation
counter to verify bound keypair recovery events.

Each time a recovery is performed, the join counter (stored in the
token's status field) is incremented. This value is embedded in a JWT
and signed by Auth, and the result is passed to the client alongside
their cert bundle. This document effectively gives clients permission
to lock themselves out in the future: if another client attempts to
use their credentials, the original client will eventually present an
outdated join state document, and trigger a lockout.

[RFD]: https://github.com/gravitational/teleport/blob/rfd/0205-improved-onprem-joining/rfd/0205-improved-onprem-joining.md

* Allow selecting all recovery modes

* Remove TODO and debug log

* Add tests for join state issuance and verification

* Add join state tests for RegisterUsingBoundKeypairMethod

Adds some minor error message and comment fixes caught while writing
tests.

* Fix imports

* Fix lints

* Fix failing unit test

* Add notes about lack of expiry field in join state JWTs

* Fix missing CAs in tests

* Fix broken test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

machine-id no-changelog Indicates that a PR does not require a changelog entry size/sm tctl tctl - Teleport admin tool

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants