-
Notifications
You must be signed in to change notification settings - Fork 597
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
syft should error if not specifying sha1 for SPDX #1256
Comments
Thanks for this issue @mlieberman85 -- are you referring to the Package verification code field? It looks like all other fields that use digest algorithms allow a number of different types of algorithms. I wonder if there is no |
So, it might be ambiguous but in 8.4 under File Checksum field it also states:
In the json schema it's worded a bit differently:
I have seen some SPDX parsers to require As far as solution, that makes sense. Just something to either always include |
Ah, yes I misread that. This does look more like an error -- it's a required field, but we don't have the information to provide it. If we jut warned for this, then we'd have to start omitting larger sections of the SPDX so it would be valid, like the entire File entry. I think in this case actually erroring out would be better, do you agree? There's another potential option that we detect SPDX output and always add the |
For this particular issue it might make sense to error out. Perhaps warn on files/dirs that are being dropped. I have noticed for example in this SBOM: http://oopsallsboms.storage.googleapis.com/addon-resizer-1.2.sha256-f4a217b52cc55bd6f47a33d79e56e7e6c0b28415afdcd8f2294ed31c9117b765.syft.0.58.0.spdx.json -- some things have hashes, other things don't. It looks like most of the things that don't have hashes are directories? I don't want to detract from this particular issue, but there are inconsistencies within the documentation for the spec, and the JSON schema for the spec:
There are a few other things that are "required" even if the data is just "NOASSERTION" like:
|
Actually it appears the license and copyright info being blank might be inconsistencies between the JSON schema and the spec documentation. |
What happened:
Syft generates SPDX SBOM with only md5, sha256, etc. if specified in config. SPDX requires one of the checksums included be sha1.
What you expected to happen:
Either Syft should error stating that sha1 must be included as well, or it should use any non-sha1 digest in addition to the required sha1.
How to reproduce it (as minimally and precisely as possible):
Include a syft.yaml config with:
and run syft while generating SPDX.
Environment:
syft version
:syft 0.58.0
cat /etc/os-release
or similar):The text was updated successfully, but these errors were encountered: