Skip to content

fix(ci): self-host an NVD feed mirror for vulnix scans - #871

Merged
c-vigo merged 1 commit into
release/0.4.0from
bugfix/870-nvd-mirror
Jul 6, 2026
Merged

c-vigo merged 1 commit into
release/0.4.0from
bugfix/870-nvd-mirror

Conversation

@c-vigo

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

Copy link
Copy Markdown
Contributor

Closes #870.

Problem

nvd.nist.gov is chronically throttled/unstable (nix-community/vulnix#171). Cold vulnix runs crawl the full NVD year-feed set for tens of minutes and fail with ReadTimeoutError/IncompleteRead — verified 2026-07-06, a cold run failed all 3 retries over 53 min, blocking both the nightly gate and the release publish gate.

Change

  • New nvd-mirror-refresh.yml — the only job that talks to NVD. Downloads the 7 NVD 2.0 feed files (nvdcve-2.0-<6 years>.json.gz + modified) with resumable retry (curl -C -), validates them (gzip -t), and republishes them as assets on the nvd-mirror release. Never clobbers the mirror with a partial set.
  • security-scan.yml + release.yml vulnix-gate now run vulnix --mirror <nvd-mirror release>/, fetching NVD data from GitHub's CDN instead of nvd.nist.gov. An NVD outage can no longer fail a scan or block a release.
  • Docs (docs/CONTAINER_SECURITY.md) + CHANGELOG.

Why a mirror (not just retries)

The mirror localizes the NVD dependency to one job: if the feeds ever change/retire, only the refresh job's source changes — vulnix keeps consuming identical files. vulnix has no NVD-API-migration plan and is on the current 2.0 feeds (no firm retirement date).

Sequencing (important)

  • A new workflow is only schedulable/dispatchable from the default branch. main is still the pre-cutover Debian world, so the scheduled refresh activates only once this rides the cutover onto the new main.
  • Until then the nvd-mirror release is bootstrapped out-of-band (the 7 feeds uploaded manually), so this release's own vulnix-gate can use the mirror immediately.

Test plan

  • nvd-mirror release has 7 valid gzip feed assets (bootstrapped).
  • Dispatch security-scan.yml on this branch → Run vulnix fetches from .../nvd-mirror/…, not nvd.nist.gov; completes fast even while NVD is degraded.
  • After cutover: nvd-mirror-refresh.yml auto-refreshes on main.

nvd.nist.gov is chronically throttled (nix-community/vulnix#171): cold
scans crawl the full NVD year-feed set for tens of minutes and fail with
ReadTimeoutError/IncompleteRead, blocking both the nightly gate and the
release publish gate.

Add nvd-mirror-refresh.yml — the only job that talks to NVD — which
downloads the NVD 2.0 feed files with resumable retry, validates them,
and republishes them as assets on the nvd-mirror release. Point the
vulnix invocations in security-scan.yml and the release vulnix-gate at
that mirror via --mirror, so NVD data is fetched from GitHub's CDN and an
NVD outage can no longer fail a scan or block a release.

The scheduled refresh activates once this reaches the default branch via
the cutover; the mirror is bootstrapped out-of-band until then.

Refs: #870
@c-vigo
c-vigo enabled auto-merge July 6, 2026 11:19
@c-vigo
c-vigo merged commit 31dcba9 into release/0.4.0 Jul 6, 2026
11 checks passed
@c-vigo
c-vigo deleted the bugfix/870-nvd-mirror branch July 6, 2026 11:29
c-vigo added a commit that referenced this pull request Jul 6, 2026
)

Follow-up to #871 (already merged). Refs #870.

## Why

#871 landed the mirror as **release assets in this repo**, but that
approach is blocked by **GitHub immutable releases**: assets can't be
updated/clobbered after creation, and once the `nvd-mirror` tag is used
by an immutable release it's poisoned (can't recreate). The in-repo
`nvd-mirror-refresh.yml` also can't run — a new workflow is only
schedulable/dispatchable from the default branch, and `main` is still
the pre-cutover Debian world.

So as merged, `release/0.4.0` points `vulnix --mirror` at a
release-asset URL that can't exist → the gate would fail.

## Change

- **Remove** the in-repo `nvd-mirror-refresh.yml`.
- Point `vulnix --mirror` (in `security-scan.yml` and the `release.yml`
`vulnix-gate`) at the **dedicated public mirror**
[`vig-os/nvd-mirror`](https://github.com/vig-os/nvd-mirror), served on
GitHub Pages: `https://vig-os.github.io/nvd-mirror/`.
- Update docs + CHANGELOG.

The dedicated repo owns the one job that talks to NVD (its default
branch, so it schedules/dispatches immediately — no cutover dependency).
It is **already live and serving** all 7 feeds
(`nvdcve-2.0-{2021..2026}.json.gz` + `modified`, 117 MB, HTTP 200 +
valid gzip), bootstrapped from a known-good local copy.

## Test plan

- [x] `https://vig-os.github.io/nvd-mirror/nvdcve-2.0-*.json.gz` → 200,
valid gzip (all 7).
- [x] Dispatch `security-scan.yml` on this branch → **passed in 97 s**
via the mirror ([run
28792515788](https://github.com/vig-os/devcontainer/actions/runs/28792515788));
`NVD_MIRROR=https://vig-os.github.io/nvd-mirror/`, gate green, no
`nvd.nist.gov` cold-crawl.
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