Repository navigation
ci(security): vulnix + SBOM CVE scanning for the Nix image (#637) - #660
Merged
c-vigo merged 6 commits intoJun 23, 2026
Merged
Conversation
Specify vulnix-gate: excepted_cves() reuses check_expirations.parse_entries and drops expired exceptions; blocking_findings() flags only HIGH/CRITICAL (CVSS >= threshold) CVEs that are not excepted, ignoring sub-threshold and unscored CVEs; main() exits non-zero on any unexcepted HIGH/CRITICAL. Allow the policy term 'unexcepted' in the typos dictionary. Refs: #637
vulnix-gate loads vulnix --json findings and fails when a HIGH/CRITICAL CVE (CVSS v3 >= threshold, default 7.0) is not covered by a non-expired entry in the exception register. It reuses check_expirations.parse_entries so .vulnixignore shares the .trivyignore Expiration: format and one expiry SSoT; sub-threshold and unscored CVEs are awareness-only. This is the objective go/no-go gate input for #639. Refs: #637
Lift the shared imageTools (and python) to the per-system let so both the image and a new packages.devcontainerImageEnv can use it. devcontainerImageEnv is a buildEnv whose runtime closure equals the image's package set, giving vulnix --closure an accurate scan target (the gzipped OCI tar exposes no scannable store refs). Also expose packages.vulnix from the locked nixpkgs so the nightly scan runs a reproducible scanner version. Refs: #637
…x image Add a scan-nix-image job to the nightly workflow: build the flake devcontainerImageEnv closure, run vulnix (primary CVE scanner) to JSON + table, and gate unexcepted HIGH/CRITICAL via vulnix-gate against the new .vulnixignore register. Keep Trivy for a CycloneDX SBOM and an SBOM-mode vuln view (defense in depth), and upload both scanners' output as the Trivy-vs-vulnix overlap evidence. The gate is continue-on-error during discovery (vulnix over-reports nixpkgs-patched CVEs); #639 flips it to blocking. Wire .vulnixignore into the check-expirations pre-commit hook and the ci.yml expiry step alongside .trivyignore. Refs: #637
…sture Reframe the policy around the Nix-built image: pinned nixpkgs rev as the primary lever, nightly vulnix as primary detection, Trivy SBOM for defence in depth, and dual .vulnixignore/.trivyignore expiry registers. Drop the apt --only-upgrade escape hatch and the 'why not apt-get upgrade' section; 'advance the nixpkgs rev' replaces them. Note the residual Debian :latest scan until decommission (#642). Record the change in the changelog. Refs: #637
…' into feature/637-vulnix-sbom-scanning # Conflicts: # CHANGELOG.md # assets/workspace/.devcontainer/CHANGELOG.md
This was referenced Jul 1, 2026
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.
Summary
Implements T3.1 (#637): a Nix image has no
apt/dpkgDB, so Trivy's OS-package scanner goes dark. This replaces the primary CVE signal withvulnix(nixpkgs-native), keeps Trivy for an SBOM + defence-in-depth view, re-authors the security policy, and rebuilds the expiry-gated exception register aroundvulnixfindings. This produces the objective go/no-go gate input for #639.What changed
scan-nix-imagejob (security-scan.yml): builds the image package closure (new flakepackages.devcontainerImageEnv) and runsvulnixas the primary scanner; emits a CycloneDX SBOM and a Trivy SBOM-mode vuln view for defence in depth; uploads both scanners' output asvulnix-vs-Trivy overlap evidence.vulnix-gate(packages/vig-utils, TDD): fails on HIGH/CRITICAL (CVSS v3 ≥ 7.0)vulnixfindings not covered by a non-expired exception. Reusescheck_expirations.parse_entries, so.vulnixignoreshares the.trivyignoreExpiration:format and one expiry SSoT (wired into the pre-commit hook +ci.yml).imageToolsto exposedevcontainerImageEnv(accuratevulnix --closuretarget — the gzipped OCI tar has no scannable store refs) and a pinnedpackages.vulnix.docs/CONTAINER_SECURITY.md: re-authored for the Nix posture — dropped theapt --only-upgradeescape hatch + "why notapt-get upgrade" section; "advance thenixpkgsrev" is the primary lever; documents dual registers and the residual Debian scan until T4.4 — Decommission the Debian path #642.Scope guardrails
continue-on-error) during discovery:vulnixover-reports because it can't seenixpkgs' backported patches (local run surfaced ~83 HIGH/CRITICAL, mostly false positives). T4.1 — Publish-cutover to the Nix image (GATED) #639 flips it to blocking after triage + nixpkgs advance, and wires SARIF + a dedup issue..vulnixignorestarts empty (header-only); findings are triaged into it before cutover.Verified locally
nix build .#devcontainerImageEnv+nix run .#vulnix -- --closure ./result --json→ 38 derivations, scores parsed correctly.vulnix-gateagainst the real output flags HIGH/CRITICAL sorted by score; 509vig-utilstests pass (12 new).check-expirations .trivyignore .vulnixignore→ validated.Dependencies
buildLayeredImage), non-publishing #634 (✅ merged). Blocks: T4.1 — Publish-cutover to the Nix image (GATED) #639. Related: [CHORE] Clean up stale code-scanning alerts and consolidate Trivy scan categories #604, Nightly security scan: HIGH/CRITICAL vulnerabilities in :latest #602/Nightly security scan: HIGH/CRITICAL vulnerabilities in :latest #521, [DISCUSSION] Optimize CI pipeline for PRs to dev — full security scan on every PR? #109, Adopt Nix/devenv for reproducible, auditable dependency management #27.Refs: #637