-
Notifications
You must be signed in to change notification settings - Fork 591
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
json SPDX invalid format #992
Comments
Hi @jonathongardner there definitely sounds like room for improvement here. One thing to note: we have had some discussion with various people (I'm relaying this 3rd hand), including folks on the SPDX team. There was some guidance to actually generate a separate SBOM to represent the image, or something along those lines. It has been a little difficult to nail down exactly how it should, or could, be represented in a single SPDX file. I believe other tools may use the approach you indicated, using |
I can confirm that there is a change for the upcoming 2.3.0 release of the SPDX specification which adds just this! There'll be a new 'package purpose' field, of which container image is one option. See spdx/spdx-spec#622 for the latest draft of this. SPDX 2.3.0 will probably be published in the next few weeks. Hope this helps; please let me know if I've missed anything 😃 |
@seabass-labrax that is excellent! This definitely seems like something we would love to support when the new spec is published. |
@kzantow so this isn't just docker images, i would expect it on any image i scan with Syft (docker was just the easiest to repeat). With that I was under the idea that "anything" could be a package in SPDX, so what syft calls an image SPDX just calls that a package b/c its some code that has other packages and some license attached to it, etc. But i am no SPDX expert so i could be wrong. I think the purpose package field would be helpful but not necessary. I do agree though its hard to nail down what exactly to do b/c I've seen different tools handling it differently. |
@jonathongardner agreed; apologies if I misspoke but yes: any image scan. The main problem without having a purpose field is properly reading SPDX documents: we would not have a definitive way to identify a single image was scanned, which the document represents - it could be a filesystem, or a Go binary, etc.. |
I've heard that copyright and license elements will be optional in V 2.3. |
@jonathongardner thanks for filing the issue here! It does look like with the imminent release of v2.3 this field will soon be optional. Patches are welcome for the current version, but we'll wait for the standard to roll forward here and then update our validation tools based on the latest schema. Closing for until 2.3 drops. |
What happened:
When generating an SPDX json SBOM the format is invalid (missing required
copyrightText
in packages and files and required described package)What you expected to happen:
To generate a valid SPDX json sbom.
"copyrightText": "NOASSERTION"
for all package and filesThan in relationship i would expect something like:
SPDXRef-1 should than have a relationship "CONTAINS" for every package in the SBOM (the describe one is required in the docs, you can see below, the extra "CONTAINS" im not 100% about but thats how i interpret the docs b/c the package/image we are describing (alpine:latest) contains all those packages in the file (
alpine-baselayout
, etc))How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
To validate the SPDX file I used https://tools.spdx.org/app/validate/ and I used documentation here to confirm.
copyrightText
in the docs Section 3.17 and Section 4.8Environment:
syft version
:syft 0.45.1
cat /etc/os-release
or similar): docker image (anchore/syft:latest
)The text was updated successfully, but these errors were encountered: