feat(csaf): index vendor CSAF advisories daily (#515, part B)
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 8m53s

- pipeline::csaf_feed: providers from PW_CSAF_PROVIDERS (default: CERT@VDE's
  13 vendor providers at <vendor>.csaf-tp.certvde.com and Siemens
  ProductCERT; `cisa` adds CISA's OT feed, last two years only; `off`).
  Per provider: metadata -> TLP:WHITE ROLIE feeds -> entries new or newer
  than stored -> fetch, SHA-512 checked against the published .sha512
  (mismatch: not stored; no hash: stored, counted unverified), read with
  csaf_ingest, stored in the admin db's csaf_advisories (shared by all
  tenants; public data). PGP signatures are not checked.
- Bounded: 400 advisories and 15 min per run, 4 at once, newest first;
  guarded client (PublicHttp), 60 s per request, 16 MiB per body.
- Scheduler: daily (CSAF_FEED_SCHEDULE, default 03:30) and once two minutes
  after start. Scans never fetch.
- Tests: fake provider (WHITE only, hash check, delta, bounds), provider
  setting; an #[ignore] live test reads CODESYS and Siemens.
- Docs: tools reference (providers, terms, settings) and egress table; test
  plan check.

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-06 18:23:31 +02:00
1 parent dc9ca8dcd8
commit bda5fc997f
5 files changed
+888

No files matched your search

+30
View File
@@ -210,6 +210,35 @@ The answers are attached to the alert (`exploitation`) and to the SBOM's referen
**Registry metadata (#508):** the nuget.org, npm and Maven lookups also fetch each package's project URL (the SBOM's component creator), so they now ask for packages that already have a license too, once per package version and within the same per-scan bounds; the cache fills the rest over later scans. Only URLs are kept, never maintainer names or emails. GitHub, Go-module and Swift purls give their repository page without any request.
## Vendor CSAF advisories (#515)
Industrial vendors publish their security advisories in CSAF 2.0. Prüfwerk
keeps an index of them, shared by all tenants (admin database,
`csaf_advisories`), refreshed daily and once after the agent starts:
| Provider | Advisories | Default |
|---|---|---|
| CERT@VDE's vendor providers (`<vendor>.csaf-tp.certvde.com`): CODESYS, WAGO, Phoenix Contact, Pilz, Festo, Helmholz, Weidmüller, Murrelektronik, Janitza, Beckhoff, Lenze, TURCK, Hilscher | each vendor's | on |
| Siemens ProductCERT | about 840 | on |
| CISA ICS (OT) | about 3,950; the last two years are read | off |
Only the TLP:WHITE feeds are read. An advisory is fetched when it is new or
newer than the stored one; its SHA-512 must match the hash file the provider
publishes beside it (an advisory without one is stored and counted as
unverified); the PGP signatures are not checked. A run fetches at most 400
advisories within 15 minutes, newest first, so the first fill spans a few
runs. Scans never fetch; they match the target's components against the index
(#515, part C).
`PW_CSAF_PROVIDERS` chooses the providers: unset or `default` (CERT@VDE's
vendors and Siemens), `off`, or a comma list of `default`, `siemens`, `cisa`
and vendor names (`codesys,wago`). `CSAF_FEED_SCHEDULE` sets when the daily
run starts (cron with seconds, default `0 30 3 * * *`).
**Terms:** Siemens allows using and redistributing its advisories with a link
to the original, which every alert carries; CISA's are US government works;
CERT@VDE's vendors publish theirs with a liability disclaimer.
## nuget.org -- NuGet Licenses
Licenses of NuGet packages that no `.nuspec` in the tree gives, and the project URL (`projectUrl`) of every package, are read from the [nuget.org registration API](https://learn.microsoft.com/nuget/api/registration-base-url-resource) (`api.nuget.org`). Only the package id and version are sent, never for an id a `nuget.config` routes to another feed (see [.NET projects](/guide/dotnet-en)). The lookup is bounded per scan (8 requests at once, 10 s per request, 60 s and 300 uncached packages in total); answers are cached for all tenants. Set `NUGET_LICENSE_LOOKUP=false` to keep the agent from contacting nuget.org.
@@ -352,6 +381,7 @@ Every connection the agent opens, in one place. **Guarded** means: the HTTP clie
| `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` |
| `repo1.maven.org`, `dl.google.com` (POMs) | Maven group, artifact and version (and parent POMs), not when the build names a non-public repository | `pipeline/sbom/registry_license.rs` | guarded | as nuget.org | `REGISTRY_LICENSE_LOOKUP=false` |
| `<vendor>.csaf-tp.certvde.com` (CERT@VDE's vendor providers), `cert-portal.siemens.com` (Siemens ProductCERT); with `cisa`: `www.cisa.gov`, `raw.githubusercontent.com` | nothing (GETs of public advisories) | `pipeline/csaf_feed.rs` | guarded | 60 s per request, body ≤ 16 MiB, 4 at once, 400 advisories and 15 min per run; daily and once after start | `PW_CSAF_PROVIDERS=off` |
| Package registries (Go proxy, npm, PyPI, Maven Central) | package names and versions | Syft (`pipeline/sbom/syft.rs`, remote license lookups) and lockfile generation (`npm`, `cargo`, `pip-compile` in `pipeline/sbom/mod.rs`) | not guarded: subprocesses with their own HTTP | Syft 10 min per scan | lockfile generation follows the execution policy |
### Tenant-chosen addresses