Skip to content
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

Only a single instance of a dependency component reported in the SBOM when there are multiple instances #1353

Open
prabhu opened this issue Sep 3, 2024 Discussed in #1304 · 0 comments

Comments

@prabhu
Copy link
Contributor

prabhu commented Sep 3, 2024

Discussed in #1304

Originally posted by emcfins August 9, 2024
When scanning a complex project (iot-device-simulator for example), the SBOM doesn't include all instances of a dependency installed.

In the linked repo, fast-xml-parser exists in source/console, source/simulator, source/custom-resource, and source/microservices. However, when cdxgen scans it, that fast-xml-parser is only reported to be in source/console and source/simulator.

When doing some digging, it seems like this line will only return a component if the version doesn't already exist in the component map.

if (compMap[component.purl]) return;

If cdxgen is used to find all instances of a package installed for things such as vulnerability reporting, it will report only 2 instances of the dependency to be patched, instead of 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant