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

sbomnix: NaNs in bom-ref for findings in vulnerabilities section in CycloneDX SBOMs #132

Closed
andrew-myer opened this issue Oct 17, 2024 · 3 comments

Comments

@andrew-myer
Copy link
Contributor

andrew-myer commented Oct 17, 2024

Some findings in the vulnerabilities section of generated CycloneDX SBOMs have a bom-ref of NaN. This looks to be caused by a difference in derivation parsing between sbomnix and vulnix

vulnix parses the pname and version of a package by splitting the name of a derivation
https://github.com/nix-community/vulnix/blob/master/src/vulnix/derivation.py#L71
https://github.com/nix-community/vulnix/blob/master/src/vulnix/derivation.py#L20-L27

sbomnix reads the pname and version values from a derivation which seems more correct
https://github.com/tiiuae/sbomnix/blob/main/src/sbomnix/derivation.py#L67-L73

The difference in parsing for pname and version causes NaNs when the results are merged if the pname and version don't match.
https://github.com/tiiuae/sbomnix/blob/main/src/sbomnix/sbomdb.py#L243-L249

I think a fix would either be to remove vulnix as a scanner and rely on grype's and osv's SBOM scans or an update to vulnix parsing to match this projects parsing. Let me know what you think 😄

@andrew-myer andrew-myer changed the title NaNs in bom-ref for findings in vulnerabilities section in CycloneDX SBOMs sbomnix - NaNs in bom-ref for findings in vulnerabilities section in CycloneDX SBOMs Oct 17, 2024
@andrew-myer andrew-myer changed the title sbomnix - NaNs in bom-ref for findings in vulnerabilities section in CycloneDX SBOMs sbomnix: NaNs in bom-ref for findings in vulnerabilities section in CycloneDX SBOMs Oct 17, 2024
@henrirosten
Copy link
Collaborator

Thanks @andrew-myer, I'll get back to this in the next few days.

@henrirosten
Copy link
Collaborator

I would like to fix this in vulnix, but I assume it will take some time to get it fixed there.

Maybe we merge your fix in #133 first. I could take care of pushing the fix to vulnix, then re-enable the vulnix scan on the cdx sbom vulnerabilities section once the fix is available in the vulnix upstream.

@henrirosten
Copy link
Collaborator

Closing this issue, it's now resolved with following PRs:

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

No branches or pull requests

2 participants