fix(cve): KEV from CISA's GitHub mirror, exploitation cached per source (#493) (#525)
CI / Check (push) Skipped
CI / Detect Changes (push) Successful in 3s
CI / Deploy Dashboard (push) Skipped
CI / Deploy MCP (push) Skipped
CI / Deploy Docs (push) Successful in 1m10s
CI / Deploy Agent (push) Successful in 5m6s

This commit was merged in pull request #525.
This commit is contained in:
sharang committed 2026-10-06 19:02:52 +00:00
1 parent 85aff4cd2c
commit e1bf9e861c
3 files changed
+431 -143

No files matched your search

+3 -3
View File
@@ -196,7 +196,7 @@ Every CVE alert is enriched with what is known about its exploitation, after the
| Source | What it says | Licence | How it is read |
|---|---|---|---|
| [CISA Known Exploited Vulnerabilities (KEV)](https://www.cisa.gov/known-exploited-vulnerabilities-catalog) | the CVE is exploited in the wild; the date CISA added it; known use in ransomware campaigns | CC0 1.0 | the whole catalog (one JSON file, about 2 MB), at most once a day |
| [CISA Known Exploited Vulnerabilities (KEV)](https://www.cisa.gov/known-exploited-vulnerabilities-catalog) | the CVE is exploited in the wild; the date CISA added it; known use in ransomware campaigns | CC0 1.0 | the whole catalog (one JSON file, about 2 MB), at most once a day: from CISA's mirror on GitHub ([cisagov/kev-data](https://github.com/cisagov/kev-data)), else from `www.cisa.gov`, which refuses many datacenter addresses |
| [FIRST EPSS](https://www.first.org/epss) | the probability that the CVE is exploited in the next 30 days, and its percentile | free to use; FIRST asks for attribution | FIRST's API, up to 50 CVE ids per request |
| [CISA Vulnrichment](https://github.com/cisagov/vulnrichment) | the SSVC decision point *Exploitation* (`none`, `poc`, `active`) | CC0 1.0 | the CVE's record in the GitHub repository (`<year>/<n>xxx/CVE-….json`); a CVE CISA has not rated is a 404 |
@@ -386,8 +386,8 @@ Every connection the agent opens, in one place. **Guarded** means: the HTTP clie
|---|---|---|---|---|---|
| `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) |
| `www.cisa.gov` (`/sites/default/files/feeds/known_exploited_vulnerabilities.json`) | nothing (a GET of the public 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 | `CVE_EXPLOIT_LOOKUP=false` |
| `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` |
| `api.nuget.org` (registration, catalog) | NuGet package ids and versions, not for ids a `nuget.config` routes to another feed | `pipeline/sbom/nuget_license.rs` | guarded | 10 s per request, 5 s connect, body ≤ 2 MiB, 8 at once, 60 s and 300 uncached packages per scan | `NUGET_LICENSE_LOOKUP=false` |
| `registry.npmjs.org` | npm package names and versions, not for a registry or scope `.npmrc`/`.yarnrc.yml` routes elsewhere | `pipeline/sbom/registry_license.rs` | guarded | as nuget.org (bounds per scan; answers cached for all tenants) | `REGISTRY_LICENSE_LOOKUP=false` |
@@ -64,7 +64,7 @@ and the same agent image (`8ea3731`) locally with the fixtures of this plan.
| 16 | PASS | Locally, `Serilog 2.10.0` from `App/App.csproj (transitive, nuget.org)`, Apache-2.0; one `sbom_dependencies` entry naming only the private-feed project; log line present. |
| 17 | PASS | Locally, the npm and Maven components get licences; with an `.npmrc` scope and a private Maven repository `@corp/util` and every Maven component stay without one, log `Maven licenses not looked up`. The fixture path is now `fixtures/nightly/eco/js-npm-lock-v3`. |
| 18 | PASS | Stage Mongo: findings with `legacy_fingerprints` kept their rows. |
| 19 | PASS / NEEDS USER | Locally, CVE-2021-44228 has KEV (ransomware), EPSS 0.99999, SSVC active. Stage fills `cve_exploitation` with the daily CVE monitor (00:00). Look at: the badges. |
| 19 | FAIL, fixed / NEEDS USER | Locally, CVE-2021-44228 has KEV (ransomware), EPSS 0.99999, SSVC active. On stage `www.cisa.gov` answers 403 to the datacenter, so KEV failed and, since a CVE was only cached when all three sources answered, `cve_exploitation` stayed empty. Fixed: KEV from CISA's GitHub mirror, each source cached on its own. Look at: the badges. |
| 20 | NEEDS USER | Edit and re-export a PLC project, then rescan. |
| 21 | PASS / NEEDS USER | Locally, the hardening, HEX, signature and reference texts are as written, and the ASLR/RELRO findings have cra-ai-1 and the HEX finding cra-ai-6. Six files group into one inventory finding (#477), so the check now uploads five. Look at: a native unsigned DLL. |
| 22 | PASS | Locally: 422 without a justification or action; OpenVEX, CycloneDX VEX and the SBOM validate against the schemas; after the update to log4j 2.17.1 the fixed CVEs are set `fixed` by the scan, and a person's `not_affected` is kept. |
@@ -405,8 +405,11 @@ target with history (findings, at least one marked by a person, issues).
- **Log:** `CVE exploitation (KEV, EPSS, SSVC)` with `counts` (`cves`,
`cached`, `kev`, `epss`, `failed: []`); the second scan reports every CVE
as `cached` and makes no request to the three sources. Mongo:
`<prefix>__admin.cve_exploitation` has one row per CVE,
`<prefix>__admin.cisa_kev` one row.
`<prefix>__admin.cve_exploitation` has one row per CVE (`epss_answered`,
`ssvc_answered`), `<prefix>__admin.cisa_kev` one row. No `KEV catalog not
read` line: KEV comes from CISA's mirror on GitHub (`cisagov/kev-data`),
since `www.cisa.gov` answers 403 to stage and prod. A source that fails
keeps the others' answers; the next scan asks only that source.
- **Switch:** `CVE_EXPLOIT_LOOKUP=false` stops the lookups;
`CVE_ISSUE_EPSS_PERCENTILE` (default `0.95`, `off`) sets the EPSS step-up.
- **[visible]** KEV and EPSS badges on the SBOM page; CVE issues for KEV