[demo] oci-security-scan: trivy image scanning via makefile-modules - #716
[demo] oci-security-scan: trivy image scanning via makefile-modules#716wallrj wants to merge 5 commits into
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Note on triggering the scheduled workflow: GitHub only registers a workflow (for and the nightly schedule (02:00 UTC) takes over from there. To reproduce the scan locally on this branch: Current result on main/this branch: fails with 23 fixable CVEs (9 MEDIUM, 14 HIGH) — Go 1.26.0 stdlib, all fixed by a toolchain bump to ≥1.26.1. 🤖 Generated with Claude Code |
|
Update: the workflow HAS now been tested pre-merge. By folding oci-security-scan into the existing Run: https://github.com/cert-manager/csi-driver/actions/runs/31016050175
Correction to my earlier comment: the "23 fixable CVEs on main" figure came from a local build using system Go 1.26.0; built with the repo-pinned toolchain the image is clean, so no toolchain bump is needed on main. 🤖 Generated with Claude Code |
|
Second pre-merge dispatch, now with third party sidecar scanning (
Both failures are the workflow doing its job. 🤖 Generated with Claude Code |
2beb727 to
17fa076
Compare
|
Rebased onto main ( Re-dispatched run: https://github.com/cert-manager/csi-driver/actions/runs/31036062367
with claude fable 5 |
Demonstrates cert-manager/makefile-modules#688: klone.yaml temporarily points the oci-build module at the fork branch, which adds: - make oci-scan-manager / make oci-security-scan: build the OCI image and scan it with trivy for fixable MEDIUM, HIGH and CRITICAL vulnerabilities, failing if any are found. - A generated nightly GitHub Actions workflow which runs the scan against the default branch, the two newest release branches and the latest release tag. DO NOT MERGE until cert-manager/makefile-modules#688 is merged and klone.yaml is repointed at the upstream module. Signed-off-by: Richard Wall <richard@the-moon.net> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The nightly govulncheck workflow becomes a single security-scan workflow which runs both verify-govulncheck and oci-security-scan against the default branch, the two newest release branches and the latest release tag. Because the govulncheck.yaml file already exists on master, the updated workflow can be triggered on this branch with workflow_dispatch to test it before merging. Signed-off-by: Richard Wall <richard@the-moon.net> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
List the livenessprobe and node-driver-registrar images in oci_scan_extra_images so that oci-security-scan and the nightly security-scan workflow also scan the third party sidecar images which are deployed alongside the csi-driver image. Signed-off-by: Richard Wall <richard@the-moon.net> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Pull in the updated oci-security-scan module branch: scan reports are appended to the GitHub Actions job summary (guarded on GITHUB_STEP_SUMMARY so GitLab and local runs are unchanged), because the trivy table is hard to read in the raw job log. Signed-off-by: Richard Wall <richard@the-moon.net> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Pull in the updated oci-security-scan module branch so that every image report appears in the log and job summary, instead of stopping at the first vulnerable image. Signed-off-by: Richard Wall <richard@the-moon.net> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
What
Demonstrates the new combined security-scan capability from cert-manager/makefile-modules#688 in a real consumer repo.
DO NOT MERGE —
klone.yamltemporarily points thegoandoci-buildmodules at the makefile-modules fork branch (wallrj/makefile-modules@oci-security-scan). Once cert-manager/makefile-modules#688 merges, repoint at upstreammain(or let the regular module upgrade pick it up).What you get
make oci-scan-manager/make oci-security-scan— builds the image(s) and scans with trivy for fixable vulnerabilities of severity MEDIUM, HIGH or CRITICAL (--scanners vuln --ignore-unfixed); human readable table output; non-zero exit if any are found. Oneoci-scan-<name>target perbuild_namesentry, so multi-image repos are covered.govulncheck.yamlfile, so GitHub keeps it registered and dispatchable): runsverify-govulncheckplusoci-security-scan(guarded by target existence) against the default branch, the two newestrelease-X.Ybranches and the latest non-pre-release tag.Demonstration — dispatched pre-merge on this branch
Because the workflow file already exists on master, it could be triggered on this branch before merging:
https://github.com/cert-manager/csi-driver/actions/runs/31016050175
Results (working exactly as designed):
security-scan (oci-security-scan)✅ — govulncheck clean; image built with the repo-pinned Go 1.26.5 and trivy found 0 vulnerabilities (alpine 3.23 base: 0, Go binary: 0).security-scan (v0.15.0)❌ — the latest released tag failsverify-govulncheckwith 5 known vulnerabilities (google.golang.org/grpc → v1.82.1, golang.org/x/text → v0.39.0, go-pkcs12 → v0.7.2, and Go stdlib crypto/tls / net/textproto → go1.26.5) — i.e. the nightly early warning that a new release is needed, which v0.16.0 will address.Note: an earlier version of this PR claimed 23 fixable CVEs on main — that was an artifact of building locally with an older system Go (1.26.0). When built with the repo-pinned Go toolchain (as CI does, and as
make vendor-godoes locally) the image is clean.🤖 Generated with Claude Code