Skip to content

feat: support cosign v3 Sigstore bundle signatures - #3087

Draft
fseldow wants to merge 1 commit into
mainfrom
xinhl/cosign-v3-bundle
Draft

fseldow wants to merge 1 commit into
mainfrom
xinhl/cosign-v3-bundle

Conversation

@fseldow

@fseldow fseldow commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Description

Adds cosign v3 Sigstore bundle signature support to Ratify v2.

Cosign v3 stores signatures as OCI 1.1 referrers with artifact type application/vnd.dev.sigstore.bundle.v0.3+json. Attestations (cosign attest, GitHub artifact attestations, etc.) use the same artifact type and are only distinguished by the in-toto predicate type.

Changes:

  • Bump github.com/notaryproject/ratify-verifier-go/cosign to feat(cosign): support cosign v3 Sigstore bundle signatures ratify-verifier-go#83, which adds bundle verification.
  • Verifiable now delegates to cosign.IsVerifiable:
    • legacy application/vnd.dev.cosign.artifact.sig.v1+json signatures: unchanged
    • bundle referrers annotated with dev.sigstore.bundle.predicateType: https://sigstore.dev/cosign/sign/v1 (or without the annotation): verified
    • bundle referrers annotated with any other predicate type (attestations, possibly from other signers): skipped, so they produce no verifier report and cannot fail the policy
  • Because the annotation is unsigned, ratify-verifier-go additionally enforces the signed in-toto predicateType after verification, so a trusted attestation cannot be accepted as a signature.

This mirrors the v1 change in #3060.

Dependency

Draft until notaryproject/ratify-verifier-go#83 merges; the dependency will then be bumped to the merged commit.

Testing

  • Unit tests for Verifiable covering legacy signatures, bundle signatures, bundles without the annotation, and attestation bundles.
  • go test ./internal/verifier/... ./internal/executor/...
  • E2E coverage with cosign v3-signed images can follow in a separate PR.

Bump ratify-verifier-go/cosign to add cosign v3 Sigstore bundle signature verification and delegate Verifiable to cosign.IsVerifiable, so bundle signatures (application/vnd.dev.sigstore.bundle.v0.3+json) are verified while attestation bundles are skipped.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Xinhe Li <xinhl@microsoft.com>
Copilot AI balanced review requested due to automatic review settings November 6, 2026 04:02
@github-actions github-actions Bot added the v2 label Nov 6, 2026
@codecov

codecov Bot commented Nov 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.50%. Comparing base (0e33d55) to head (577833f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3087   +/-   ##
=======================================
  Coverage   86.50%   86.50%           
=======================================
  Files          54       54           
  Lines        2935     2935           
=======================================
  Hits         2539     2539           
  Misses        302      302           
  Partials       94       94           

☔ View full report in Codecov by Harness.
📢 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Cryptographic bundle verification and signed-predicate enforcement rely on unmerged ratify-verifier-go#83, requiring review of the final merged dependency and validation of real cosign v3 interoperability before approval.

No open issues 🎉

What changed in this PR

Adds cosign v3 Sigstore bundle signature support to Ratify v2 while preserving legacy signature handling and skipping bundles annotated as attestations.

Changes:

  • Updates the cosign verifier dependency to a revision with bundle verification support.
  • Delegates artifact eligibility checks to cosign.IsVerifiable.
  • Adds unit cases for bundle signatures, missing predicate annotations, and attestation exclusion.
File Description
internal/​verifier/​cosign/​register.go Delegates signature eligibility checks to the cosign library.
internal/​verifier/​cosign/​register_test.go Covers bundle eligibility and uses library artifact-type constants.
go.sum Updates checksums for the cosign dependency revision.
go.mod Pins the cosign dependency with bundle support.

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants