Attestation verification via glab CLI
Why are we doing this work
The purpose of this issue is to add supply chain attestation verification to the glab CLI.
Relevant links
- Polish the MVC end-to-end Attestation workflow
- Previous MR: Resolve "Create Attestations List API"
- PoC: Draft: Add new "attestation verify" command
Non-functional requirements
-
Documentation: -
Feature flag: -
Performance: -
Testing:
Implementation plan
For the initial implementation the CLI should support verification of an artifact against a given project. In the future, we can expand to support other options similar to competitors.
Initial use case:
glab attestation verify FILE --project PROJECT_PATH
For example
glab attestation verify filename.txt --project gilab-org/gitlab
Specifically, we'll need to add a new command, attestation that has a subcommand verify.
- Add an
attestationcommand. This can be done imitating the structure ininternal/commands/mr/mr.go. This needs to be added tointernal/commands/root.goin the same way the MR command is added. - Add a
verifycommand. This can be done by imitatinginternal/commands/mr/reopen/mr_reopen.go. - Download the bundle using Add attestation download API endpoint
- Install
sigstore-go. - Verify the bundle against the signature you downloaded, with the appropriate
certificate-identityandcertificate-oidc-issuer. More information on how to do this in the docuemntation and examples.
GitLab.org / cli · GitLab uses cobra as a CLI framework.
Verification steps
- Do the steps highlighted in "Polish the MVC end-to-end Attestation workflow", but perform the validation using the newly added
glab attestation verifycommand🎉
Edited by 🤖 GitLab Bot 🤖