Per-package SBOMs in `/var/lib/db/sbom` contain two apk components for the same package: which one should consumers use?
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start by examining the example SPDX document structure described in the issue, especially the DESCRIBES and nested CONTAINS relationships, and trace how the per-package SBOM is generated. The issue asks maintainers to clarify why both apk components appear and which represents the package; no source files or tests are identified. Done means answering those questions and determining whether the nested component should be retained or removed.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
Each Wolfi package ships an SPDX document in /var/lib/db/sbom/<package>-<version>.spdx.json. In the documents we
looked at, the same package appears twice as an apk component, with two different purls. Example with
libgcc-16.2.0-r1.spdx.json from cgr.dev/chainguard/wolfi-base (created by Tool: chainguard-build (v0.59.0)):
| SPDX element | purl | sourceInfo |
supplier |
|---|---|---|---|
SPDXRef-Package-apk-libgcc-16.2.0-r1 |
pkg:apk/wolfi/[email protected]?arch=x86_64&distro=wolfi |
– | Organization: Wolfi |
SPDXRef-Package-apk-libgcc-bc08e9c4c69fba15 |
pkg:apk/wolfi/[email protected]?arch=x86_64&origin=gcc |
acquired package info from APK DB: /.PKGINFO |
Organization: chainguard |
Relationships:
SPDXRef-DOCUMENT DESCRIBES SPDXRef-Package-apk-libgcc-16.2.0-r1
SPDXRef-Package-apk-libgcc-16.2.0-r1 CONTAINS SPDXRef-DocumentRoot-Directory-libgcc
SPDXRef-DocumentRoot-Directory-libgcc CONTAINS SPDXRef-Package-apk-libgcc-bc08e9c4c69fba15
SPDXRef-Package-apk-libgcc-16.2.0-r1 DESCRIBED_BY SPDXRef-Package-Melange-gcc.yaml-…
SPDXRef-Package-apk-libgcc-16.2.0-r1 GENERATED_FROM SPDXRef-Package-Source-gitlab.com-gnutools-gcc.git-…
The first component is the package the document describes, linked to its recipe and sources. The second one is
nested under a DocumentRoot-Directory element and looks like the result of scanning the package's own contents,
which finds the package's own .PKGINFO. 18 of the 19 documents in wolfi-base have this structure; the exception is
wolfi-base-1-r7.spdx.json (single apk component).
Why it matters
Scanners that read these documents see two components for one package.
Trivy keeps one of them at random, so the same image yields different purls from one
scan to the next (aquasecurity/trivy#11362). Downstream
tools that match components by purl (e.g. carrying vulnerability analysis decisions over between versions in
Dependency-Track) then see the same package change identity.
Before changing how Trivy reads these documents, its maintainers asked us to check with you why the second component
is there and which of the two is meant to describe the package.
Questions
- Why does a single document contain two apk components for the same package? Is the nested one an intended part
of the format, or a side effect of scanning the package contents? - Which component should SBOM consumers treat as the description of the package? Our reading is the one targeted
bySPDXRef-DOCUMENT DESCRIBES(distro=wolfi). - If the nested component is useful (e.g. the
origin=qualifier as a link to the source package), could it be
kept in a form that consumers can tell apart; otherwise, could it be dropped from the generated documents?
Related
- wolfi-dev/wolfictl#1409 / wolfi-dev/wolfictl#1420:
wolfictl scanfound two APK packages in one.apkonce its contents were
scanned (ELF package notes); the elf-package cataloger was removed from that scan. Similar effect, here from the
package's own.PKGINFO. - chainguard-dev/melange#2061 (not merged): Syft scan of package contents to enrich the SBOM, which would produce
this kind of nested component. - anchore/syft#3662 / #3983: other non-package components of these documents (
GENERATED_FROMupstream source,
DESCRIBED_BYrecipe) imported as packages by Syft. - aquasecurity/trivy#9865 and #10751 (fixed): non-determinism between the apk database and these documents; this
report is about the duplicate inside a single document.
We'll report the answer back to the Trivy discussion. Thanks!
- Lingua principale
- Shell
- Stelle
- 1.3k
- Fork
- 453
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di wolfi-dev/os
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
wolfi-dev/os#78773 · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
mariadb: entrypoint hardcodes _mariadb_version() to 11.5.2, silently disabling upgrade detectionAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di wolfi-dev/os
Issue simili
-
Update crush to 0.102.0Forse già presa @zen0bit l’ha presa oggi. Apertapackage-update
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
oSoWoSo/oco#1251 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
btclib-org/claude-process#657 · 1 commento ·
-
icon request
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
PapirusDevelopmentTeam/papirus-icon-theme#4386 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
`platform:clone` cannot check out a TAG `platform.ref`, yet `config.yaml` recommends pinning a tagAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
awslabs/open-agentic-platform#165 ·
I maintainer di solito rispondono entro 1 giorno