Per-package SBOMs in `/var/lib/db/sbom` contain two apk components for the same package: which one should consumers use?
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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!
- Lenguaje dominante
- Shell
- Estrellas
- 1.3k
- Forks
- 453
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de wolfi-dev/os
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
wolfi-dev/os#78773 · 2 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
mariadb: entrypoint hardcodes _mariadb_version() to 11.5.2, silently disabling upgrade detectionAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
Todos los issues de wolfi-dev/os
Issues similares
-
Update crush to 0.102.0Posiblemente ocupada @zen0bit la tomó hoy. Abiertopackage-update
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
oSoWoSo/oco#1251 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
btclib-org/claude-process#657 · 1 comentario ·
-
icon request
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
PapirusDevelopmentTeam/papirus-icon-theme#4386 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
`platform:clone` cannot check out a TAG `platform.ref`, yet `config.yaml` recommends pinning a tagAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
awslabs/open-agentic-platform#165 ·
Los mantenedores suelen responder en 1 día