#150, PR 2a: the agent side. The reader came in #852; PR 2b adds the wizard and docs. Tracker #167.
What
New artifact kindbuild_output (ArtifactKind::BuildOutput): a Yocto image's SPDX archive, <image>.spdx.tar.zst.
Uploaded through the existing POST /api/v1/targets/{id}/artifacts with kind=build_output.
Stored as uploaded: no extraction, because the reader opens it itself.
It counts as an upload for change detection, so a new archive means a new scan.
The classifier takes it as Yocto evidence (0.7).
Scan:run_target hands the ingested paths to scan_tree through RepoView::build_outputs. read_build_outputs reads each archive; one it cannot read gets a run note build_spdx (ArtifactNotIngested), and the scan carries on.
pipeline::yocto_build::Built joins the build with the recipe inventory by recipe name. The layer's PV and the built version differ (busybox_1.35.0.bb vs 1.36.1 built; linux-yocto 6.6 vs 6.6.151+git), so a name+version join would double-count.
merge:
For a recipe in both, the build's version, CPE, licence and InImageBasis::Built win, and the evidence of both is kept.
An image the SPDX covers is authoritative. A recipe declared in it but not installed loses the marking. Declarations for other images stay, as evidence.
Built-only recipes are added, and non-recipe components are untouched.
nvd_queries: the built version and CPE replace the inventory's query for that recipe. Every built recipe with a CPE is asked about within the existing NVD_BUDGET, and recipes without a release version are listed as unchecked.
statements: VEX fixed for the CVEs the build's patches fixed (create-spdx CVEs fixed). Otherwise the recipe's CVE_STATUS and CVE: patches apply, joined by name. Alerts on non-built components go through vex_statements as before.
Unresolved packages (listed in the image without a document) get an informational note via the new SkipCode::BuildPackagesUnresolved, with DE/EN texts and a stage label.
Dashboard: the SBOM page's "im Image" tooltip now depends on the basis: declared in the recipes, or installed by the build.
yocto_inventory::release_of and scan_statement are now pub(crate).
Notes
Kernel volume: a real image includes linux-yocto with CPE linux_kernel. In the ferrite sample its SPDX lists 14,182 fixed CVEs, and cve-check counts 622 unpatched. So NVD returns thousands of kernel CVEs, almost all settled fixed by this PR. This is correct, but it is a lot of alerts per scan. PR 3 (cve-check JSON) adds Yocto's own verdicts on top.
Not covered here: a target with build outputs but no code artifact (no layer tree, no archive). run_target's no-code-artifact branch does not run the scan, and that is likely the #167 customer's shape. That is a follow-up.
Nightly: the nightly runs the agent image from main, so it cannot exercise this branch. After the merge, a nightly target (the existing layer fixture plus the trimmed archive from #852) gets its baseline blessed against the deployed agent, in a small follow-up PR.
Tests
Unit tests (yocto_build.rs, against the #852 fixture):
the name join with differing versions;
a declared marking dropped for the covered image and kept for another;
built-only recipes added and other managers untouched;
queries with the built version and the vendor CPE, with no query for a package group;
#150, PR 2a: the agent side. The reader came in #852; PR 2b adds the wizard and docs. Tracker #167.
## What
- **New artifact kind** `build_output` (`ArtifactKind::BuildOutput`): a Yocto image's SPDX archive, `<image>.spdx.tar.zst`.
- Uploaded through the existing `POST /api/v1/targets/{id}/artifacts` with `kind=build_output`.
- Stored as uploaded: no extraction, because the reader opens it itself.
- It counts as an upload for change detection, so a new archive means a new scan.
- The classifier takes it as Yocto evidence (0.7).
- **Scan:** `run_target` hands the ingested paths to `scan_tree` through `RepoView::build_outputs`. `read_build_outputs` reads each archive; one it cannot read gets a run note `build_spdx` (`ArtifactNotIngested`), and the scan carries on.
- **`pipeline::yocto_build::Built`** joins the build with the recipe inventory by recipe name. The layer's PV and the built version differ (`busybox_1.35.0.bb` vs 1.36.1 built; `linux-yocto 6.6` vs `6.6.151+git`), so a name+version join would double-count.
- **merge**:
- For a recipe in both, the build's version, CPE, licence and `InImageBasis::Built` win, and the evidence of both is kept.
- An image the SPDX covers is authoritative. A recipe declared in it but not installed loses the marking. Declarations for other images stay, as evidence.
- Built-only recipes are added, and non-recipe components are untouched.
- **nvd_queries**: the built version and CPE replace the inventory's query for that recipe. Every built recipe with a CPE is asked about within the existing `NVD_BUDGET`, and recipes without a release version are listed as unchecked.
- **statements**: VEX `fixed` for the CVEs the build's patches fixed (create-spdx `CVEs fixed`). Otherwise the recipe's `CVE_STATUS` and `CVE:` patches apply, joined by name. Alerts on non-built components go through `vex_statements` as before.
- **Unresolved packages** (listed in the image without a document) get an informational note via the new `SkipCode::BuildPackagesUnresolved`, with DE/EN texts and a stage label.
- **Dashboard**: the SBOM page's "im Image" tooltip now depends on the basis: declared in the recipes, or installed by the build.
- `yocto_inventory::release_of` and `scan_statement` are now `pub(crate)`.
## Notes
- **Kernel volume:** a real image includes `linux-yocto` with CPE `linux_kernel`. In the ferrite sample its SPDX lists 14,182 fixed CVEs, and cve-check counts 622 unpatched. So NVD returns thousands of kernel CVEs, almost all settled `fixed` by this PR. This is correct, but it is a lot of alerts per scan. PR 3 (cve-check JSON) adds Yocto's own verdicts on top.
- **Not covered here:** a target with build outputs but no code artifact (no layer tree, no archive). `run_target`'s no-code-artifact branch does not run the scan, and that is likely the #167 customer's shape. That is a follow-up.
- **Nightly:** the nightly runs the agent image from `main`, so it cannot exercise this branch. After the merge, a nightly target (the existing layer fixture plus the trimmed archive from #852) gets its baseline blessed against the deployed agent, in a small follow-up PR.
## Tests
- Unit tests (`yocto_build.rs`, against the #852 fixture):
- the name join with differing versions;
- a declared marking dropped for the covered image and kept for another;
- built-only recipes added and other managers untouched;
- queries with the built version and the vendor CPE, with no query for a package group;
- `fixed` statements;
- CPE parsing.
- Plus the `build_output` Display test.
- CI only.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
A target takes a new artifact kind, build_output: a Yocto image's SPDX
archive (<image>.spdx.tar.zst), read with pipeline::yocto_spdx (#852).
The scan joins what the build installed with the recipe inventory of
the layer tree (pipeline::yocto_build):
- by recipe name, since the tree's PV and the built version differ
(busybox 1.35.0 in the layer, 1.36.1 built): the build's version, CPE,
licence and InImageBasis::Built win, both evidence lines stay;
- an image the SPDX covers is authoritative: a recipe declared in it but
not installed loses that marking; declarations for other images stay;
- recipes only the build lists are added;
- NVD is asked with the built version and CPE, one query per recipe;
- a CVE the build's patches fixed (create-spdx "CVEs fixed") is stated
fixed; otherwise the recipe's CVE_STATUS applies, joined by name.
An archive that cannot be read, and packages listed without their
documents, are noted on the run (build_spdx; new informational
SkipCode::BuildPackagesUnresolved). The classifier takes an image SPDX
archive as Yocto evidence. The SBOM page's in-image tooltip now says
how the marking is known (declared in the recipes, or installed by the
build).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
#150, PR 2a: the agent side. The reader came in #852; PR 2b adds the wizard and docs. Tracker #167.
What
build_output(ArtifactKind::BuildOutput): a Yocto image's SPDX archive,<image>.spdx.tar.zst.POST /api/v1/targets/{id}/artifactswithkind=build_output.run_targethands the ingested paths toscan_treethroughRepoView::build_outputs.read_build_outputsreads each archive; one it cannot read gets a run notebuild_spdx(ArtifactNotIngested), and the scan carries on.pipeline::yocto_build::Builtjoins the build with the recipe inventory by recipe name. The layer's PV and the built version differ (busybox_1.35.0.bbvs 1.36.1 built;linux-yocto 6.6vs6.6.151+git), so a name+version join would double-count.InImageBasis::Builtwin, and the evidence of both is kept.NVD_BUDGET, and recipes without a release version are listed as unchecked.fixedfor the CVEs the build's patches fixed (create-spdxCVEs fixed). Otherwise the recipe'sCVE_STATUSandCVE:patches apply, joined by name. Alerts on non-built components go throughvex_statementsas before.SkipCode::BuildPackagesUnresolved, with DE/EN texts and a stage label.yocto_inventory::release_ofandscan_statementare nowpub(crate).Notes
linux-yoctowith CPElinux_kernel. In the ferrite sample its SPDX lists 14,182 fixed CVEs, and cve-check counts 622 unpatched. So NVD returns thousands of kernel CVEs, almost all settledfixedby this PR. This is correct, but it is a lot of alerts per scan. PR 3 (cve-check JSON) adds Yocto's own verdicts on top.run_target's no-code-artifact branch does not run the scan, and that is likely the #167 customer's shape. That is a follow-up.main, so it cannot exercise this branch. After the merge, a nightly target (the existing layer fixture plus the trimmed archive from #852) gets its baseline blessed against the deployed agent, in a small follow-up PR.Tests
yocto_build.rs, against the #852 fixture):fixedstatements;build_outputDisplay test.🤖 Generated with Claude Code