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

Specify the builder id for provenance #61

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

LaurentGoderre
Copy link
Member

@LaurentGoderre LaurentGoderre commented Jun 27, 2024

When generating a provenance using the GitHub Action Build-Push Action the action sets the builder id as the URL for the current build. This replicates this behavior.

Example
https://oci.dag.dev/?blob=docker/image-signer-verifier@sha256:56e95d5cbc3afae22c0023f0e386cd04254de1ecd6b98b0b1da483b2a28b1c73&mt=application%2Fvnd.in-toto%2Bjson&size=11949

"builder": {
  "id": "https://github.com/docker/image-signer-verifier/actions/runs/9620065389/attempts/1"
},

We are wondering however if the GitHub Action run url is the best value to use of if a different URL would be better suited.

Copy link

@jonnystoten jonnystoten left a comment

Choose a reason for hiding this comment

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

Thanks @LaurentGoderre ! This is helpful for us when verifying the provenance of DOI because this is a common value to look for across all DOI with provenance attestations.

To fully replicate the docker/build-push-action behavior we'd need to include the "attempt" in the URL too, see their implementation here.

@@ -139,7 +139,7 @@ def build_command:
@sh "SOURCE_DATE_EPOCH=\(.source.entry.SOURCE_DATE_EPOCH)",
# TODO EXPERIMENTAL_BUILDKIT_SOURCE_POLICY=<(jq ...)
"docker buildx build --progress=plain",
"--provenance=mode=max",
"--provenance=\"mode=max,builder-id=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID",

Choose a reason for hiding this comment

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

Missing closing quote here:

Suggested change
"--provenance=\"mode=max,builder-id=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID",
"--provenance=\"mode=max,builder-id=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\"",

@tianon
Copy link
Member

tianon commented Jul 1, 2024

This is helpful for us when verifying the provenance of DOI because this is a common value to look for across all DOI with provenance attestations.

Can you please elaborate more on this? In what way will it be used/validated? Just that it starts with https://github.com/docker-library/meta/actions/...?

They won't necessarily all look that way -- this PR would also need to account for builds that happen on Jenkins, which does have similar environment variables, but as they won't be terribly stable / long-lived URLs in either case, I'd like to understand more about what the actual underlying use case is before I can reasonably opine on what the best solution/value is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants