feat(sbom): a supplier's SBOM of a bought-in component is scanned for known CVEs (#1025) #1030

Merged
sharang merged 1 commits from feat/supplier-sbom-import into main 2026-11-16 22:23:22 +00:00
Owner

The first part of #1025 (epic #1029): a supplier's SBOM of a bought-in component is uploaded and scanned for known CVEs. Supplier CSAF providers and supplier VEX follow in their own PRs.

What changes

  • A new artifact kind, supplier_sbom. It is uploaded through POST /api/v1/targets/{id}/artifacts/upload (kind=supplier_sbom).
    • Formats: CycloneDX 1.4–1.6 (JSON or XML) and SPDX 2.3 JSON.
    • The reader is pipeline/sbom/supplied.rs. It takes name (with group), version, purl (canonical, as Syft's), CPE and licence. Nested components are read; files and data, and the described product (metadata.component, documentDescribes), are left out.
  • Scans.
    • The scan matrix plans SBOM and CVE for every target type that carries a supplier SBOM.
    • A target without code runs the stages over an empty tree, as a Yocto build output does, so OSV, NVD, KEV/EPSS, CSAF (by purl), the VEX workflow, CVE groups and ENISA drafts all apply.
    • A target with code reads its supplier SBOMs as well.
  • Untrusted input.
    • Capped at 20 MiB and 100 000 components, and read on a blocking thread.
    • XML is read with roxmltree, which refuses a DTD, so no entity is resolved (tested).
  • Never an empty SBOM by mistake.
    • At upload, a file that is no such SBOM, an SBOM with no components, or SPDX 3.0 is refused: 422 {"error": "…"} with the reason. Over 20 MiB is 413. The file is deleted.
    • At scan time, a supplier SBOM that cannot be read fails the run instead of reading as empty.
  • A component without a purl is reported as not checked (Nicht ausgeführt), not as free of CVEs. The new CVE test found this gap.
  • A new supplier SBOM replaces the target's previous one and its file: first the new one is pushed, then the old ones are pulled. If the pull fails, both stay, and nothing is lost.
  • The upload's OpenAPI description lists the new kind, the 422 and the 413.
  • Docs: the SBOM guide has a "supplier SBOM" section.

Note

  • Until #1015 lands, a new supplier SBOM version from which a CVE disappeared goes through today's resolve_gone, which states VEX fixed for it. That is the #994 behaviour, now also for supplier components. It goes away with #1015.
  • No dashboard change. The new kind compiles there, but the wizard does not offer it yet. That needs a mockup first. Until then, upload through the API.

Checks

  • cargo fmt --check passes, and clippy passes with the CI flags for core, agent, dashboard (server and web) and MCP.
  • Core: tests pass. A new scan-matrix test covers every target type.
  • Agent: 1089 unit tests pass.
    • The reader has 6 tests: CycloneDX JSON/XML equivalence, SPDX 2, DTD refused, unknown formats, empty.
    • The CVE test uses a stand-in OSV, never the live one.
  • Every integration test binary passes against Mongo 7, including three new upload tests: kept and planned, refused with the reason, replaced.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9

The first part of #1025 (epic #1029): a supplier's SBOM of a bought-in component is uploaded and scanned for known CVEs. Supplier CSAF providers and supplier VEX follow in their own PRs. ## What changes - **A new artifact kind, `supplier_sbom`.** It is uploaded through `POST /api/v1/targets/{id}/artifacts/upload` (`kind=supplier_sbom`). - Formats: CycloneDX 1.4–1.6 (JSON or XML) and SPDX 2.3 JSON. - The reader is `pipeline/sbom/supplied.rs`. It takes name (with group), version, purl (canonical, as Syft's), CPE and licence. Nested components are read; files and data, and the described product (`metadata.component`, `documentDescribes`), are left out. - **Scans.** - The scan matrix plans SBOM and CVE for every target type that carries a supplier SBOM. - A target without code runs the stages over an empty tree, as a Yocto build output does, so OSV, NVD, KEV/EPSS, CSAF (by purl), the VEX workflow, CVE groups and ENISA drafts all apply. - A target with code reads its supplier SBOMs as well. - **Untrusted input.** - Capped at 20 MiB and 100 000 components, and read on a blocking thread. - XML is read with roxmltree, which refuses a DTD, so no entity is resolved (tested). - **Never an empty SBOM by mistake.** - At upload, a file that is no such SBOM, an SBOM with no components, or SPDX 3.0 is refused: 422 `{"error": "…"}` with the reason. Over 20 MiB is 413. The file is deleted. - At scan time, a supplier SBOM that cannot be read fails the run instead of reading as empty. - **A component without a purl** is reported as not checked (`Nicht ausgeführt`), not as free of CVEs. The new CVE test found this gap. - **A new supplier SBOM replaces the target's previous one and its file:** first the new one is pushed, then the old ones are pulled. If the pull fails, both stay, and nothing is lost. - The upload's OpenAPI description lists the new kind, the 422 and the 413. - Docs: the SBOM guide has a "supplier SBOM" section. ## Note - **Until #1015 lands,** a new supplier SBOM version from which a CVE disappeared goes through today's `resolve_gone`, which states VEX `fixed` for it. That is the #994 behaviour, now also for supplier components. It goes away with #1015. - **No dashboard change.** The new kind compiles there, but the wizard does not offer it yet. That needs a mockup first. Until then, upload through the API. ## Checks - `cargo fmt --check` passes, and clippy passes with the CI flags for core, agent, dashboard (server and web) and MCP. - Core: tests pass. A new scan-matrix test covers every target type. - Agent: 1089 unit tests pass. - The reader has 6 tests: CycloneDX JSON/XML equivalence, SPDX 2, DTD refused, unknown formats, empty. - The CVE test uses a stand-in OSV, never the live one. - Every integration test binary passes against Mongo 7, including three new upload tests: kept and planned, refused with the reason, replaced. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang added 1 commit 2026-11-16 22:01:42 +00:00
feat(sbom): a supplier's SBOM of a bought-in component is scanned for known CVEs (#1025)
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 / Agent integration (pull_request) Successful in 5m0s
CI / Check (pull_request) Successful in 20m53s
0ab8fc186e
A component bought in without its source often comes with only its
supplier's SBOM. It can now be uploaded to the component's target as a
`supplier_sbom` artifact: CycloneDX 1.4-1.6 (JSON or XML) or SPDX 2.3
JSON. A target needs no code for it; the scan matrix plans the SBOM and
CVE scans for every target type that carries one, and the no-code arm
runs the stages over an empty tree as for a Yocto build output. Its
components go through OSV, NVD, KEV/EPSS, the CSAF index and the VEX
workflow like those read from code.

- Read defensively: capped at 20 MiB and 100 000 components, XML
  without a DTD (roxmltree refuses one), nested components read, the
  described product left out.
- Refused at upload with the reason (422 `{"error": …}`): not such an
  SBOM, no components, SPDX 3.0. One that cannot be read at scan time
  fails the run; neither ever reads as an empty SBOM.
- A component without a purl is reported as not checked, not as free
  of CVEs.
- A new supplier SBOM replaces the target's previous one, and its file.
- Docs: the SBOM guide describes supplier SBOMs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang merged commit 55091fe02e into main 2026-11-16 22:23:22 +00:00
sharang deleted branch feat/supplier-sbom-import 2026-11-16 22:23:22 +00:00
Sign in to join this conversation.