feat(yocto): read what a build installed from its SPDX 2.2 (#150) #852

Merged
sharang merged 1 commits from feat/yocto-spdx-reader into main 2026-11-04 21:47:01 +00:00
1 Commits
Author SHA1 Message Date
Sharang ParnerkarandClaude Opus 5.5 2a8517aec2 feat(yocto): read what a build installed from its SPDX 2.2 (#150)
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 4m13s
CI / Check (pull_request) Successful in 16m42s
The recipe inventory reads a layer tree as written: every recipe, and an
image's content as its recipes declare it. A build knows more, and
Yocto's create-spdx class already writes it down: one SPDX 2.2 document
per image, package and recipe, archived as <image>.spdx.tar.zst.

pipeline::yocto_spdx reads that archive (or the extracted documents):
the image CONTAINS its installed packages, each GENERATED_FROM a recipe,
resolved through externalDocumentRefs by namespace. Per recipe with
packages in the image it returns one SBOM component (yocto-recipe, the
recipe version, the declared licence without document prefixes, the
CPEs, the homepage), marked InImageBasis::Built, plus the CVEs the
recipe's patches fix ("CVEs fixed:" in sourceInfo) for fixed VEX
statements, and the references it could not resolve. The archive is
untrusted input: document count, document size and total size are
capped while it is read.

Reader only; the upload and the scan follow in the next PR. The fixture
is a trimmed copy of a real scarthgap 5.0.21 core-image-minimal for
qemuarm64 (four recipes, one dangling reference).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 22:29:32 +01:00