feat(sbom): sbomqs quality score as CRA evidence for the SBOM (#496) #503

Merged
sharang merged 1 commits from feat/496-sbomqs into main 2026-10-06 12:35:02 +00:00
Owner

Closes #496.

What

At the end of every completed scan, the target's CycloneDX SBOM is scored by sbomqs (Interlynk, Apache-2.0). It is the same document as the evidence pack's sbom.cdx.json, built by sbom_docs::cyclonedx. Two profiles are used: BSI TR-03183-2 v2.1 and NTIA Minimum Elements (2021).

The score is supporting evidence for cra-ai-23 (SBOM). It does not produce findings and does not change any control state.

How

  • Image (Dockerfile.agent):
    • SBOMQS_VERSION=2.1.2 with SBOMQS_SHA256=451c8000…a39ab8, matching the release's checksums.txt
    • installed with the same curl, sha256sum -c and tar steps as syft and gitleaks
    • listed in /opt/pruefwerk/tool-versions.json
    • size impact: an 11 MB download, about 23 MB more in the image
  • Profiles: passed by their explicit names, bsi-v2.1,ntia-2021. In 2.1.2 the short names move: bsi means "latest BSI" and ntia means CISA 2026, so pinning the names keeps the score comparable across sbomqs releases.
  • Offline: the component analysis that calls Interlynk's API is opt-in and never enabled, and the tool runs with an empty environment (tool_cmd). I checked locally with unshare -rn sbomqs score …: exit 0, full output.
  • pipeline/sbom_quality.rs:
    • writes the document to a temp dir, runs sbomqs score --json --profile … with a 120 s timeout, and parses the result
    • result per profile: id, name, score, grade, and the checks below 10 that are not ignored (key, description, score, required)
    • if sbomqs is missing or fails, the run gets the skipped stage sbom_quality (ToolFailed, subject sbomqs), and the scan itself is not failed
  • Storage: the result goes into ScanRun.sbom_quality. It is written in run_target together with status: completed.
  • API: GET /api/v1/sbom/quality?repo_id= returns the newest scored run.
  • CRA evidence:
    • ControlStatus.sbom_quality is set on cra-ai-23 only
    • sbom-quality.json is added to the evidence pack (and listed in the manifest) when there is a score
  • Dashboard:
    • SBOM page: an "SBOM-Qualität" card for the selected target, with grade and score per profile and the failed checks folded under each (marked Pflicht / zusätzlich)
    • CRA page: a "Supporting evidence, SBOM quality" line on cra-ai-23

Known limitation (follow-up)

Our CycloneDX export is still 1.5 and has no suppliers, hashes or the TR's bsi:component:* properties. #498 added a timestamp and tool metadata after this branch began. BSI TR-03183-2 v2.1 therefore grades it low on every target: it was ~0.9/10 (F) before #498, and sbom_spec_version still fails because the TR requires 1.6. I did not change sbom_docs here. The failed checks list what the export needs.

Docs

  • reference/tools.md: new sbomqs section
  • guide/sbom.md: new "SBOM quality" section
  • guide/repositories.md: evidence pack contents
  • staging plan: check 20

Tests

  • parser on a real sbomqs 2.1.2 output for both profiles (met and ignored checks are left out, partly met checks are kept)
  • bad output is rejected
  • the not-installed path
  • the evidence test: the score is on cra-ai-23 only, no state changes, and sbom-quality.json is in the pack only when there is a score
  • dashboard: the CRA line formatting

🤖 Generated with Claude Code

https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB

Closes #496. ## What At the end of every completed scan, the target's CycloneDX SBOM is scored by **sbomqs** (Interlynk, Apache-2.0). It is the same document as the evidence pack's `sbom.cdx.json`, built by `sbom_docs::cyclonedx`. Two profiles are used: **BSI TR-03183-2 v2.1** and **NTIA Minimum Elements (2021)**. The score is supporting evidence for **cra-ai-23** (SBOM). It does not produce findings and does not change any control state. ## How - **Image (`Dockerfile.agent`):** - `SBOMQS_VERSION=2.1.2` with `SBOMQS_SHA256=451c8000…a39ab8`, matching the release's `checksums.txt` - installed with the same curl, `sha256sum -c` and tar steps as syft and gitleaks - listed in `/opt/pruefwerk/tool-versions.json` - size impact: an 11 MB download, about 23 MB more in the image - **Profiles:** passed by their explicit names, `bsi-v2.1,ntia-2021`. In 2.1.2 the short names move: `bsi` means "latest BSI" and `ntia` means CISA 2026, so pinning the names keeps the score comparable across sbomqs releases. - **Offline:** the component analysis that calls Interlynk's API is opt-in and never enabled, and the tool runs with an empty environment (`tool_cmd`). I checked locally with `unshare -rn sbomqs score …`: exit 0, full output. - **`pipeline/sbom_quality.rs`:** - writes the document to a temp dir, runs `sbomqs score --json --profile …` with a 120 s timeout, and parses the result - result per profile: id, name, score, grade, and the checks below 10 that are not ignored (key, description, score, required) - if sbomqs is missing or fails, the run gets the skipped stage `sbom_quality` (`ToolFailed`, subject `sbomqs`), and the scan itself is not failed - **Storage:** the result goes into `ScanRun.sbom_quality`. It is written in `run_target` together with `status: completed`. - **API:** `GET /api/v1/sbom/quality?repo_id=` returns the newest scored run. - **CRA evidence:** - `ControlStatus.sbom_quality` is set on cra-ai-23 only - `sbom-quality.json` is added to the evidence pack (and listed in the manifest) when there is a score - **Dashboard:** - SBOM page: an "SBOM-Qualität" card for the selected target, with grade and score per profile and the failed checks folded under each (marked Pflicht / zusätzlich) - CRA page: a "Supporting evidence, SBOM quality" line on cra-ai-23 ## Known limitation (follow-up) Our CycloneDX export is still 1.5 and has no suppliers, hashes or the TR's `bsi:component:*` properties. #498 added a timestamp and tool metadata after this branch began. BSI TR-03183-2 v2.1 therefore grades it low on every target: it was ~0.9/10 (F) before #498, and `sbom_spec_version` still fails because the TR requires 1.6. I did not change `sbom_docs` here. The failed checks list what the export needs. ## Docs - `reference/tools.md`: new sbomqs section - `guide/sbom.md`: new "SBOM quality" section - `guide/repositories.md`: evidence pack contents - staging plan: check 20 ## Tests - parser on a real sbomqs 2.1.2 output for both profiles (met and ignored checks are left out, partly met checks are kept) - bad output is rejected - the not-installed path - the evidence test: the score is on cra-ai-23 only, no state changes, and `sbom-quality.json` is in the pack only when there is a score - dashboard: the CRA line formatting 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
sharang force-pushed feat/496-sbomqs from 90e53c3992 to acb6818d62 2026-10-06 12:13:26 +00:00 Compare
sharang added 1 commit 2026-10-06 12:24:56 +00:00
feat(sbom): sbomqs quality score as CRA evidence for the SBOM (#496)
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 9m45s
0c1024dd60
At the end of every completed scan the target's CycloneDX SBOM (the same
document as the evidence pack's sbom.cdx.json) is scored by sbomqs against
BSI TR-03183-2 v2.1 and the NTIA minimum elements (2021).

- Dockerfile.agent pins sbomqs 2.1.2 (Apache-2.0) with the sha256 from the
  release's checksums.txt and lists it in tool-versions.json.
- Profiles by explicit name (bsi-v2.1, ntia-2021): in 2.1.2 `bsi` and
  `ntia` float to the newest BSI and CISA 2026 profiles.
- pipeline/sbom_quality.rs runs it offline through tool_cmd (empty
  environment, 120 s), keeps per profile the score, grade and the checks
  not fully met; stored on the scan run as sbom_quality. Without sbomqs the
  run records the skipped stage sbom_quality.
- Supporting evidence, not findings: attached to cra-ai-23 in the CRA
  status without changing its state, sbom-quality.json in the evidence
  pack, GET /api/v1/sbom/quality for the SBOM page.
- Dashboard: SBOM-Qualität card on the SBOM page, a supporting-evidence line
  on cra-ai-23 on the CRA page.
- Docs: tools.md, SBOM and target guides, staging check 20.

Our export (CycloneDX 1.5, no creator, timestamp, supplier or hashes)
grades F against BSI; the failed checks list what it needs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
sharang force-pushed feat/496-sbomqs from acb6818d62 to 0c1024dd60 2026-10-06 12:24:56 +00:00 Compare
sharang merged commit e51a790d59 into main 2026-10-06 12:35:02 +00:00
sharang deleted branch feat/496-sbomqs 2026-10-06 12:35:03 +00:00
Sign in to join this conversation.