feat(cve): the daily monitor re-checks NVD/CPE-only components incrementally
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 10m4s

The CVE monitor asked only OSV, so Yocto recipes, header-detected embedded
libraries and the CODESYS runtime were re-matched in NVD only by a scan.
A new NVD pass (pipeline/nvd_monitor.rs) reads NVD's lastMod listing
(lastModStartDate/lastModEndDate, windows of at most 120 days, 500 CVEs per
page, one listing for all tenants) and matches the changed CVEs locally with
the scan's rules (virtualMatchString semantics, marker, version range).

- Cursor in the admin DB (done_until + open window/startIndex/total): a run
  stopped by its 10-minute budget, an NVD or a database error continues
  there; a listing that shrinks while paged is re-read from earlier.
- Paced with nvd_cpe::request_interval (0.6 s with NVD_API_KEY, 6 s
  without), reusing the nvd_cpe client (fetch with retries, factored out).
- Matches become the scan's CveAlert (purl, cvss, repo_id), stored with
  $setOnInsert on (cve_id, repo_id) (vex_lifecycle::store_monitored, now
  shared with the OSV pass), VEX attached, notify_new_cves, and CVE issues
  for new alerts via the shared CveIssueSync (incomplete: closes nothing).
- One INFO line per tenant with counts; NVD_MONITOR=off turns it off
  (default on).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
This commit is contained in:
Sharang ParnerkarandClaude Opus 5.5 committed 2026-10-09 19:44:30 +02:00
1 parent 42b25719ec
commit 3e17163a6e
12 files changed
+1665 -117

No files matched your search

+21 -2
View File
@@ -96,8 +96,27 @@ compared with the version in use. OSV publishes no advisories for CocoaPods, so
pods are not matched. Components that could not be matched are listed on the
scan run under **CVE-Abgleich unvollständig**.
Known components are re-checked daily, so a CVE published against an unchanged
component still raises an alert.
Known components are re-checked between scans (the CVE monitor, hourly by
default, `CVE_MONITOR_SCHEDULE`), so a CVE published against an unchanged
component still raises an alert:
- **Components with a package identifier** are asked of OSV again.
- **Components only NVD knows** (Yocto recipes by their CPE, the libraries
found by their headers, the CODESYS runtime) are re-checked incrementally:
NVD is asked which CVEs it published or changed since the last run, and
those are matched against the components with the scan's rules (product,
version range). A few requests a day cover every tenant. The requests are
paced to NVD's rate limit (with the deployment's NVD API key 50 per 30
seconds, without 5), and a run asks for at most 10 minutes; what it did not
reach, the next run reads, so no change is skipped. The first run reads the
last 7 days. `NVD_MONITOR=off` turns this part off (on by default).
A match raises the same CVE alert as a scan's, at most one per CVE and
target. A vulnerability that is "Not affected" or "Fixed" (see
[Assessing vulnerabilities](./vex-en.md)) raises no notification, and a
critical or high one of a managed repository gets its tracker issue as after
a scan. The monitor only adds: alerts no longer found are resolved by the next
complete scan.
## Packages Tab
+5 -2
View File
@@ -139,8 +139,11 @@ without a release version, a failed lookup, and recipes the scan's NVD time
budget (10 minutes) did not reach are listed under **CVE-Abgleich
unvollständig**. The requests are paced to NVD's rate limit: 50 per 30 seconds
with the deployment's NVD API key, 5 without; an answer from the last 6 hours
is reused, so the next scan gets further. The daily CVE re-check covers OSV
only and does not yet re-match recipes in NVD; a scan does.
is reused, so the next scan gets further. Between scans the CVE monitor
re-checks the recipes too (see
[Known vulnerabilities](/guide/sbom#known-vulnerabilities)): a CVE NVD
publishes or changes for a recipe's product raises an alert without a new
scan.
**What the recipe says about a CVE becomes its VEX statement**, made by the
scan, with the recipe (or patch) and its text as the impact statement, so it is