-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
[validation] Invalid externalReferences URLs may be present in the SBOM #1107
Comments
This is not the only issues.
Or failed replacements like
|
@marob, I am in favor of dropping the invalid external references and trimming the value. My personal opinion is that CycloneDX spec should be unopinionated and should not have such validations for external references. Pull requests are welcome. If not, we can collect all such tickets and raise funds to hire an engineer. |
I think we may need to trim the url, and then ideally use the same regex DTrack is using to validate [IRI RFC 3987](https://datatracker.ietf.org/doc/html/rfc3987 We've had instances like the following being rejected
|
Started a discussion DependencyTrack/dependency-track#3775 to confirm. |
DependencyTrack/dependency-track#3775 (reply in thread)
|
@setchy In your comment here, you mention that you saw the following in a generated BOM from cdxgen? I ran cdxgen against the codebase for |
I've started to work on it by enabling strict JSON Schema validation on this PR: #1128 |
Please test with the latest master branch |
@prabhu, thanks a lot for the fix. It works perfectly. |
@Kanti could you help test the master branch a bit more and let me know how it performs? If you have java applications, please try the new dependency tree mode using the environment variable |
@prabhu sorry no java over here. |
I had this issue a well and had it in Java -- unfortunately not Maven but Gradle. Seems to work perfectly though! |
Thanks for confirming everyone! |
@prabhu It looks better, but I still have at least one project with an error when uploading to DependencyTrack because of python bb package. "purl": "pkg:pypi/[email protected]",
"externalReferences": [
{
"type": "website",
"url": "http://"
}
], That seems to be valid according to |
@marob, interesting find. |
I've created an issue on json-schema-validator that is used by DependencyTrack. |
It's fixed in [email protected] that is used in [email protected] that is used in [email protected] |
I'm re-closing this issue |
Hey getting the following error:
due to which cdxgen is getting stuck and failing, any insights on the following? |
Hi @phoenix-aditya. This log comes from this change. It shouldn't make cdxgen get stuck. If cdxgen is stuck, I think the source of the problem is elsewhere. |
Hey mainly what is happening is when the PREFER_MAVEN_DEPS_TREE is set to true, due to some reason its taking much longer for cdxgen to run |
According to https://github.com/comunica/validate-iri.js?tab=readme-ov-file#performance, validating 1.8M values takes 12s. Are you sure the performance issue comes from IRI validation? |
Hey, i enabled CDXGEN_DEBUG_MODE even then the last command i see is only Note: I am only facing this issue post setting |
I am not sure why its failing but i feel i can test out if its IRI validation that is causing the problem in my environment if there is a way to disable it |
There's no relation between IRI validation cannot be disabled. |
@phoenix-aditya sounds like a separate bug, possibly an infinite loop. Can you run the maven command shown on the output when invoked with the Best to share your observation as a separate discussion thread. |
cdxgen generates SBOMs by analyzing files. So, I see 3 "solutions":
|
@marob thanks for the detailed explanation, it is really helpful! I have no problem ignoring this warning as it does not cause an invalid sbom file, at least for me. The issue is that after it prints the warning the cli gets stuck. |
Hey this seems like the exact same issue i am facing, |
Could you guys share the command line arguments used? Also share the full output after setting the CDXGEN_DEBUG_MODE=debug environment variable. @guyscher2 do you also use the new |
@phoenix-aditya One difference between the cyclonedx maven plugin and the new |
@prabhu Following env vars: plus tried PREFER_MAVEN_DEPS_TREE=true/false gets stuck on IRI failed validation message. |
@guyscher2 can you try with the latest version? |
Look good, thanks! @prabhu |
Hey in my case as well it is no longer getting stuck |
With DependencyTrack 4.11 validating SBOM with schema validation at upload, I've discovered that some SBOM may have invalid externalReferences.
For example:
coming from composer
dmore/chrome-mink-driver
package.Indeed, an externalReference should be a
iri-reference
or a#/definitions/bomLink
according to the JsonSchema.The problem is that
[email protected]:behat-chrome/chrome-mink-driver.git
is neither a#/definitions/bomLink
nor aniri-reference
(that should be of the formscheme://...
according to the RFC).If we can "convert"
[email protected]:behat-chrome/chrome-mink-driver.git
tohttps://gitlab.com/behat-chrome/chrome-mink-driver.git
it would be nice, but if not, we'd better drop the reference than write an invalid one.The text was updated successfully, but these errors were encountered: