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

grype scan by sbom file is generated by syft different with scanning directly container #1057

Closed
waovu opened this issue Jan 11, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@waovu
Copy link

waovu commented Jan 11, 2023

grype scan by sbom file is generated by syft different with scanning directly container

grype scan sbom file and directly ccontainer should be same

Screen Shot 2023-01-11 at 2 11 28 PM

Environment:

  • grype version: 0.55.0
  • syft version : 0.65.0
  • OS (e.g: cat /etc/os-release or similar):
@waovu waovu added the bug Something isn't working label Jan 11, 2023
@kzantow
Copy link
Contributor

kzantow commented Jan 11, 2023

I suspect we're losing the file overlap relationships in CycloneDX format.

As a workaround, you could use a Syft format SBOM (e.g. using syft -o json), and it should produce the same result as the direct scan.

@kzantow kzantow added this to OSS Jan 11, 2023
@kzantow kzantow moved this to Backlog (Pulled Forward for Priority) in OSS Jan 11, 2023
@waovu
Copy link
Author

waovu commented Jan 16, 2023

@katgurdak yeap, If scan with json output, result will be same. but with cycloneDx format, it's difference

@dwertent
Copy link

@kzantow Does this mean there is an issue with the JSON output format?

@kzantow
Copy link
Contributor

kzantow commented Nov 13, 2024

Apologies for the delay getting back here -- I don't think this is an issue with CycloneDX in Grype, it's an issue that CycloneDX doesn't support certain types of relationships, so outputting a Syft SBOM in CycloneDX is lossy and can lead to worse results in Grype. There isn't a specific thing we can do to fix this until CycloneDX supports at least type on the relationships, but there is indication that won't happen. Regardless, if CycloneDX does get enhanced enough to support what Syft and Grype need here, any change will require an update in the forrmat conversion that Syft has, and nothing will be needed here, in Grype. As such I'm going to close this issue. Please let me know if there is anything I've missed here!

@kzantow kzantow closed this as not planned Won't fix, can't repro, duplicate, stale Nov 13, 2024
@github-project-automation github-project-automation bot moved this from Backlog to Done in OSS Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

3 participants