fix(scans): stop offering scans nothing runs, and record them (#319) #328

Merged
sharang merged 1 commits from feat/honest-scan-types into main 2026-09-22 21:05:32 +00:00
Owner

Closes #319. Part of #309.

The problem

FirmwareStatic, MobileStatic and ContainerScan appeared in the applicability matrix and in scan plans, but no pipeline stage runs any of them. A firmware image, an APK or a container image was accepted by the wizard, planned, and then passed over in silence: the run completed with no findings, which a customer reads as "we looked and it's clean" when nothing looked at all. The Sbom and Cve rules bound to a firmware image had the same problem.

The fix

A matrix rule can be marked unavailable, carrying the reason that covers the ground instead:

  • firmware images are not unpacked or analysed yet: scan the firmware sources, or import a Firmwerk bundle for the image
  • no SBOM is extracted from a firmware image yet: …
  • CVE matching needs an SBOM, and none is extracted from a firmware image yet
  • mobile packages are not analysed yet: only the app's source code is scanned
  • container images are not scanned yet: only the sources that build them are

Such a scan is never pre-selected and reads as blocked to every client, so the wizard stops offering it. When the target does carry the artifact the scan would consume, the run records a skipped stage naming it — the gap becomes visible in the scan run and the evidence, rather than absent.

A container-image rule now applies to every target type, because the wizard accepts a container image on any target and nothing consumed it.

A scan that another rule does run is not reported as unavailable, so a firmware target with sources still reports its real SBOM and CVEs.

Also: DAST is no longer attempted where it does not apply

The "no code artifact" branch attempted DAST for every such target, so a firmware image or an APK recorded dast skipped: feature disabled — suggesting DAST would have run there in a full deployment. It would not: the matrix plans no DAST for those types. It is now attempted only when the plan has it, or when the target has no artifacts at all (migrated DAST targets, which rely on their DastTarget row).

Nightly

Three targets assert the behaviour, one per scan type (fixtures/nightly/unscanned/, with a README on what each is for):

Target Records as skipped
unscanned-firmware-image (ELF-header blob) firmware_static, sbom, cve
unscanned-mobile-package (minimal APK) mobile_static
unscanned-container-image (image reference) container_scan

When one of these scans is implemented, its skipped stage disappears from the baseline and real components or findings take its place.

Docs

The PLC guide advertised the firmware layer as scanned (FirmwareStatic · SBOM · CVE). It now states what actually happens and what covers firmware until then.

Verified

  • All 23 nightly targets blessed on a fresh database and compared on a second fresh one: pass, no diff. No existing baseline changed.
  • cargo fmt --check, clippy with the CI flags for agent, core, mcp and both dashboard feature sets, cargo test (367 agent, 70 core).

🤖 Generated with Claude Code

https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p

Closes #319. Part of #309. ## The problem `FirmwareStatic`, `MobileStatic` and `ContainerScan` appeared in the applicability matrix and in scan plans, but **no pipeline stage runs any of them**. A firmware image, an APK or a container image was accepted by the wizard, planned, and then passed over in silence: the run completed with no findings, which a customer reads as "we looked and it's clean" when nothing looked at all. The `Sbom` and `Cve` rules bound to a firmware *image* had the same problem. ## The fix A matrix rule can be marked **unavailable**, carrying the reason that covers the ground instead: - `firmware images are not unpacked or analysed yet: scan the firmware sources, or import a Firmwerk bundle for the image` - `no SBOM is extracted from a firmware image yet: …` - `CVE matching needs an SBOM, and none is extracted from a firmware image yet` - `mobile packages are not analysed yet: only the app's source code is scanned` - `container images are not scanned yet: only the sources that build them are` Such a scan is never pre-selected and reads as blocked to every client, so the wizard stops offering it. When the target *does* carry the artifact the scan would consume, the run records a skipped stage naming it — the gap becomes visible in the scan run and the evidence, rather than absent. A container-image rule now applies to every target type, because the wizard accepts a container image on any target and nothing consumed it. A scan that another rule does run is not reported as unavailable, so a firmware target with sources still reports its real SBOM and CVEs. ## Also: DAST is no longer attempted where it does not apply The "no code artifact" branch attempted DAST for every such target, so a firmware image or an APK recorded `dast skipped: feature disabled` — suggesting DAST would have run there in a full deployment. It would not: the matrix plans no DAST for those types. It is now attempted only when the plan has it, or when the target has no artifacts at all (migrated DAST targets, which rely on their `DastTarget` row). ## Nightly Three targets assert the behaviour, one per scan type (`fixtures/nightly/unscanned/`, with a README on what each is for): | Target | Records as skipped | |---|---| | `unscanned-firmware-image` (ELF-header blob) | `firmware_static`, `sbom`, `cve` | | `unscanned-mobile-package` (minimal APK) | `mobile_static` | | `unscanned-container-image` (image reference) | `container_scan` | When one of these scans is implemented, its skipped stage disappears from the baseline and real components or findings take its place. ## Docs The PLC guide advertised the firmware layer as scanned (`FirmwareStatic · SBOM · CVE`). It now states what actually happens and what covers firmware until then. ## Verified - All 23 nightly targets blessed on a fresh database and compared on a second fresh one: pass, no diff. No existing baseline changed. - `cargo fmt --check`, clippy with the CI flags for agent, core, mcp and both dashboard feature sets, `cargo test` (367 agent, 70 core). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang added 1 commit 2026-09-22 20:59:07 +00:00
fix(scans): stop offering scans nothing runs, and record them (#319)
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 6m1s
5cb7750603
FirmwareStatic, MobileStatic and ContainerScan were in the matrix and in
scan plans, but no pipeline stage executes any of them. A firmware image,
an APK or a container image was accepted, planned, and then quietly passed
over: the run completed with no findings, which reads as "we looked and
found nothing clean" when nothing looked at all. The SBOM and CVE rules
bound to a firmware *image* had the same problem.

A rule can now be marked unavailable, with the reason that covers the
ground instead. Such a scan is never pre-selected and reads as blocked to
every client, so the wizard stops offering it. When the target does carry
the artifact it would consume, the run records a skipped stage naming it:

    unscanned-firmware-image   firmware_static, sbom, cve
    unscanned-mobile-package   mobile_static
    unscanned-container-image  container_scan

A scan another rule does run is not reported unavailable, so a firmware
target with sources still reports its real SBOM.

DAST is no longer attempted for a target the matrix does not plan it for.
A firmware image or an APK recording "dast skipped" suggested DAST would
otherwise have run there; it would not. Migrated DAST targets, which carry
no artifacts and rely on their DastTarget row, still run.

The PLC guide claimed the firmware layer was scanned; it now says what
actually happens and what covers firmware until then.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang merged commit f90bfcc5c6 into main 2026-09-22 21:05:32 +00:00
sharang deleted branch feat/honest-scan-types 2026-09-22 21:05:32 +00:00
Sign in to join this conversation.