Skip to content

Conversation

@arewm
Copy link
Contributor

@arewm arewm commented Aug 8, 2025

Changes

While the backwards compatible tag-based attestation method works, it can result in a lot of additional tags being pushed to OCI registries. In order to maintain fewer tags, Chains should be able to use the referrer's API when pushing signatures and attestations.

Co-Authored-By: Claude [email protected]
Signed-off-by: arewm [email protected]

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs included if any changes are user facing
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

Add support for pushing OCI signatures and provenance with the referrer's API

@tekton-robot tekton-robot requested review from lcarva and wlynch August 8, 2025 18:12
@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 8, 2025
@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign priyawadhwa after the PR has been reviewed.
You can assign the PR to them by writing /assign @priyawadhwa in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot
Copy link

Hi @arewm. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@arewm arewm force-pushed the use-referrers-api branch 3 times, most recently from 5549931 to 9f1e273 Compare August 8, 2025 18:57
@arewm arewm marked this pull request as draft August 8, 2025 19:26
@tekton-robot tekton-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 8, 2025
@arewm arewm force-pushed the use-referrers-api branch from 9f1e273 to d2f1a14 Compare August 9, 2025 01:28
@anithapriyanatarajan
Copy link
Contributor

anithapriyanatarajan commented Aug 11, 2025

@arewm - Could you clarify if all the OCI registries support the referrer API end point? If not could we include validation and default fall back option if the end point is not supported for the given registry. Also, Recommend to create an upstream issue for this with label kind/feature with more details on why we are incorporating this enhancement.Thanks

@arewm
Copy link
Contributor Author

arewm commented Aug 11, 2025

All registries might not support the referrers API but this is also why the configuration can be defined.

After creating this PR, I investigated the gap more and created sigstore/cosign/issues/4335. I used cosign's support for the new bundle format in the PR. I don't know if there are any implications with this change, but I suspect that we might actually want that to be configured separately from the use of the referrer's API.

My understanding is that Cosign should handle the fallback, but it does make sense to add that as a test case here too.

After I do a little more investigation with cosign, I will create an issue in Chains to further describe the challenge I am trying to resolve (the motivation is similar to the cosign issue).

@arewm
Copy link
Contributor Author

arewm commented Aug 11, 2025

I found the spec: https://github.com/opencontainers/distribution-spec/blob/v1.1.0/spec.md#unavailable-referrers-api

A client that pushes an image manifest with a defined subject field MUST verify the referrers API is available or fallback to updating the image index pushed to a tag described by the referrers tag schema. A client querying the referrers API and receiving a 404 Not Found MUST fallback to using an image index pushed to a tag described by the referrers tag schema.

So we should expect cosign to fall back appropriately. The configuration change is just to attempt to use the referrer's API in the first place instead of only using the legacy option.

arewm added a commit to arewm/tekton-chains that referenced this pull request Sep 16, 2025
Proposing to bump the cosign version to include new library calls to
push attestations with the referrer's API.

- [Release notes](https://github.com/sigstore/cosign/releases/tag/v2.6.0)
- [Changelog](https://github.com/sigstore/cosign/blob/6431af15a8066c4b33c7232fc2dba3f9278a16a5/CHANGELOG.md)
- [Commits](sigstore/cosign/compare/v2.5.3...v2.6.0)

The new changes desired are sigstore/cosign/pull/4357 which should
better support the work in tektoncd#1409.

Signed-off-by: arewm <[email protected]>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
arewm added a commit to arewm/tekton-chains that referenced this pull request Sep 16, 2025
Proposing to bump the cosign version to include new library calls to
push attestations with the referrer's API.

- [Release notes](https://github.com/sigstore/cosign/releases/tag/v2.6.0)
- [Changelog](https://github.com/sigstore/cosign/blob/6431af15a8066c4b33c7232fc2dba3f9278a16a5/CHANGELOG.md)
- [Commits](sigstore/cosign@v2.5.3...v2.6.0)

The new changes desired are sigstore/cosign/pull/4357 which should
better support the work in tektoncd#1409.

Signed-off-by: arewm <[email protected]>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
lcarva pushed a commit that referenced this pull request Sep 18, 2025
* Bump github.com/sigstore/cosign/v2 from 2.5.3 to 2.6.0

Proposing to bump the cosign version to include new library calls to
push attestations with the referrer's API.

- [Release notes](https://github.com/sigstore/cosign/releases/tag/v2.6.0)
- [Changelog](https://github.com/sigstore/cosign/blob/6431af15a8066c4b33c7232fc2dba3f9278a16a5/CHANGELOG.md)
- [Commits](sigstore/cosign@v2.5.3...v2.6.0)

The new changes desired are sigstore/cosign/pull/4357 which should
better support the work in #1409.

Signed-off-by: arewm <[email protected]>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED

* Fix LoadPrivateKey API breaking change for cosign v2.6.0

- Add LoadOption parameter to LoadPrivateKey calls in x509.go and clients.go
- Pass nil for defaultLoadOptions to use sensible defaults (ED25519ph)
- Update both production code and test code to match new API

The LoadPrivateKey function signature changed in cosign v2.6.0 to
include a third parameter for LoadOption configuration. Passing nil
uses the default ED25519ph behavior which is appropriate for this
use case.

Co-authored-by: Claude Sonnet <[email protected]>
Signed-off-by: arewm <[email protected]>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
@tekton-robot tekton-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 19, 2025
@@ -0,0 +1,389 @@
# OCI Storage Format Migration Guide
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is something that Claude created. I'll leave it for now, but will plan to remove it before merging.

@arewm arewm marked this pull request as ready for review September 23, 2025 02:33
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 23, 2025
@arewm
Copy link
Contributor Author

arewm commented Sep 23, 2025

I just reworked this implementation to include the changes made in sigstore/cosign#4357. It is not currently possible for cosign to download all of these attestations, but that is also something that I am working on. I have been using Tekton as the attestation generator for testing Cosign, so as I continue the investigation, this PR may change.

I have some sample images that I generated attestations and signatures for here: https://quay.io/repository/arewm/test-repo?tab=tags

Add storage.oci.format configuration supporting three storage
strategies for OCI signatures and attestations:

- "legacy": Tag-based storage with DSSE format (default)
- "referrers-api": OCI 1.1 referrers API with DSSE format
- "protobuf-bundle": OCI 1.1 referrers API with protobuf
  bundle format

Implementation includes:
- Configuration layer with format validation and defaults
- Format-based routing in AttestationStorer and SimpleStorer
- Three storage implementations per storer type
- Legacy backend integration with format-aware storers
- Comprehensive test coverage for all three formats

Enables adoption of OCI 1.1 referrers API while maintaining
backward compatibility with existing tag-based storage. All
formats also work correctly with both certificate-based and
x509 key configurations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Signed-off-by: arewm <[email protected]>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
@arewm arewm marked this pull request as draft September 24, 2025 03:16
@tekton-robot tekton-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 24, 2025
@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 13, 2025
@tekton-robot
Copy link

@arewm: PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

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

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants