fix(storage): forward RekorEntry to signature bundle in sigstore-bundle mode#1831
Open
anithapriyanatarajan wants to merge 1 commit into
Open
Conversation
…le mode In the OCI sigstore-bundle encoding path, the signature bundle was stored without a transparency log entry (tlogEntries=[]) even when Rekor upload had succeeded. Root cause: legacy.go uploadSignature constructed the signing.Bundle for the StoreRequest without setting RekorEntry, so storeWithSigstoreBundle always received a nil RekorEntry and makeSigBundleBytes passed nil to cbundle.MakeProtobufBundle, producing a bundle with no tlogEntries. The attestation path was unaffected: storeWithProtobufBundle in attestation.go already read req.Bundle.RekorEntry directly from the StorageOpts-populated field added in tektoncd#1691. Fix: set RekorEntry: storageOpts.RekorEntry in the signing.Bundle constructed by uploadSignature. The field is nil-safe: MakeProtobufBundle skips tlog embedding when rekorEntry is nil, so behaviour is unchanged when transparency is disabled or Rekor upload failed. Also correct two log messages in attestation.go that referred to "protobuf bundle format" instead of the user-facing term "sigstore bundle format" used elsewhere. Add TestMakeSigBundleBytes_TlogEntries to guard the nil-rekorEntry path and document the expected behaviour. Signed-off-by: Anitha Natarajan <anataraj@redhat.com> Assisted-by: Claude Sonnet 4.6 (via GitHub Copilot) Signed-off-by: Anitha Natarajan <anataraj@redhat.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1831 +/- ##
=======================================
Coverage 61.93% 61.94%
=======================================
Files 64 64
Lines 4067 4068 +1
=======================================
+ Hits 2519 2520 +1
Misses 1266 1266
Partials 282 282
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
In the OCI sigstore-bundle encoding path (#1691), the signature bundle was stored without a transparency log entry (tlogEntries=[]) even when Rekor upload had succeeded.
Root cause: legacy.go uploadSignature constructed the signing.Bundle for the StoreRequest without setting RekorEntry, so storeWithSigstoreBundle always received a nil RekorEntry and makeSigBundleBytes passed nil to cbundle.MakeProtobufBundle, producing a bundle with no tlogEntries.
The attestation path was unaffected: storeWithProtobufBundle in attestation.go already read req.Bundle.RekorEntry directly from the StorageOpts-populated field added in #1691.
Fix: set RekorEntry: storageOpts.RekorEntry in the signing.Bundle constructed by uploadSignature. The field is nil-safe: MakeProtobufBundle skips tlog embedding when rekorEntry is nil, so behaviour is unchanged when transparency is disabled or Rekor upload failed.
Also correct two log messages in attestation.go that referred to "protobuf bundle format" instead of the user-facing term "sigstore bundle format" used elsewhere.
Add TestMakeSigBundleBytes_TlogEntries to guard the nil-rekorEntry path and document the expected behaviour.
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
Release Notes
Assisted-by: Claude Sonnet 4.6 (via GitHub Copilot)