Add locations onto packages read from Java native image SBOMs #4186
+7
−2
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.
Description
This PR adds support to the
graalvm-native-image-cataloger
to associate location data with the packages extracted from native images. Packages extracted are now associated withfile.Location
metadata, which refers to the native image.This enables users to easily trace packages back to the native image executable, simplifying vulnerability identification.
Example
Consider this scenario:
syft
scans a Docker container containing a native image namedapp
that has a dependency onorg.json
. Theorg.json
artifact currently looks like this in thesyft-json
format:This PR ensures the locations data is added:
Type of change
Checklist:
No new unit tests were added since the logic is trivial and there is currently no straightforward way to test it. Issue #3718 would enable end-to-end tests using native images with embedded SBOMs.