ci: gate releases on license, CodeQL, malware and secret checks #3962
All Vouch review confidence checks passed
Residual risk 0.32 = Change Risk (0.75) × (1 − Review Confidence (0.58)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.75 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.075
Real PR Conversation Timeline
1 comments
"Review active on #3962"
general
weight: 0.35
lalitadithya
Summary
Release CI now runs vulnerability, malware and secret checks on every platform of every release image, and dependency-license and CodeQL checks on the tagged commit. Promotion fails closed on all of them.
Motivation / Context
Consumers should be able to trust that each released artifact passed the same five checks (license, CVE, malware, secret, SAST) on the exact bytes that ship. Before this change the tag ran only Grype on images and ClamAV on binaries. The license allowlist and CodeQL ran only on PRs and
mainpushes, so a bot-merged commit or a patch tag could ship unchecked. This PR makes every check run and gate on the tag. Signing the results is the next step (#3957).Fixes: #3950
Fixes: #3951
Fixes: #3952
Fixes: #3953
Fixes: #3955
Fixes: #3956
Related: #3958
Type of Change
Component(s) Affected
cmd/aicr,pkg/cli)cmd/aicrd,pkg/server)pkg/recipe)pkg/bundler,pkg/component)pkg/collector,pkg/snapshotter)pkg/validator)pkg/errors,pkg/k8s)docs/,examples/).github/),tools/image-unpack,RELEASE.mdImplementation Notes
Image checks.
image-vuln-scanandoperator-scanare replaced byimage-checks(check-images.yaml, seven images by candidate digest) andoperator-checks(check-operator.yaml, operator and registry from the candidate's local layouts, before anything is pushed). Both run.github/actions/image-checksfor each image and platform:tools/image-unpack(new) verifies the OCI layout against the index digest, checks every blob digest and layerdiff_id, and unpacks each layer into its own directory. A file deleted by a later layer is therefore still on disk to scan. It also writes the image config and history, and the printable strings of each executable built from theaicr.runmodule.oci-dir:source does not apply it. Grype must report the platform manifest the unpack verified..gitleaks.toml. It fails on any file it reports it could not read.checks.jsonsummary (scanner and database versions, policy file digests, scope, result) to a per-attempt artifact. Nothing is signed yet.Secret scan scope. The Gitleaks default path allowlist stays on, so Python library directories, virtualenvs,
node_modulesand vendored modules are not scanned. With it off,aiperf-benchproduces 152 findings, all upstream test keys and model code inside third-party packages. Binaries not built from AICR are malware-scanned but not secret-scanned. Strings of AICR executables are packed literals, so rules that need a word boundary can miss a token next to another literal.RELEASE.mdand the summary state this scope..gitleaks.tomlhas one allowlist: the generic keyword rule is off for strings files, where packed literals make it fire at random. Every provider-specific rule still runs on them.Source checks on the tag.
license-checkrunsmake license-check.codeqlanalyzes the tag commit and waits for this upload's SARIF processing to complete; the pinned analyze action can give up waiting and still succeed. It then blocks on open CodeQL alerts of High or Critical security severity on the tag ref. Reading alert state rather than the SARIF means dismissed alerts do not block.malware-scanfails closed. It now fails on a missing summary, a scan of no files, a count other thanexpected_files, or a file past a size or nesting limit (--alert-exceeds-max). It installs the pinned ClamAV.deb; it previously usedaptwith no version.Pins. Grype (checksum), Gitleaks and ClamAV are pinned in
.settings.yaml, withtools/update--checksumsrefreshers, RenovatepostUpgradeTasks, andcheck-settings-checksumscoverage. The weekly image scan and the repository scan now passgrype-version, so every Grype run uses the pin.Release time. Image checks sit before
attest.aiperf-benchis the long leg: about 600 MB pulled, about 1.7 GiB unpacked, and a ClamAV pass that took about 5 minutes locally. Expect the release to take several minutes longer than with the Grype-only scan. The first RC will measure it.Testing
tools/image-unpack: new package, 85.4% coverage. Tests cover digest, size,diff_id, media-type, platform and path-traversal rejections, per-layer retention of deleted files, duplicate entries, record padding, AICR-executable detection and strings output, and cancellation.tests/releasepolicy: the step scripts run against stubclamscan,grype,gitleaksandgh. They cover each fail-closed branch: no summary, no files, a count mismatch, a limit hit, a findings exit, a Gitleaks read warning, a different manifest, and CodeQL processing pending, failed or errored. Also covered: input validation, artifact names across attempts, and job wiring. Key guards were mutation-checked; the tests fail when each guard is removed.- Gitleaks: no findings on all seven images; planted tokens are detected.
- ClamAV: no findings. On
aiperf-benchit read exactly the 36,143 non-empty files the unpack wrote. EICAR and an over-limit file both fail.- Grype: a test OpenVEX statement applies on the registry source.
- The merge gate's repository malware scan passes with the new flags.
check-images.yamlran on a branch push against the v1.3.0 images, and all 14 image/platform checks passed (aiperf-bench6.5–8.5 min per platform, others 2–3 min). The tag's CodeQL job, uploaded under its own category on a branch ref, produced 14 High/Critical results, all mapped to alerts already dismissed onmain, and the gate passed. The probe's code-scanning analyses were deleted. Only an RC proves the tag ref itself, theon-tag.yamlwiring and total release time.Risk Assessment
Rollout notes: The release path gains four blocking checks: license on the tag, CodeQL, malware layers and secrets. Land early in a cycle and cut an RC right after, so a false positive shows up on an RC rather than on the release. If the RC is blocked, the job log and the
image-checks-artifacts name the cause. Revert is a single PR.Checklist
make testwith-race)make lint)git commit -s -S) — GPG signing info