feat(csaf): read vendor CSAF advisories for matching (#515, part A) #518

Merged
sharang merged 1 commits from feat/515-csaf-parse into main 2026-10-06 16:11:08 +00:00
Owner

Part A of #515: reading vendor CSAF advisories for matching. This is offline core code; ingest (B) and matching (C) follow.

What

  • compliance_core::csaf_ingest::parse turns a CSAF 2.0 document into an Advisory:
    • Products:
      • from the product tree, where each product_version / product_version_range branch inherits vendor, family and name from its ancestors;
      • from full_product_names;
      • from relationship products (installed_on, default_component_of).
        Each carries its exact version or vers range, CPE, purl, and order numbers (Siemens model_numbers, skus). Names are normalised for comparison: case and whitespace ("CODESYS Gateway ").
    • Vulnerabilities: CVE, title, description, the highest CVSS score and severity, all eight product_status keys grouped (affected / fixed / not affected / under investigation / recommended), and the remediations with category, details, url and products.
    • Advisory: id, title, publisher, TLP label, current release date, and the readable page: the first self reference that isn't the JSON or PDF. Siemens' terms require that link on every redistribution.
    • Helpers: AdvisoryProduct::covers(name, version) and Advisory::fixed_versions(vuln, name) for part C.
  • compliance_core::version:
    • cmp_dotted moves here from nvd_cpe.rs, which now imports it.
    • Vers parses and evaluates purl-spec vers ranges: = != < <= > >= *, |-joined, evaluated as intervals. Schemes generic/intdot/semver/all compare as dotted versions.

Providers (for B, verified)

  • CERT@VDE: one trusted provider per vendor at <vendor>.csaf-tp.certvde.com: codesys, wago, phoenixcontact, pilz, festo, helmholz, weidmueller, murrelektronik, janitza, beckhoff, lenze, turck, hilscher. There's no aggregator.
  • Siemens ProductCERT: 841 advisories, identified by MLFB and vers:intdot.
  • CISA OT: 3,950 advisories, mostly without identifiers. Off by default, per the decision.

Tests

  • Fixtures: CISA ICSA-26-260-07 (public), Siemens SSA-240718 (redistribution with link, see README), and a synthetic VDE-shaped advisory, since VDE states only a disclaimer.
  • vers cases taken from all three providers: closed range, open above, open below, two intervals, !=, exact, *.
  • An #[ignore] test parses the newest live advisory of CODESYS, Siemens and CISA; it passes.
  • The NVD matcher tests still pass.
  • clippy -D warnings for core and agent.

No test plan check: nothing visible yet. B/C add one. Stage only; no tag.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p

Part A of #515: reading vendor CSAF advisories for matching. This is offline core code; ingest (B) and matching (C) follow. ## What - **`compliance_core::csaf_ingest::parse`** turns a CSAF 2.0 document into an `Advisory`: - **Products:** - from the product tree, where each `product_version` / `product_version_range` branch inherits vendor, family and name from its ancestors; - from `full_product_names`; - from relationship products (`installed_on`, `default_component_of`). Each carries its exact version or `vers` range, CPE, purl, and order numbers (Siemens `model_numbers`, `skus`). Names are normalised for comparison: case and whitespace (`"CODESYS Gateway "`). - **Vulnerabilities:** CVE, title, description, the highest CVSS score and severity, all eight `product_status` keys grouped (affected / fixed / not affected / under investigation / recommended), and the remediations with category, details, url and products. - **Advisory:** id, title, publisher, TLP label, current release date, and the **readable page**: the first `self` reference that isn't the JSON or PDF. Siemens' terms require that link on every redistribution. - **Helpers:** `AdvisoryProduct::covers(name, version)` and `Advisory::fixed_versions(vuln, name)` for part C. - **`compliance_core::version`:** - `cmp_dotted` moves here from `nvd_cpe.rs`, which now imports it. - `Vers` parses and evaluates purl-spec `vers` ranges: `= != < <= > >= *`, `|`-joined, evaluated as intervals. Schemes generic/intdot/semver/all compare as dotted versions. ## Providers (for B, verified) - **CERT@VDE:** one trusted provider per vendor at `<vendor>.csaf-tp.certvde.com`: codesys, wago, phoenixcontact, pilz, festo, helmholz, weidmueller, murrelektronik, janitza, beckhoff, lenze, turck, hilscher. There's no aggregator. - **Siemens ProductCERT:** 841 advisories, identified by MLFB and `vers:intdot`. - **CISA OT:** 3,950 advisories, mostly without identifiers. Off by default, per the decision. ## Tests - Fixtures: CISA ICSA-26-260-07 (public), Siemens SSA-240718 (redistribution with link, see README), and a synthetic VDE-shaped advisory, since VDE states only a disclaimer. - `vers` cases taken from all three providers: closed range, open above, open below, two intervals, `!=`, exact, `*`. - An `#[ignore]` test parses the newest live advisory of CODESYS, Siemens and CISA; it passes. - The NVD matcher tests still pass. - clippy `-D warnings` for core and agent. No test plan check: nothing visible yet. B/C add one. Stage only; no tag. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang added 1 commit 2026-10-06 15:58:44 +00:00
feat(csaf): read vendor CSAF advisories for matching (#515, part A)
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 12m0s
ab0c3350dd
- compliance_core::csaf_ingest: a CSAF 2.0 advisory read into what matching
  needs. Products from the product tree (vendor, family, name inherited by
  each product_version / product_version_range branch), full_product_names
  and relationships, with their exact version or vers range, CPE, purl and
  order numbers (Siemens model_numbers, skus). Per vulnerability: CVE,
  title, description, highest CVSS score and severity, affected / fixed /
  not affected / under investigation / recommended products (all eight
  product_status keys) and the remediations. The advisory's readable page
  (a self reference that is not the JSON or PDF), the link Siemens' terms
  ask for; TLP label. AdvisoryProduct::covers(name, version) and
  Advisory::fixed_versions for matching.
- compliance_core::version: cmp_dotted moves here from nvd_cpe.rs (shared),
  and a vers range parser per the purl spec (=, !=, <, <=, >, >=, *, |-joined
  intervals; generic/intdot/semver/all compared as dotted versions).
- Fixtures: CISA ICSA-26-260-07 (public), Siemens SSA-240718 (terms allow
  redistribution with the link, in the README), a synthetic VDE-shaped
  advisory; an #[ignore] test reads the newest live advisory of CODESYS
  (CERT@VDE), Siemens and CISA.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang merged commit b4dc84671f into main 2026-10-06 16:11:08 +00:00
Sign in to join this conversation.