Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

add gh attestation verify options --ref and --commit #9602

Copy link
Copy link

Description

@ramonpetgrave64
Issue body actions

Describe the feature or problem you’d like to solve

gh attestations verify ... allows the user to verify various properties in the attestation, such as the source repo with --repo and the signing workflow with --signer-repo. You can also verify the signing workflow's ref with --cert-identity.

The problem is that there may be many artifacts that come from a source repo, so I can't easily be sure if the artifact came from approved changes, in the case of protected mainline branches or tags. Furthermore, verifying the source commit sha will allow me to pinpoint the exact code that produced the artifact.

Proposed solution

I would like for be able to verify the source repo's ref, and also the source repo's commit sha, so I can easily be more sure about my received artifacts:

  • --ref
  • --commit

While we are making these changes, we may also add:

  • signer-ref
  • signer-commit

Additional context

My current solution is cumbersome, involving --jq and piping to grep:

SOURCE_REPO="ramonpetgrave/github-build-attestations-rw"
SOURCE_REF="refs/heads/main"
SIGNER_WORKFLOW_CERT_IDENTITY="https://github.com/ramonpetgrave/github-build-attestations-rw/.github/workflows/attest-build-provenance-slsa3-rw.yml@refs/heads/dev"
gh attestation verify $ARTIFACT_PATH \
    --deny-self-hosted-runners \
    --repo "$SOURCE_REPO"  \
    --cert-identity "$SIGNER_WORKFLOW_CERT_IDENTITY" 
    --format json --jq '.[].verificationResult.signature.certificate.sourceRepositoryRef' \
| grep "^$SOURCE_REF$"
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIa request to improve CLIgh-attestationrelated to the gh attestation commandrelated to the gh attestation commandmore-info-neededMore info needed from user/contributorMore info needed from user/contributor

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.