Skip to content

Refactor PIV metadata certificate logic#32250

Merged
Joerger merged 7 commits intomasterfrom
joerger/improve-piv-cert-logic
Sep 26, 2023
Merged

Refactor PIV metadata certificate logic#32250
Joerger merged 7 commits intomasterfrom
joerger/improve-piv-cert-logic

Conversation

@Joerger
Copy link
Copy Markdown
Contributor

@Joerger Joerger commented Sep 20, 2023

Changes:

  • Sign metadata cert with an ephemeral rsa key instead of the PIV key. This way, touch/pin won't be prompted just to sign and set the metadata certificate.
    • Remove the delayed touch prompt from key generation as it was only needed to sign the metadata cert.
  • Instead of returning an error for an unknown certificate in a PIV slot, prompt the user to overwrite the slot.

Once #32264 is merged, users will also be prompted to overwrite a slot when the slot's key does not pass the required touch/pin policies.

#32334 will fix the lint (goimports) error

Comment thread api/utils/keys/yubikey.go
Comment thread api/utils/keys/yubikey.go Outdated
Comment thread api/utils/keys/yubikey.go
Comment thread api/utils/keys/yubikey.go Outdated
Comment thread api/utils/keys/yubikey.go Outdated
Comment thread api/utils/keys/yubikey.go Outdated
Comment thread api/utils/keys/yubikey.go Outdated
Comment thread api/utils/keys/yubikey.go Outdated
Comment thread api/utils/keys/yubikey_test.go Outdated
Comment thread api/utils/keys/yubikey_test.go Outdated
@Joerger Joerger temporarily deployed to vercel September 21, 2023 17:52 — with GitHub Actions Inactive
Comment thread api/utils/keys/yubikey.go Outdated
Comment thread api/utils/keys/yubikey.go Outdated
@github-actions
Copy link
Copy Markdown
Contributor

🤖 Vercel preview here: https://docs-gb5x28nq9-goteleport.vercel.app/docs/ver/14.x

@Joerger Joerger temporarily deployed to vercel September 21, 2023 18:15 — with GitHub Actions Inactive
@github-actions
Copy link
Copy Markdown
Contributor

🤖 Vercel preview here: https://docs-64i2rhz8m-goteleport.vercel.app/docs/ver/14.x

@Joerger Joerger temporarily deployed to vercel September 21, 2023 18:44 — with GitHub Actions Inactive
Comment thread api/utils/keys/yubikey.go Outdated
Comment thread api/utils/keys/yubikey.go Outdated
@github-actions
Copy link
Copy Markdown
Contributor

🤖 Vercel preview here: https://docs-ayi8m8lsc-goteleport.vercel.app/docs/ver/14.x

Comment thread api/utils/keys/yubikey.go Outdated
Comment thread api/utils/keys/yubikey.go Outdated
@Joerger Joerger force-pushed the joerger/improve-piv-cert-logic branch from 581eade to 879182d Compare September 26, 2023 17:43
@Joerger Joerger temporarily deployed to vercel September 26, 2023 17:43 — with GitHub Actions Inactive
@Joerger Joerger enabled auto-merge September 26, 2023 18:02
Copy link
Copy Markdown
Collaborator

@r0mant r0mant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bot.

@Joerger Joerger added this pull request to the merge queue Sep 26, 2023
@github-actions
Copy link
Copy Markdown
Contributor

🤖 Vercel preview here: https://docs-l9xosmgc8-goteleport.vercel.app/docs/ver/14.x

Merged via the queue into master with commit 64d9466 Sep 26, 2023
@Joerger Joerger deleted the joerger/improve-piv-cert-logic branch September 26, 2023 18:23
Joerger added a commit that referenced this pull request Oct 12, 2023
* Change PIV metadata cert to be self signed by an ephemeral key so it can be signed without touch/pin.

* Refactor touch prompt logic.

* Prompt user before overwriting non-teleport certificates instead of just returning an error.

* Update RFD and Docs.

* Address CR.

* Export some methods and variables for use in tests.

* Address comments.
@Joerger Joerger mentioned this pull request Oct 12, 2023
github-merge-queue Bot pushed a commit that referenced this pull request Oct 12, 2023
* Refactor PIV metadata certificate logic (#32250)

* Change PIV metadata cert to be self signed by an ephemeral key so it can be signed without touch/pin.

* Refactor touch prompt logic.

* Prompt user before overwriting non-teleport certificates instead of just returning an error.

* Update RFD and Docs.

* Address CR.

* Export some methods and variables for use in tests.

* Address comments.

* Make Hardware Key unit test interactive (#32235)

* Make yubikey unit test interactive and add to test plan.

* Move yubikey hardware signer method tests to interactive yubikey test.

* Remove hardware key interactive unit test from testplan

* Client check for YubiKey private key touch/pin policies (#32264)

* Preemptively check yubikey private key touch/pin policies on the client side.

* Replace hardware key signer functions with private key methods.

* Refactor overwrite/generate key logic.

* Have hardware_key_touch count towards MFA verification instead of replacing the normal MFA verification flow. (#31663)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rfd Request for Discussion size/sm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants