feat(cve): the daily monitor re-checks NVD/CPE-only components incrementally (#558)
CI / Check (push) Skipped
CI / Detect Changes (push) Successful in 6s
CI / Deploy Dashboard (push) Skipped
CI / Deploy MCP (push) Skipped
CI / Deploy Docs (push) Successful in 1m19s
CI / Deploy Agent (push) Successful in 9m5s

This commit was merged in pull request #558.
This commit is contained in:
sharang committed 2026-10-09 18:19:19 +00:00
1 parent ba499d14e4
commit 57b5aaeb97
12 files changed
+1772 -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
@@ -140,8 +140,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
+2 -2
View File
@@ -199,7 +199,7 @@ to the SBOM with the package source `embedded` and matched against NVD by CPE.
Prüfwerk matches every SBOM component directly against two public vulnerability sources (no separate scanner binary):
- [OSV.dev](https://osv.dev/) -- batch queried by package URL (purl) for ecosystem advisories (npm, PyPI, crates.io, Go, Maven, ...)
- [NVD](https://nvd.nist.gov/) -- queried per CVE for the CVSS v3.1 base score, and by CPE for components outside a package ecosystem: the CODESYS runtime found in PLC projects and the embedded libraries above. All CVEs of the product are fetched and their affected version ranges compared with the version in use.
- [NVD](https://nvd.nist.gov/) -- queried per CVE for the CVSS v3.1 base score, and by CPE for components outside a package ecosystem: the CODESYS runtime found in PLC projects and the embedded libraries above, and the Yocto recipes. All CVEs of the product are fetched and their affected version ranges compared with the version in use. Between scans the CVE monitor asks NVD only for the CVEs changed since its last run (one time-window listing for all tenants, resumed where a run stopped) and matches them against the same components with the same rules.
Matches are stored as CVE alerts with CVSS scores and re-checked daily, so newly published CVEs against an unchanged dependency still raise a notification.
@@ -400,7 +400,7 @@ Every connection the agent opens, in one place. **Guarded** means: the HTTP clie
| Destination | What is sent | Module | Guard | Limits | Switch |
|---|---|---|---|---|---|
| `api.osv.dev` (`/v1/querybatch`, `/v1/vulns/{id}`) | purls of SBOM components, advisory ids | `pipeline/cve.rs` | guarded | 10 s per request, 5 s connect, body ≤ 16 MiB, 8 advisory reads at once | none (CVE stage) |
| `services.nvd.nist.gov` (`/rest/json/cves/2.0`) | CVE ids (CVSS score), CPE product prefixes (CODESYS, embedded libraries) | `pipeline/cve.rs`, `pipeline/nvd_cpe.rs` | guarded | 30 s per request, 5 s connect, body ≤ 16 MiB, 3 retries after 6/12/24 s, answers cached 6 h | `NVD_API_KEY` (optional, raises NVD's rate limit) |
| `services.nvd.nist.gov` (`/rest/json/cves/2.0`) | CVE ids (CVSS score), CPE product prefixes (CODESYS, embedded libraries, Yocto recipes); for the CVE monitor a time window (`lastModStartDate`/`lastModEndDate`, at most 120 days, 500 CVEs per page) | `pipeline/cve.rs`, `pipeline/nvd_cpe.rs`, `pipeline/nvd_monitor.rs` | guarded | 30 s per request, 5 s connect, body ≤ 16 MiB, 3 retries after 6/12/24 s, answers cached 6 h; the monitor paced to 0.6 s (key) / 6 s apart, 10 min per run, resumed by the next run | `NVD_API_KEY` (optional, raises NVD's rate limit); `NVD_MONITOR=off` stops the monitor's NVD pass |
| `raw.githubusercontent.com` (`/cisagov/kev-data/develop/known_exploited_vulnerabilities.json`), else `www.cisa.gov` (`/sites/default/files/feeds/known_exploited_vulnerabilities.json`) | nothing (a GET of the public KEV catalog) | `pipeline/cve_enrichment.rs` | guarded | 10 s per request, 5 s connect, body ≤ 16 MiB; at most once a day (cached for all tenants) | `CVE_EXPLOIT_LOOKUP=false` |
| `api.first.org` (`/data/v1/epss`) | CVE ids of the alerts | `pipeline/cve_enrichment.rs` | guarded | as above, 50 CVE ids per request, 500 uncached CVEs and 2 min per scan; answers cached a day per source (EPSS and Vulnrichment apart, so one that fails is asked again alone) | `CVE_EXPLOIT_LOOKUP=false` |
| `raw.githubusercontent.com` (`/cisagov/vulnrichment/develop/…`) | CVE ids of the alerts (in the path) | `pipeline/cve_enrichment.rs` | guarded | as above, 8 at once | `CVE_EXPLOIT_LOOKUP=false` |