ci(security): scan before push, sign + attest release images (#233, fixes #1213)#1233
Merged
Defilan merged 6 commits intoJul 23, 2026
Merged
Conversation
…ilantech#233) Signed-off-by: Christopher Maher <chris@mahercode.io>
…efilantech#233) Signed-off-by: Christopher Maher <chris@mahercode.io>
…ch#233, fixes defilantech#1213) Signed-off-by: Christopher Maher <chris@mahercode.io>
…efilantech#233) Signed-off-by: Christopher Maher <chris@mahercode.io>
…erify (defilantech#233 review) Signed-off-by: Christopher Maher <chris@mahercode.io>
…tech#233) setup-trivy, cosign-installer, setup-crane, and sbom-action are pinned to immutable commit SHAs with version comments, so a moved tag cannot swap the action out from under a supply-chain-provenance release. Signed-off-by: Christopher Maher <chris@mahercode.io>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
Completes the supply-chain story for LLMKube releases: Trivy now scans every image before it is pushed, and every published image is cosign-signed with an SLSA build provenance attestation and an SBOM attestation, all keyless.
Scan before push (fixes #1213)
Previously
goreleaser release --cleanbuilt and pushed all 4 multi-arch images atomically, and a separatetrivy-scanjob scanned the already-published images. A vulnerable image was therefore already in GHCR by the time the scan ran (this is why 0.9.9 shipped with a HIGH grpc CVE and needed the 0.9.10 roll-forward).Now a
hack/scan-images.shstep builds each image forlinux/amd64(the binary built the sameCGO_ENABLED=0way GoReleaser builds it, so the assembled image is representative) and Trivy-scans it locally, before GoReleaser builds the multi-arch manifests and pushes. A CRITICAL/HIGH finding fails the job before anything reaches the registry. The standalone post-pushtrivy-scanjob is deleted. A committed.trivyignoreis the documented escape valve so one unpatchable upstream CVE cannot freeze every release.Sign + attest (keyless)
After push, each of the 4 images (controller, foreman-operator, foreman-agent, router-proxy) is signed and attested by digest:
cosign sign(keyless, Sigstore/GitHub OIDC)actions/attest-build-provenance(SLSA build provenance)actions/attest-sbomwith a syft SPDX SBOMThe release binary archives (
dist/*.tar.gz) also get SLSA provenance. The workflow self-verifies after signing (fails the release ifcosign verify/gh attestation verifydo not pass). Aworkflow_dispatchdry-run exercises the whole chain against a throwaway:provenance-testtag without cutting a release.docs/security/verifying-releases.mddocuments how consumers verify.Third-party actions added here (setup-trivy, cosign-installer, setup-crane, sbom-action) are pinned to immutable commit SHAs.
.goreleaser.yamlis not touched (digests captured viacrane digestin the workflow).Type of Change
How Has This Been Tested?
actionlintclean; YAML parses;shellcheck hack/scan-images.shcleanCGO_ENABLED=0 GOOS=linux GOARCH=amd64)workflow_dispatchdry-run must run green on the fork (build -> scan -> push:provenance-test-> sign -> attest ->gh attestation verify), and a deliberately-vulnerable base must fail the scan with nothing pushed. The dry-run derives the GHCR org and cosign identity from the repo context so it works on a fork. This is the real end-to-end proof; code inspection alone does not prove the Sigstore/attestation chain.Checklist
docs/security/verifying-releases.md, README link)Assisted-by: Claude Code (design, implementation, and multi-stage review under human direction); I reviewed and own the final result.
Fixes #233
Fixes #1213