-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sbom: include external refs for fetched sourcecode in SPDX #1218
Conversation
This aids with many aspects of compliance. 2024/05/17 16:18:51 INFO melange is building: 2024/05/17 16:18:51 INFO configuration file: ./acl.yaml 2024/05/17 16:18:51 INFO workspace dir: /tmp/melange-workspace-17131835 2024/05/17 16:18:51 INFO evaluating pipelines for package requirements **2024/05/17 16:18:51 INFO adding external refs [pkg:generic/?checksum=sha256%3A5f2bdbad629707aa7d85c623f994aa8a1d2dec55a73de5205bac0bf6058a2f7c&download_url=https%3A%2F%2Fdownload.savannah.nongnu.org%2Freleases%2Facl%2Facl-2.3.2.tar.gz] for pipeline "fetch"** 2024/05/17 16:18:51 INFO adding packages [wget] for pipeline "Fetch and extract external object into workspace" 2024/05/17 16:18:51 INFO adding packages [make] for pipeline "Run autoconf make" 2024/05/17 16:18:51 INFO adding packages [make] for pipeline "Run autoconf make install" ```json "externalRefs": [ { "referenceCategory": "PACKAGE_MANAGER", "referenceLocator": "pkg:apk/wolfi/acl@2.3.2-r2?arch=x86_64", "referenceType": "purl" }, { "referenceCategory": "PACKAGE_MANAGER", "referenceLocator": "pkg:generic/acl@2.3.2?checksum=sha256%3A5f2bdbad629707aa7d85c623f994aa8a1d2dec55a73de5205bac0bf6058a2f7c&download_url=https%3A%2F%2Fdownload.savannah.nongnu.org%2Freleases%2Facl%2Facl-2.3.2.tar.gz", "referenceType": "purl" } ] ``` Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@chainguard.dev>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks GREAT. A couple minor style nits I noticed before I realized this was a Draft. With some tests, I'd merge this soooo fast.
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@chainguard.dev>
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@chainguard.dev>
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@chainguard.dev>
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@chainguard.dev>
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@chainguard.dev>
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@chainguard.dev>
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@chainguard.dev>
I am not sure there is any value in splitting our "package" stanza into two, and adding relationships on how binary ones are generated from the source ones. Especially since these do not ship the source code itself, but are merely references. If and when we generate something that is downloadable and contains all the cached code, it might be worth documenting that as standalone spdx package with intent source. |
We need to assess how scanners will react to such a change. |
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@chainguard.dev>
wolfictl scan passes with these changes to SPDX. |
har har har |
I have locally rebuilt a collection of packages to make glibc-dynamic and cert-exporter images with updated spdx. All existing tools and parsing mechanisms still work. And grype / syft all work correctly too without any averse effects. |
External References to sources
This aids with many aspects of compliance, and ability to self-locate all relevant source code.
This will be present in every package sbom, and by extension every image sbom accessible from console and container registry.
This is extensible to accommodate any other future inputs.
Current state:
Currently we generate external self-reference to the binary APK package
This proposal extends this array with additional references to the source code.
For fetch:
Add Package-URL to the download URI with checksum argument.
Resulting SBOM then has for the package this information:
For github based git-checkouts
Add Package-URL to the github location with tag & commit-id versions.
For non-github based git-checkouts
Add Package-URL to vcs location with tag as version and commit encoded as
@commit
(approximately similar to how many tools pin to a commit, i.e. pip)For melange config itself
Add Package-URL to github location with commit as version and subpath set to the melange configfile.