Skip to content

add support for hw keys certs and attestations - #2622

Open
ubiratansoares wants to merge 11 commits into
mainfrom
u/yubikeys-schema
Open

add support for hw keys certs and attestations#2622
ubiratansoares wants to merge 11 commits into
mainfrom
u/yubikeys-schema

Conversation

@ubiratansoares

@ubiratansoares ubiratansoares commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Towards #2501. Context here.

This PR introduces a new hardware-keys folder and assumes a convention that each subfolder corresponds to attestation files and (f9) certificates derived from a single Yubikey.

There is a minimal TOML schema addition + validation to link a team member with these folders and files. We don't expose any information from these files through team API for now.

Documentation on how to generate these files to rollow on Forge.

In general we can expect

  • 1 intermediate certificate file + 2 attestations file per key
  • a few members involved with TUF, signing, etc with 2+ hardware keys to brign info in

That means a few dozens of files a few Kbs each stored at this repo, which sounds doable.

I added two for myself related to PIV 9a (auth) as an example of these files.

@ubiratansoares
ubiratansoares force-pushed the u/yubikeys-schema branch 2 times, most recently from 5a3166c to 4a5d445 Compare July 23, 2026 13:53
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Dry-run check results

[WARN  rust_team::sync] sync-team is running in dry mode, no changes will be applied.
[INFO  rust_team::sync] synchronizing crates-io
[INFO  rust_team::sync] synchronizing github

@ubiratansoares
ubiratansoares marked this pull request as ready for review July 24, 2026 07:12

@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.

Thanks! Some initial comments 👍

AI disclosure

I used GPT5.6-Sol with the codex harness to find 6/7 of these findings

Comment thread docs/toml-schema.md Outdated
Comment thread hardware-keys/36011225/attestation-9a.pem
Comment thread src/validate.rs Outdated
Comment thread src/validate.rs
}
Ok(())
});
}

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.

we could also add the following validation: "Enforce that a key is only owned by exactly one person" to avoid duplicates and orphans

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.

Added this new check here

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.

I tried adding hardware-keys = ["36011225"] (your key) to my account and cargo run -- check pass.

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.

Hopefully here this additional check is fixed. I ran a small test using our test fixtures and it should work as expected!

Comment thread src/data.rs
Comment thread src/data.rs
Comment thread src/schema.rs Outdated
@jieyouxu jieyouxu added needs-infra-admin-review This change requires one of the `infra-admins` to review. S-waiting-on-review Status: waiting on review from a team/WG/PG lead, an infra-admin, and/or a team-repo-admin. labels Jul 26, 2026
Comment thread docs/toml-schema.md Outdated
Comment thread src/validate.rs Outdated
Comment thread src/data.rs Outdated
Comment thread src/validate.rs Outdated
Comment on lines +591 to +595
wrapper(data.people(), errors, |person, _| {
let all_declared_keys = data
.people()
.flat_map(|p| p.hardware_keys().iter().map(|k| k.to_string()))
.collect::<BTreeSet<_>>();

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.

this function runs in a loop (wrapper takes person as an argument), so you are collecting all declared keys for every person. You can extract line 591-608 outside of the wrapper function.

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.

Fixed here

Comment thread src/validate.rs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-infra-admin-review This change requires one of the `infra-admins` to review. S-waiting-on-review Status: waiting on review from a team/WG/PG lead, an infra-admin, and/or a team-repo-admin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants