You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an SBOM which includes components from Syft-generated SBOMs for containers of multiple architectures of the same distribution. This results in many warnings like this:
[0000] WARN merging packages have with different pURLs: "abd9052a56926a5f"="pkg:deb/ubuntu/[email protected]?arch=amd64&distro=ubuntu-22.04" vs "abd9052a56926a5f"="pkg:deb/ubuntu/[email protected]?arch=arm64&distro=ubuntu-22.04"
[0000] WARN merging packages have with different pURLs: "e6575b016bbfc860"="pkg:deb/ubuntu/[email protected]?arch=amd64&distro=ubuntu-22.04&upstream=dbus" vs "e6575b016bbfc860"="pkg:deb/ubuntu/[email protected]?arch=arm64&distro=ubuntu-22.04&u
Looking at the code in question, I suspect this might be fine because the relevant information for those packages should be the same, but I'm not sure.
What you expected to happen:
No warnings. I don't have any expectation as to whether these packages should be merged or not, but either way it shouldn't warn.
How to reproduce it (as minimally and precisely as possible):
Here's an SBOM you can use directly: merged.json
Run grype as grype sbom:merged.json --distro ubuntu:22.04 (no config file needed). This minimal example only produces a warning for bash.
If you want to recreate that SBOM, here are the steps:
Use a trivial Dockerfile:
FROM ubuntu:22.04
And create some simple Docker containers:
# Some Docker versions get confused about having the same base image for# non-native platforms, so just tell them to always pull.
docker build --platform linux/amd64 . --tag tmp_grype_repro_amd64 --pull --no-cache
docker build --platform linux/arm64 . --tag tmp_grype_repro_arm64 --pull --no-cache
syft scan --output cyclonedx-json=amd64_sbom.json docker:tmp_grype_repro_amd64
syft scan --output cyclonedx-json=arm64_sbom.json docker:tmp_grype_repro_arm64
Agreed, grype (or really behind the scenes, syft here) should really be honoring all components within the given SBOM and not attempt to merge components together to begin with. There is an existing issue that I think is relevant here: #1265 . What I think should be happening is syft/grype when decoding an SBOM should have original ID references from the SBOM provided instead of deriving new IDs. In the current case the syft lib is generating IDs for these two packages and there isn't enough information to discern a difference (since PURLs are not considered for the ID generation operation), thus the same ID is created and syft attempts to merge them.
What happened:
I have an SBOM which includes components from Syft-generated SBOMs for containers of multiple architectures of the same distribution. This results in many warnings like this:
Looking at the code in question, I suspect this might be fine because the relevant information for those packages should be the same, but I'm not sure.
What you expected to happen:
No warnings. I don't have any expectation as to whether these packages should be merged or not, but either way it shouldn't warn.
How to reproduce it (as minimally and precisely as possible):
Here's an SBOM you can use directly: merged.json
Run grype as
grype sbom:merged.json --distro ubuntu:22.04
(no config file needed). This minimal example only produces a warning forbash
.If you want to recreate that SBOM, here are the steps:
Use a trivial Dockerfile:
And create some simple Docker containers:
Then merge them using this script:
Anything else we need to know?:
Environment:
grype version
: grype 0.87.0cat /etc/os-release
or similar): Multiple Ubuntu 22.04 containers, both amd64 and arm64Additional environment:
syft version
: syft 1.18.1The text was updated successfully, but these errors were encountered: