Staple attestation to OCI image #19197
Draft
+78
−20
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.
Basic framework for stapling attestations to OCI image, which allows us to fetch attestations from the same source we download bottles and means we don't have the restrictions of needing an API token (or a heavily rate-limited endpoint without a token). This is the first of two steps required for attestations to leave beta (the second step being the fetching side paired with
sigstore-ruby
but that should be easy).Basically how it works is we upload the attestation as a blob and reference it in the manifest annotation as
sh.brew.attestation_bundle
, which will allowbrew
to download it in just one extra roundtrip.For uploading however we need extra manifests etc. Brew won't use these but the OCI registry does.
The best way to do this is using OCI 1.1, using an approach like https://github.com/sigstore/cosign/blob/main/specs/BUNDLE_SPEC.md. Unfortunately, GitHub Packages is AFAICT the only major OCI registry that still does not support OCI 1.1 (despite Azure being one of the first to support it).
Alternative approaches unfortunately all suck but they include:
Use the tag "fallback" method:
Use the untagged "fallback" method:
Add the referrer manifests directly to the bottle manifest list
all_files
thing that's planned).Inline the whole thing in an annotation (potentially as base64):