Per-package SBOMs in `/var/lib/db/sbom` contain two apk components for the same package: which one should consumers use?
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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!
- Ngôn ngữ chính
- Shell
- Star
- 1.3k
- Fork
- 453
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của wolfi-dev/os
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
wolfi-dev/os#78773 · 2 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
mariadb: entrypoint hardcodes _mariadb_version() to 11.5.2, silently disabling upgrade detectionĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
bug report-to-upstream
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
flatpark/flatpark#1424 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[bug] Docker Compose version check in auto-install.sh fails on non-Debian systems (dpkg not found)Có thể đã có người làm @shaneintentionboi06 đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
openwisp/docker-openwisp#771 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DANDI:002056: waiting on youĐang mởneeds-you
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
catalystneuro/encore#860 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100