Open
Conversation
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.
What does this PR do?
Adds support for scanning Docker Hardened Images via parsing of SPDX SBOM files. Previously, packages that were only referenced in SPDX were ignored when scanning, leaving an incomplete dependency graph.
Where should the reviewer start?
SPDX parsing was added as a new analysis type under
lib/analyzer/package-managersThe core logic exists in
lib/analyzer/package-managers/spdx.ts, and is used inlib/inputs/spdx/static.ts,lib/analyzer/static-analyzer.ts, andlib/parser/index.ts. The latter contains logic for merging and deduplicating packages retrieved from SPDX with those from other sources.How should this be manually tested?
You can verify that SPDX parsing is functioning by scanning
snyklabs/dhi-python:3.13.8-debian13-devwhich has two packages which are only found within the SPDX SBOM,pkg-binutils@2.45-debian13andpython@3.13.8.snyk-docker-pluginwithnpm i && npm run buildclito use local version ofsnyk-docker-pluginSearch for
pkg-binutils@2.45-debian13andpython@3.13.8under dependencies- nothing should come upRun the following command
pkg-binutils@2.45-debian13andpython@3.13.8again- you should now see them bothWhat are the relevant tickets?
The relevant JIRA ticket is CN-561
Screenshots
Results when running
snyk monitor snyklabs/dhi-python:3.13.8-debian13-devbefore SPDX parsingResults when running
snyk monitor snyklabs/dhi-python:3.13.8-debian13-devafter SPDX parsingAdditional questions