Attest image SBOM via referrers so it verifies with the standard commands - #83
Merged
Conversation
The SBOM was attached with `cosign attest`, which writes to the legacy `.att` tag, while provenance uses actions/attest-build-provenance (OCI referrers). cosign verify-attestation reads referrers, so it found the provenance but never the SBOM, even though it was attached (the documented `cosign verify-attestation --type spdxjson` command failed on v0.4.10). Switch the SBOM to actions/attest-sbom (push-to-registry) so SBOM and provenance share the referrers store and verify with the same commands.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Docker Image Builtdocker pull ghcr.io/tight-line/ballast:pr-83-d9577f0Helm (values override)image:
repository: ghcr.io/tight-line/ballast
tag: "pr-83-d9577f0"Image expires ~15 days after PR closes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up polish on workstream D, verified against the actual v0.4.10 release.
What v0.4.10 proved (all green)
cosign verify-attestation --type slsaprovenance1andgh attestation verify)cosign verify-attestationThe inconsistency
actions/attest-build-provenancewrites to the OCI referrers store; my SBOM usedcosign attest, which writes to the legacy.atttag.cosign verify-attestationreads referrers, so it found the provenance and missed the SBOM, even thoughcosign download attestationshows the SBOM is attached (https://spdx.dev/Document). TheSECURITY.mdSBOM-verify command therefore didn't work.Fix
Attest the SBOM with
actions/attest-sbom(push-to-registry: true) instead ofcosign attest, so SBOM and provenance share the referrers store and both verify with the samecosign verify-attestation/gh attestation verifycommands.anchore/sbom-actionstill generates the SPDX SBOM; only the attest mechanism changes. No egress/permission changes (referrers use the sigstore +api.github.comhosts already allowed).Validation
Tag-only, so it validates on the next release. After that,
cosign verify-attestationshould find both the SBOM and the provenance on the image, matching theSECURITY.mdcommands.