-
Notifications
You must be signed in to change notification settings - Fork 416
SPDX parsing improvements #335
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
Comments
@oliverchang For your second point I would suggest that first an appropriate error message should be placed, since if the tool reports that no packages were found the first point one would think of is that something within the SBOM is incorrect and not that the filename is non conformant. |
Addresses part of #335 1. Be more relaxed about filename matching the spec when the SBOM is explicitly passed via --sbom since we've seen multiple complaints from different users about this. 2. Surface all parse errors when SBOM parsing fails (and we're explicitly scanning via --sbom). This will look something like: ``` Failed to parse SBOM using all supported formats: failed to parse SPDX: failed trying json: failed to parse Supplier 'Google LLC' failed trying rdf: found extra chars before tag start failed trying tv: no colon found in '{' failed to parse CycloneDX: failed trying json: invalid BOMFormat failed trying xml: XML syntax error on line 74: expected attribute name in element No package sources found, --help for usage information. exit status 128 ```
Thanks @anotherbridge. We're actually going to be more relaxed on the filenames here (in #339) to make the scanner easier to use. Point 3 in this bug (more detailed parsing errors) was also implemented. This should go out in our next release. |
Closes #335 #290 #93 #347 (Turns out we have a bunch of duplicate issues all roughly tracking the same thing) --------- Co-authored-by: Hayley Denbraver <[email protected]>
Tracking bug for a number of improvements to our current SPDX parsing
-L
we expect ".spdx.json" in the filename. Otherwise we will silently report that there are no packages. We should be more flexible here since we've seen a few instances/complaints for this.osv-scanner/internal/sbom/spdx.go
Line 66 in cfaf9f8
The text was updated successfully, but these errors were encountered: