feat(scan): record which components each scan added, updated or removed (#974) #975

Merged
sharang merged 1 commits from feat/974-component-changes into main 2026-11-11 10:18:02 +00:00
Owner

Summary

Closes #974. Part of #955.

  • Each scan now records the components it added, updated (old → new version) or removed. The code SBOM, the CODESYS libraries and the firmware components are each compared before their part is replaced. The results go on the scan run (component_changes), capped at 5000. Recording is best effort: if it fails, the failure is logged and the scan goes on.
  • GET /api/v1/targets/{id}/scan-changes returns per scan components: one row per changed component, with the CVEs it brought and took away. A CVE that came or went while its component stayed the same is a "neue Advisory" / "Advisory entfällt" row.
  • The Verlauf drill-down shows the component table from the mockup above the CVE list. Scans from before this change keep their CVE list and get a note that their component changes were not recorded.
  • Docs: the Verlauf section of guide/repositories.md.

Test plan

  • cargo fmt --all --check, and clippy with the CI flags (core, agent, dashboard server and web)
  • core lib tests (the diff and the row matching)
  • dashboard tests
  • agent lib tests against MongoDB, including the new recorder test
  • tests/scan_changes.rs against MongoDB, with component rows added
  • local run with seeded data: the drill-down checked against the mockup

🤖 Generated with Claude Code

## Summary Closes #974. Part of #955. - Each scan now records the components it added, updated (old → new version) or removed. The code SBOM, the CODESYS libraries and the firmware components are each compared before their part is replaced. The results go on the scan run (`component_changes`), capped at 5000. Recording is best effort: if it fails, the failure is logged and the scan goes on. - `GET /api/v1/targets/{id}/scan-changes` returns per scan `components`: one row per changed component, with the CVEs it brought and took away. A CVE that came or went while its component stayed the same is a "neue Advisory" / "Advisory entfällt" row. - The Verlauf drill-down shows the component table from the mockup above the CVE list. Scans from before this change keep their CVE list and get a note that their component changes were not recorded. - Docs: the Verlauf section of `guide/repositories.md`. ## Test plan - [x] `cargo fmt --all --check`, and clippy with the CI flags (core, agent, dashboard server and web) - [x] core lib tests (the diff and the row matching) - [x] dashboard tests - [x] agent lib tests against MongoDB, including the new recorder test - [x] `tests/scan_changes.rs` against MongoDB, with component rows added - [x] local run with seeded data: the drill-down checked against the mockup 🤖 Generated with [Claude Code](https://claude.com/claude-code)
sharang added 1 commit 2026-11-11 06:38:26 +00:00
feat(scan): record which components each scan added, updated or removed (#974)
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Agent integration (pull_request) Successful in 4m41s
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 20m32s
bb85e6996e
Before a stage replaces its part of a target's SBOM (the code SBOM, the
CODESYS libraries, the firmware components), the entries it replaces are
compared with the new ones and the changes are added to the scan run
(`component_changes`, at most 5000; `None` on runs from before). A
component is its package manager and name; one version before and one
after is an update, otherwise each new version an addition and each gone
one a removal.

The Verlauf API joins them with the scan's CVEs: a new CVE goes with the
component now at its version, a gone one with the component that was at
its version, and what no change explains is an advisory row. The scan's
drill-down shows the mockup's table (neu / aktualisiert / entfernt / neue
Advisory, version before → after, CVEs +n −m) above the CVE list; scans
from before say the components were not recorded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sharang merged commit f5697ff21d into main 2026-11-11 10:18:02 +00:00
Sign in to join this conversation.