SBOM is different on package.json with same command on different systems #502
-
Describe the bugHello, we ran into an issue, where the output of the generated SBOM is different if executed in the Jenkins environment compared to the results if I execute the command locally. The major difference is that in the Jenkins environment an additional In the Jenkins environment it instead generates This leads to the issue, that our Dependency Track rejects the SBOM file cause that specific purl entry exceeds the max length I don´t know if that limitation comes from the specification or is an internal limitation of Dependency Track. Expected behaviorIdentical output SBOM in local and jenkins environment Screenshots or output-pasteIf applicable, add screenshots or past the output to help explain your problem. EnvironmentLocal
Jenkins
Additional contextSome screenshot if I diff the local (left) and jenkins (right) output: |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 10 replies
-
regarding the result differences: I understand that the result differs, if you run it in different systems, which each differ in installed npm packages/versions. You expect, that the "same command" results in the same output. regarding that problem parsing the PURL in DependencyTrack(DT): it is a known issue of DT which allows PURLS of a certain length at max. They know it is an issue and might have fixed it in the past. And in addition, it appeared to be a problem with some OSS indexes, which allowed PURLs with a certain max length in their APIs. All that together caused unexpected issues across multiple foreign systems, and it might be fixed in the future. See also: #225 Please upgrade your DependencyTrack. |
Beta Was this translation helpful? Give feedback.
-
Different npm versions can produce different results. Maybe it will be good to have option to pass path to npm binary or have the latest npm as dependency and use it for consistency, or both? |
Beta Was this translation helpful? Give feedback.
-
Thanks for your quick response!
I am not using it yet, just evaluating. What is the preferred way to call it?
Here is how I would like to use it: |
Beta Was this translation helpful? Give feedback.
regarding the result differences:
I understand that the result differs, if you run it in different systems, which each differ in installed npm packages/versions.
You expect, that the "same command" results in the same output.
Did you check that the version of
@cyclonedx/cyclonedx-npm
and its dependencies are the same on all systems?I doubt that they are all the same, because you described a behavior that was added as a feature in one version, but did not exist in an older one.
regarding that problem parsing the PURL in DependencyTrack(DT): it is a known issue of DT which allows PURLS of a certain length at max. They know it is an issue and might have fixed it in the past. And in additio…