Skip to content

Conversation

@falcorocks
Copy link

@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

@falcorocks falcorocks force-pushed the falcorocks/add-oci11-support branch 2 times, most recently from 751857e to f0a9af2 Compare October 13, 2025 13:10
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 <14293929+falcorocks@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Nov 4, 2025

Codecov Report

❌ Patch coverage is 7.24638% with 64 lines in your changes missing coverage. Please review.
✅ Project coverage is 29.28%. Comparing base (ea54b96) to head (b99f840).
⚠️ Report is 32 commits behind head on main.

Files with missing lines Patch % Lines
pkg/webhook/validation.go 1.96% 49 Missing and 1 partial ⚠️
cmd/tester/main.go 0.00% 7 Missing ⚠️
pkg/config/store.go 12.50% 5 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1894       +/-   ##
===========================================
- Coverage   42.78%   29.28%   -13.50%     
===========================================
  Files         121      122        +1     
  Lines        8994     7320     -1674     
===========================================
- Hits         3848     2144     -1704     
- Misses       4791     4944      +153     
+ Partials      355      232      -123     

☔ 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
Collaborator

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

Fix linting error by changing att.Cert() to att.Signature.Cert() since
attestation embeds oci.Signature as a named field. Also remove trailing
whitespace.

Signed-off-by: falcorocks <14293929+falcorocks@users.noreply.github.com>
@falcorocks falcorocks force-pushed the falcorocks/add-oci11-support branch from 5551644 to b99f840 Compare November 13, 2025 17:10
@falcorocks
Copy link
Author

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

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