Repository navigation
feat(release): sign staged metadata.json with cosign - #9089
Merged
cert-manager-prow[bot] merged 2 commits intoAug 5, 2026
Merged
cert-manager-prow[bot] merged 2 commits into
cert-manager-prow[bot] merged 2 commits into
Conversation
cmrel gcb publish now verifies a cosign signature over the staged metadata.json and (once enforced) fails closed without one. The staging job (make upload-release) never produced that signature, which broke publishing (see the v1.21.1 incident). Sign $(bin_dir)/release/metadata.json with cosign (sign-blob, keyed off the existing CMREL_KEY, no tlog upload) in make/release.mk. upload-release already copies the whole release dir, so metadata.json.sig ships alongside it, and cosign is already a make tool, so no cloudbuild change is needed. Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Felix Phipps <[email protected]>
Guard the metadata.json.sig target with an explicit CMREL_KEY empty check, consistent with the helm-chart signing target in manifests.mk. Without it, an unset CMREL_KEY expands COSIGN_KMS_KEY to a bare "gcpkms://" and cosign fails with an opaque KMS error; this gives an actionable message, notably when the target is invoked directly rather than via the release chain. Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Felix Phipps <[email protected]>
Member
Author
|
/kind feature |
wallrj
approved these changes
Aug 5, 2026
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: wallrj The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
cert-manager-prow
Bot
merged commit Aug 5, 2026
b1c43c1
into
cert-manager:release-1.21
6 checks passed
39 of 41 tasks
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.
Backport to release-1.21 of the master change (same edit; make/release.mk is identical across these branches).Description
Problem
cmrel gcb publish now verifies a cosign signature over the staged metadata.json and, once enforcement is switched on, fails closed if there's no valid metadata.json.sig next to it in gs://cert-manager-release. metadata.json lists every release artifact and its checksum, and it's read back from the same bucket it was uploaded to — so signing it with the release KMS key (which random bucket writers don't hold) is what makes it trustworthy.
The staging job — make upload-release — never produced that signature:
rclone copytoof the release dir; it never installed cosign or signed anything, so no .sig was ever staged. With the enforcing default shipped, cmrel gcb publish refuses every release (this broke the v1.21.1 patch release).Solution
Sign $(bin_dir)/release/metadata.json with cosign (sign-blob) in make/release.mk, producing metadata.json.sig. The key is derived from the existing CMREL_KEY — rewritten to the gcpkms://…/versions/N form cosign expects — so callers still set only one key. --tlog-upload=false keeps this private staging artifact out of the public Rekor log and keeps verification offline. upload-release already copies the whole release dir, so the .sig ships alongside metadata.json with no rclone change, and cosign is already a make tool, so no cloudbuild change is needed. Local make release-artifacts is unaffected — signing only runs in the paths that already require CMREL_KEY.
Test plan
Release note