Repository navigation
Sign each release and attach the signature to the GitHub Release - #14347
Draft
chelseakr-exygy wants to merge 1 commit into
Draft
chelseakr-exygy wants to merge 1 commit into
chelseakr-exygy wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #14347 +/- ##
=========================================
Coverage 82.61% 82.61%
Complexity 5758 5758
=========================================
Files 617 617
Lines 26275 26275
Branches 2112 2112
=========================================
Hits 21706 21706
Misses 3841 3841
Partials 728 728 ☔ 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.
Description
Adds a
Sign Releaseworkflow that signs each released image and attaches the signature to the GitHub Release. The OpenSSF Scorecard Signed-Releases check only looks at release assets (*.sigstore.jsonand similar), and each release has only the SBOM today, so we score 0 on it.How it works, modeled on
sbom_generator.yaml:release: published, or by hand withworkflow_dispatchand a tag, to sign releases published before this existed.docker.io/civiform/civiform:<tag>from the release tag and writesdocker.io/civiform/civiform@sha256:...tociviform-civiform_vX_Y_Z.digest.txt.cosign sign-blob), so there are no keys to store or rotate. The signing identity is this workflow..sigstore.jsonbundle to the release.It has to run after the release is published because
bin/create-releaseretags the SNAPSHOT image withdocker pull,tagandpush, which gives the release tag a different digest (v3.38.0:sha256:17315920...vssha256:4d9869cc...on its snapshot; same config and layers). A signature made at build time would not apply to the release tag.Signing the digest file, not the image in the registry, keeps this to one workflow with no Docker Hub push credentials. Signing the image itself in the registry could follow if we want
cosign verify <image>to work directly.Pinning:
cosign-installeris pinned by SHA (v4.1.2) andcosign-releaseis set to v3.1.3, like the other actions here. I chose Sigstore keyless (Scorecard score 8) over SLSA provenance (score 10) because the SLSA generator is, as far as I know, referenced by tag rather than SHA, and I didn't want a Pinned-Dependencies exception. Not verified.What I checked locally: the workflow file parses, the digest command returns the right digest for v3.38.0 from Docker Hub, and the tag and digest checks and file name logic behave as expected in bash. What I did not check: the cosign steps and the upload, which need a real run with an OIDC token. Plan: after merge, run it once with
workflow_dispatchon the newest release, then on the last four, and confirm the next weekly Scorecard run moves Signed-Releases.Docs: how to verify a release is in the workflow header comment. The dev wiki Releasing page still needs a short section, which I'll do separately because the wiki is a different repo.
Checklist
General
Read the full guidelines for PRs here
civiform/developers, or a more specific round-robin listciviform/eng-adminas FYI (if this PR includes functionality changes and neither you nor the primary reviewer is an admin)isDevOrStagingInstructions for manual testing
After merge, run the
Sign Releaseworkflow from the Actions tab with the newest release tag (for examplev3.39.0). The release should gainciviform-civiform_v3_39_0.digest.txtandciviform-civiform_v3_39_0.digest.txt.sigstore.json. The command in the workflow header should verify them.The workflow and this description were drafted with AI assistance (Claude).
Issue(s) this completes
Fixes #14343