Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[delegations] Create a verification script that verifies proof of posession of a key ID #602

Closed
asraa opened this issue Jan 25, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@asraa
Copy link
Contributor

asraa commented Jan 25, 2023

Description

In order to verify opened PRs by delegations, a verification script needs to perform the signature verification over the key ID and the nonce. The nonce can likely be the PR number.

This script will need to be consumed in a GH workflow that the review-bot can automatically verify, as well as distributed on the CLI so users can independently verify PRs.

@asraa asraa added the enhancement New feature or request label Jan 25, 2023
@asraa asraa added this to the npm milestone Jan 25, 2023
@kommendorkapten kommendorkapten self-assigned this Jan 31, 2023
@kommendorkapten
Copy link
Member

As #611 some of the work is done.
With the current tooling, we can achieve this:

$ tuf key-pop-sign -key tests/test_data/cosign.key -challenge registry.npm.js -nonce 0416b77a0ac2328021f6e04b98c7fcee55d78ad3
MEUCIBKyQhNs1o+2D6emnzpD1z1FpNmV4tbx35VIeg9KeYXoAiEA2bjZUQM9lO279bLYBGpNbtgwcePOjZIQnAuMYkhxmUk=
$ tuf key-pop-verify -challenge registry.npm.js -nonce 0416b77a0ac2328021f6e04b98c7fcee55d78ad3 -key tests/test_data/cosign.pub -sig MEUCIBKyQhNs1o+2D6emnzpD1z1FpNmV4tbx35VIeg9KeYXoAiEA2bjZUQM9lO279bLYBGpNbtgwcePOjZIQnAuMYkhxmUk=
Signature verified ok

For the missing work, I would assume a workflow that could:

  1. Extract the fork point the PR (i.e the commit SHA used as nonce: git merge-base --fork-point origin/main <topic branch>
  2. Extract the key from the updated targets.json
  3. Run the tuf key-pop-verify and fail the job if signature does not match

Does that match your expectations @asraa

@asraa
Copy link
Contributor Author

asraa commented Feb 13, 2023

Yes!

If there is a deterministic title (like "feat: add-delegation for $REGISTRY") or branch name then a review cron workflow can be scheduled like this one: https://github.com/sigstore/root-signing/blob/main/.github/workflows/review-snapshot-timestamp.yml

For the verification, can we output the verified key ID to stderr?

@asraa
Copy link
Contributor Author

asraa commented Mar 9, 2023

@kommendorkapten can we close this? I believe this is done, with the local script tracked in #708

@asraa asraa closed this as completed Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants