Repository navigation
Closed
Labels
scope/securitySecurity linters (trivy, bandit, gitleaks, kubeconform) and Vaultsource/agentFiled by an agenttype/bugType bug: the code does not do what it must
Description
Problem
Lines cited at 05e9388 (release/v0.2.29).
- Both formats are hand-written and unvalidated.
generate_cyclonedx_sbomandgenerate_spdx_sbom(security/sbom.py:86-194) build CycloneDX 1.5 and SPDX documents as dicts. Nothing validates them against either schema. - The inventory can describe the wrong software.
extract_workspace_components(:41) readsuv.lockwhen the target has one.- Otherwise it falls back to
importlib.metadata.distributions()(:68-81): the packages of the running devops-cli environment, not of the scanned target. - A target without
uv.lock(any non-Python project) therefore gets an SBOM of devops-cli itself.
- The SPDX namespace can read
None. It uses theproject_versionargument instead of the resolved version (:187;effective_versionis computed at:139).devops scan sbompasses no version (commands/scan.py:516,:518), so the namespace readsdevops-cli-None-<timestamp>. - SPDX ids can be invalid. They come from raw package names (
:157), which may hold characters theSPDXRef-idstring does not allow.
Proposed remedy
- Generate with Trivy.
devops scan sbomrunstrivy fs --format cyclonedxor--format spdx-jsonover the target, through the scanner base. Trivy is already the scan's vulnerability scanner.- A missing binary reports "not installed".
- The tool's output is written unchanged.
- Delete the hand-built documents and
extract_workspace_components.
Key questions
- Is an SBOM without Trivy needed? (proposed) No. Trivy is already required by
devops scan. If a Python-only path is wanted later, cyclonedx-python-lib (CycloneDX; 11.12.0) is the library to use, not hand-built dicts.
Acceptance criteria
- The command's argv for each format matches the Trivy invocation above (process fake), and the recorded output is written unchanged to
--output. - A missing
trivyreports "not installed" with a non-zero exit. -
security/sbom.pyno longer builds CycloneDX or SPDX dicts. - Tests run offline with fakes only at process and HTTP edges; each new test runs under 1 s.
-
uv run devops cipasses.
Found by the 2026-10-08 client-library audit.
Opened as a borrow (#1153, budget/borrowed): the agent filing quota is spent for this cycle, and this is a defect or security finding of the owner-requested 2026-10-08 client-library audit.
Metadata
Metadata
Assignees
Labels
scope/securitySecurity linters (trivy, bandit, gitleaks, kubeconform) and Vaultsource/agentFiled by an agenttype/bugType bug: the code does not do what it must
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty-bot commentedon Oct 8, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
A security tool producing incorrect or invalid SBOM output is a significant integrity defect, but it is not an actively exploitable vulnerability and Trivy is already required for the scan path.SBOMs are the primary artifact for supply-chain security compliance; an incorrect or invalid SBOM misleads every downstream consumer.The fix replaces hand-built dict generation with Trivy CLI invocations, deletes the old code path, and adds process-fake tests, but Trivy is already a scan dependency so no new integration is needed.