feat(cosign): Support Cosign v3 Bundle signature format#22628
Merged
wy65701436 merged 4 commits intogoharbor:mainfrom Dec 15, 2025
Merged
feat(cosign): Support Cosign v3 Bundle signature format#22628wy65701436 merged 4 commits intogoharbor:mainfrom
wy65701436 merged 4 commits intogoharbor:mainfrom
Conversation
Signed-off-by: Aloui-Ikram <ikram@container-registry.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #22628 +/- ##
===========================================
+ Coverage 45.36% 65.85% +20.48%
===========================================
Files 244 1073 +829
Lines 13333 116095 +102762
Branches 2719 2931 +212
===========================================
+ Hits 6049 76452 +70403
- Misses 6983 35405 +28422
- Partials 301 4238 +3937
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Signed-off-by: Aloui-Ikram <ikram@container-registry.com>
d89420d to
3f05013
Compare
Contributor
|
@Aloui-Ikram Once again, thanks for clearing up my backlog. |
Contributor
|
@Aloui-Ikram thanks for your contribution, can you ensure all the CI pipelines pass? @MinerYang please have a review and validate the changes at our end, thanks. |
Contributor
Author
|
@wy65701436 You’re welcome , i reviewed the CI failure ,they are coming from unrelated UT tests ,they don’t seem related to my changes in middleware/subject |
MinerYang
requested changes
Dec 11, 2025
Signed-off-by: Aloui-Ikram <ikram@container-registry.com>
Contributor
|
looks like the UTTEST is flaking again. |
intojhanurag
pushed a commit
to intojhanurag/harbor
that referenced
this pull request
Jan 22, 2026
* feat(cosign): support Cosign v3 bundle format Signed-off-by: Aloui-Ikram <ikram@container-registry.com> * fix: format code with gofmt Signed-off-by: Aloui-Ikram <ikram@container-registry.com> * refactor: rename variable to mediaTypeCosignArtifactType Signed-off-by: Aloui-Ikram <ikram@container-registry.com> --------- Signed-off-by: Aloui-Ikram <ikram@container-registry.com> Co-authored-by: Aloui-Ikram <ikram@container-registry.com> Co-authored-by: miner <miner.yang@broadcom.com>
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.
This PR adds support for the new Cosign signature format introduced in v2.6+ (and made default in v3.0+).
The Problem:
Cosign changed its default signature format to the OCI 1.1 Bundle format with the media type:
application/vnd.dev.sigstore.bundle.v0.3+jsonHarbor's Subject Middleware currently only recognizes the legacy Cosign media type. As a result, new signatures are classified as generic
subject.accessoryartifacts. This causes the UI to show the artifact as "Not Signed" (Red X) and missing the Cosign icon.The Fix:
I updated
src/server/middleware/subject/subject.goto:model.TypeCosignSignature.This change maintains backward compatibility (legacy signatures are still supported).
Verification:
Tested locally with Harbor Dev Environment (
harbor-next) and Cosign v3.0.2.cosign sign(defaults) creates the new bundle format.type: "signature.cosign".Screenshots
Before (The Issue)
Harbor fails to recognize the signature (Red X, generic accessory type):

After (The Fix)
Harbor correctly identifies the signature (Green Checkmark, Cosign icon):


Issue being fixed
Fixes #22401
Please indicate you've done the following: