Skip to content

infra: document instructions for yubikeys and piv - #1086

Open
ubiratansoares wants to merge 6 commits into
masterfrom
u/hw-keys-piv
Open

infra: document instructions for yubikeys and piv#1086
ubiratansoares wants to merge 6 commits into
masterfrom
u/hw-keys-piv

Conversation

@ubiratansoares

@ubiratansoares ubiratansoares commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Towards rust-lang/team#2501

AI usage disclaimer : the original text was fully written by me. I used an LLM to proofread it and I adopted grammar corrections and minor stylistic suggestions I got from the tool.

r? @marcoieni

Rendered

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 28, 2026

@marcoieni marcoieni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some initial comments.

Ai disclosure

I found most of the typos with AI.

View changes since this review

Comment thread src/infra/docs/hardware-security-keys.md
Comment thread src/infra/docs/hardware-security-keys.md Outdated
Comment thread src/infra/docs/hardware-security-keys.md Outdated
Comment thread src/infra/docs/hardware-security-keys.md Outdated
Comment thread src/infra/docs/hardware-security-keys.md Outdated
Comment thread src/infra/docs/hardware-security-keys.md Outdated
Comment thread src/infra/docs/hardware-security-keys.md Outdated
Comment thread src/infra/docs/hardware-security-keys.md Outdated
Comment thread src/infra/docs/hardware-security-keys.md Outdated
Comment thread src/infra/docs/hardware-security-keys.md Outdated

@marcoieni marcoieni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

some simplifications found mainly with AI, so that it is easier to read this document.

View changes since this review

These public keys are also required to generate self-signed `X.509`
certificates and to have them physically stored in the same PIV slots.
For example, to generate and store such a certificate for the `9a` PIV slot
already storing a key:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what do you mean with "already storing a key"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It seems one can store a X.509 certificate only within a PIV slot already storing a private key

ykman piv certificates generate --help
Usage: ykman piv certificates generate [OPTIONS] SLOT PUBLIC-KEY

  Generate a self-signed X.509 certificate.

  A self-signed certificate is generated and written to one of the slots on the YubiKey. A private key must already be present in the corresponding key slot.

# more stuff...

Happy to add a note clarifying that

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ok, maybe if you can try to reword to add a bit of clarity, because from a first "casual"/"distracted" read I didn't get that
"already storing a key" was referring to the "slot". 🤔

Comment on lines +162 to +164
To leverage PIV capabilities, **it's mandatory to change** the PIN and PUK
default values. You can do that using either `ykman` or the Yubico
Authenticator app.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
To leverage PIV capabilities, **it's mandatory to change** the PIN and PUK
default values. You can do that using either `ykman` or the Yubico
Authenticator app.
Before using PIV, **you must change** the default PIN and PUK. Use `ykman` or
the Yubico Authenticator app. With `ykman`, run:

Comment on lines +171 to +173
Although it is possible to create and manage PIV keys using the Yubico
Authenticator, you must use `ykman` to have access to security options
not available through the desktop application.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
Although it is possible to create and manage PIV keys using the Yubico
Authenticator, you must use `ykman` to have access to security options
not available through the desktop application.
Yubico Authenticator can create and manage PIV keys, but some security
options are available only in `ykman`.


#### Generating PIV-backed keys

When creating PIV-backed keys with your YubiKey, you must note the following

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
When creating PIV-backed keys with your YubiKey, you must note the following
When creating PIV-backed keys, follow these

Comment on lines +180 to +182
* `ECCP256` should be favored as the encryption algorithm
* PIN confirmation must be required at least `once` when accessing a PIV slot
* human interaction against the YubiKey (touching it) is always required

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
* `ECCP256` should be favored as the encryption algorithm
* PIN confirmation must be required at least `once` when accessing a PIV slot
* human interaction against the YubiKey (touching it) is always required
* Prefer the `ECCP256` encryption algorithm.
* Require PIN confirmation at least `once` when accessing a PIV slot.
* Require human interaction against the YubiKey (touching it).

Comment on lines +219 to +220
* `subject` should be a [RFC-4514 string]
* `valid-days` directly impacts certificate rotation (default is 365 days)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
* `subject` should be a [RFC-4514 string]
* `valid-days` directly impacts certificate rotation (default is 365 days)
* `subject` should be an [RFC-4514 string]
* `valid-days` sets the certificate lifetime (default is 365 days)

Comment on lines +240 to +249
We expect these files to be shared for further verification through
the [Project members DB]. To bring these files to `team`, you must:

* create a new folder under `team/hardware-keys`
* add to it any `attestation-9*.pem` files related to the PIV slots you set up
* add to it the `f9-intermediate.pem` attestation file for your YubiKey
* link these files with your member information under `team/people/<your-user>.toml`

Preferably, name each folder you create at `team/hardware-keys` after your YubiKey
serial number. Check the [TOML schema] for additional details.

@marcoieni marcoieni Jul 30, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
We expect these files to be shared for further verification through
the [Project members DB]. To bring these files to `team`, you must:
* create a new folder under `team/hardware-keys`
* add to it any `attestation-9*.pem` files related to the PIV slots you set up
* add to it the `f9-intermediate.pem` attestation file for your YubiKey
* link these files with your member information under `team/people/<your-user>.toml`
Preferably, name each folder you create at `team/hardware-keys` after your YubiKey
serial number. Check the [TOML schema] for additional details.
Add these files to the [Project members DB]:
* Create a directory under [`team/hardware-keys`](https://github.com/rust-lang/team/tree/main/hardware-keys) named after your YubiKey's serial number.
* Add the `attestation-9*.pem` files for the PIV slots you configured.
* Add the YubiKey's `f9-intermediate.pem` attestation file.
* Link to these files from `team/people/<your-user>.toml`.
See the [TOML schema] for details.

[AWS SSO user sessions]: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html
[AWS Identity Center configuration]: https://forge.rust-lang.org/infra/docs/aws-access.html
[MFA method of choice in your AWS user account]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa.html
[Project members DB]: https://github.com/rust-lang/team

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

in the title you refer to this as "team db". Here as "project members DB". For simplicity we should pick one of those.
I prefer "team db" because it's how the repository is called.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll change that!

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

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants