Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add OCI 1.1 referrers API support for attestation discovery#1894

Merged
hectorj2f merged 1 commit into
sigstore:mainfrom
falcorocks:falcorocks/add-oci11-support
Dec 9, 2025
Merged

Add OCI 1.1 referrers API support for attestation discovery#1894
hectorj2f merged 1 commit into
sigstore:mainfrom
falcorocks:falcorocks/add-oci11-support

Conversation

@falcorocks
Copy link
Copy Markdown
Contributor

@falcorocks falcorocks commented Oct 13, 2025

Closes #1895

Summary

Some provenance attestation implementation, for instance Google Cloud Build, store attestations using the OCI 1.1 referrers API rather than the traditional <subject digest>.att naming scheme. As is, the policy controller is thus unable to verify valid in-toto provenance attestations generated by Google Cloud Build. This is demonstrated in #1895.

This PR Implements OCI 1.1 referrers API for discovering attestations with automatic fallback to legacy tag-based discovery. This enables policy-controller to work with modern OCI 1.1 registries while maintaining backward compatibility, regardless if the new sigstore bundle format is used or not.

Technical implementation:

  • Uses ociremote.Referrers() to discover attestation artifacts
  • Filters by artifact types: in-toto, slsa, provenance, attestation, dsse
  • Processes DSSE envelopes and creates compatible oci.Signature objects
  • Maintains proper payload format for AttestationToPayloadJSON compatibility

BEFORE

Image

AFTER

Screenshot 2025-10-13 at 16 52 14

Release Note

  • Add 'enable-oci11' configuration option
  • Implement custom OCI 1.1 referrers API discovery in validAttestations()
  • Add CLI flag '--enable-oci11' to policy-tester for testing
  • Automatic fallback to legacy cosign discovery when OCI 1.1 fails

Documentation

@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 4, 2025

Codecov Report

❌ Patch coverage is 78.87324% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 29.98%. Comparing base (ea54b96) to head (322205c).
⚠️ Report is 42 commits behind head on main.

Files with missing lines Patch % Lines
cmd/tester/main.go 0.00% 7 Missing ⚠️
pkg/webhook/validation.go 88.88% 3 Missing and 3 partials ⚠️
pkg/config/store.go 75.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1894       +/-   ##
===========================================
- Coverage   42.78%   29.98%   -12.80%     
===========================================
  Files         121      122        +1     
  Lines        8994     7323     -1671     
===========================================
- Hits         3848     2196     -1652     
- Misses       4791     4894      +103     
+ Partials      355      233      -122     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hectorj2f
Copy link
Copy Markdown
Collaborator

@falcorocks There are some lint issues here. Could you fix those ?

@falcorocks falcorocks force-pushed the falcorocks/add-oci11-support branch from 5551644 to b99f840 Compare November 13, 2025 17:10
@falcorocks
Copy link
Copy Markdown
Contributor Author

@hectorj2f I still want to do this, just hard to find the time lately. Please bear with me

@hectorj2f
Copy link
Copy Markdown
Collaborator

@falcorocks You need to fix the DCO check.

@falcorocks falcorocks force-pushed the falcorocks/add-oci11-support branch 2 times, most recently from ecea142 to 5d9db06 Compare December 1, 2025 12:19
Implements OCI 1.1 referrers API for discovering attestations with automatic
fallback to legacy tag-based discovery. This enables policy-controller to work
with modern OCI 1.1 registries while maintaining backward compatibility.

- Add 'enable-oci11' configuration option (disabled by default)
- Implement OCI 1.1 referrers API discovery with fallback
- Add CLI flag '--enable-oci11' to policy-tester for testing

Signed-off-by: falcorocks <[email protected]>
@falcorocks falcorocks force-pushed the falcorocks/add-oci11-support branch from 3c96802 to 322205c Compare December 1, 2025 17:26
@falcorocks
Copy link
Copy Markdown
Contributor Author

@hectorj2f that bring your own keys failure is unrelated to the change...

docker: Error response from daemon: toomanyrequests: You have reached your unauthenticated pull rate limit. https://www.docker.com/increase-rate-limit

Copy link
Copy Markdown
Collaborator

@hectorj2f hectorj2f left a comment

Choose a reason for hiding this comment

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

lgtm

@hectorj2f hectorj2f merged commit 9c1c049 into sigstore:main Dec 9, 2025
105 of 107 checks passed
@github-actions github-actions Bot added this to the v1 milestone Dec 9, 2025
@falcorocks falcorocks mentioned this pull request Dec 11, 2025
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.

Policy controller cannot work with OCI 1.1 stored attestations

2 participants