Add OCI 1.1 referrers API support for attestation discovery
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
AFTER
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 Report
:x: Patch coverage is 7.24638% with 64 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 29.28%. Comparing base (ea54b96) to head (b99f840).
:warning: Report is 32 commits behind head on main.
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
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@falcorocks There are some lint issues here. Could you fix those ?
@hectorj2f I still want to do this, just hard to find the time lately. Please bear with me