Skip to content

ci(security): add dev-ref vulnix scan lane - #1244

Merged
c-vigo merged 1 commit into
devfrom
feature/1237-dev-vulnix-lane
Jul 21, 2026
Merged

c-vigo merged 1 commit into
devfrom
feature/1237-dev-vulnix-lane

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #1237.

security-scan.yml's nightly vulnix gate checked out no ref, so scheduled runs only ever scanned the default branch (main) closure. dev's closure was only scanned at RC time (or by manual dispatch), so a nixpkgs-unstable bump introducing an unexcepted HIGH/CRITICAL — or a time-boxed .vulnixignore exception expiring (e.g. the gawk exception expiring 2026-07-28) — first surfaced mid-release-train, the most expensive moment.

This adds a dev-ref scan lane that reuses the existing machinery unchanged and files an ordinary tracking issue days earlier.

Design: ref matrix (not a second job)

Per the issue ("a second scheduled job or matrix leg") and the repo DRY/minimal-diff rules, I chose a matrix over a duplicated job — least duplication, single source of truth for the scan steps:

  • scan-nix-image gains strategy.matrix.ref: [main, dev] with fail-fast: false so a red main lane never cancels the dev scan (independent signals).
  • The checkout step passes ref: ${{ matrix.ref }}. Local composite actions (setup-env), the flake (devkitImageEnv), and the .vulnixignore register all resolve from the checked-out tree, so the dev leg exercises dev's machinery/register unchanged — exactly as the issue specifies. The run itself still executes from the default branch (scheduled trigger).
  • Behavior is kept identical per ref: each leg runs check-expirations, the closure build, vulnix (via the nvd-mirror), vulnix-gate, and the deduplicated tracking-issue step.
  • Dedup collision avoided: the tracking-issue title is now ref-distinct (Nightly security scan (main|dev): …) and the findings artifact is ref-scoped (nix-image-cve-scan-<ref>) so the two matrix legs never collide on issue dedup or artifact name. The ref is passed to the shell via an env: var (not interpolated into run:), keeping zizmor's template-injection audit clean.

Drive-by (per the issue)

Fixed the stale schedule comment (staggered after nightly CI at 04:00 UTC — no workflow runs at 04:00 anymore) and refreshed the trigger/jobs/on-failure header prose to describe the two-ref matrix.

Testing

Workflow-only change with no runtime test surface, so TDD is skipped for that reason. Verification:

  • pre-commit run --all-files (just precommit) fully green (actionlint, yamllint, sync-manifest, agent-identity, etc.).
  • zizmor 1.25.2 --config zizmor.yml run against the changed file and the base version: both report the identical 4 findings (2 suppressed) — this change introduces zero new zizmor findings (the two shown, artipacked on checkout and template-injection on the pre-existing summary step, are unchanged pre-existing findings; not baselined by me). CI's zizmor gate only audits assets/workspace/.github/workflows/, which this file is not part of.

Caveat (same as ghcr-cleanup.yml)

The schedule: trigger only fires from the default branch, so the new dev lane goes live at the next promote (when this reaches main). Until then it is exercisable via workflow_dispatch.

Scan the dev image closure alongside main by making scan-nix-image a
ref matrix ([main, dev]) with fail-fast disabled. The dev leg reaches
dev's closure, .vulnixignore register and machinery purely through the
checkout ref, files a ref-distinct deduplicated tracking issue, and
scopes its findings artifact per ref so the two legs never collide.
A weekly nixpkgs bump or an expiring .vulnixignore exception on dev now
surfaces days early instead of mid-release-train.

Also fix the stale nightly-schedule comment (no workflow runs at 04:00
UTC anymore) and refresh the trigger/jobs/on-failure header prose.

Refs: #1237
@c-vigo
c-vigo merged commit d829e73 into dev Jul 21, 2026
13 checks passed
@c-vigo
c-vigo deleted the feature/1237-dev-vulnix-lane branch July 21, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant