-
Notifications
You must be signed in to change notification settings - Fork 599
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
Dependency graph of BOMs generated with Syft is incomplete due to missing root node #3071
Comments
Hi @t-k-u thanks for the issue! We'll try to discuss this at an upcoming community meeting. In general, Syft doesn't guarantee that there will always be a root package because Syft doesn't assume that the thing scanned is a single artifact. For example, what is the "root" of |
@t-k-u when scanning |
Without any expertise, but my expectation would be that alpine is the root, if alpine as a "package" is the source of the SBOM. |
Hey @t-k-u, we discussed this issue this week on the livestream and we think it would be ok to add an option for Syft to generate these dependencies and add them to CycloneDX output. As has been discussed elsewhere, we do not believe it is accurate to include dependency relationships in this case, but CycloneDX does not provide any other relationship types that would be more appropriate (such as Note for anyone implementing this -- the encoders have configurations that it would be simple to pass options for, see here: https://github.com/anchore/syft/blob/main/syft/format/encoders.go#L36-L53. Other note: CycloneDX allows for nesting of components. It is possible a better/more accurate solution would be to nest all components in the metadata.component.components, but this has the potential to prevent other tools from properly reading the Syft generated files, too. |
Hello, |
Hi @m4nch0t - thanks for the ping! It seems like @kzantow 's comment resolves the remaining friction. This is in our ready column and anyone is welcome to work on it! We just haven't been able to pick it up yet amid other priorities. Am I right in understanding that this blocks using Dependency Track with Syft-generated CycloneDX JSON? If so I agree that this is fairly high priority. I don't know Dependency Track well. Are there any workarounds you can use in the meantime? |
Hi! This might not sound like much. However, it gets interesting when we merge two SBOMs - say one for the base container, and one for the artifact copied in the container - into a singular SBOM. In this case, it would be nice to know if a component is used by the base container or the artifact (in short: do we need to update the container, or the software component?) |
What happened:
After uploading SBOMs in Dependency Track (v4.11.5), created by syft, we encountered the problem that the dependency graphs could not be displayed.
We tested it with the latest alpine version:
This results in the following SBOM
sbom_diy.json
The logs do not include anything noticeable:
What you expected to happen:
A complete (displayable) Dependency Graph
Steps to reproduce the issue:
Anything else we need to know?:
We already created an issue for Dependency Track. It was determined that it is not a problem in DT, but in the SBOM itself, as it has a missing root.
Environment:
syft version
: v1.9.0cat /etc/os-release
or similar): -The text was updated successfully, but these errors were encountered: