Repository navigation
feat(release): sign staged metadata.json with cosign - #9087
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]>
There was a problem hiding this comment.
Pull request overview
This PR updates the release Makefile to generate and stage a detached cosign signature for metadata.json, enabling the publish pipeline to verify the staged metadata’s authenticity using the release KMS key.
Changes:
- Derive a
gcpkms://.../versions/Ncosign-compatible KMS URI fromCMREL_KEY(COSIGN_KMS_KEY). - Add a Make target to sign
$(bin_dir)/release/metadata.jsonwithcosign sign-blob, producingmetadata.json.sig. - Ensure
make releasebuildsmetadata.json.sigalongsidemetadata.json.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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]>
|
/kind feature |
wallrj
left a comment
There was a problem hiding this comment.
The change is minimal and correct: a single new make rule signs the staged metadata.json with cosign (--tlog-upload=false, KMS key derived from the existing CMREL_KEY), and upload-release already ships the whole release dir so the .sig lands next to it with no rclone or cloudbuild changes.
The one Copilot review comment (fail fast when CMREL_KEY is empty) was addressed in e21fd92 with an explicit guard consistent with the other signing targets, and the thread is resolved. All presubmits are green.
/lgtm
/approve
with claude fable-5
|
[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 |
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