cyclonedx: import firmware-typed components as packages#4855
Open
ChrisJr404 wants to merge 1 commit into
Open
Conversation
The CycloneDX decoder was filtering on a hard-coded set of component types (application/framework/library/machine-learning-model). Anything else — including "firmware" — fell through silently, so a BOM describing u-boot or other firmware ended up with no packages and grype reported no matches (anchore/grype#2537). @kzantow confirmed in the issue thread that firmware should be included and gave this section as the spot to update. Add ComponentTypeFirmware to the case list and a regression test that constructs a single-firmware-component BOM and asserts the decoded SBOM contains the package. Closes anchore/grype#2537 Signed-off-by: Chris (ChrisJr404) <11917633+ChrisJr404@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes anchore/grype#2537.
The CycloneDX decoder filters on a hard-coded set of component types (
application/framework/library/machine-learning-model). Anything else — includingfirmware— fell through silently, so a BOM describing u-boot or other firmware ended up with no packages, and grype reported no matches even though valid CVEs exist.@kzantow confirmed in the issue:
Changes
syft/format/internal/cyclonedxutil/helpers/decoder.go: addcyclonedx.ComponentTypeFirmwarealongsideApplication/Framework/Library/MachineLearningModelincollectPackages.decoder_test.go: newTest_decode_includesFirmwareComponents— constructs a single-firmware-component BOM and asserts the package is imported with the right name and version.Verification