fix: support docker hardened images #6320
Open
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.
Pull Request Submission Checklist
Highlights breaking API changes (if applicable)n/aIncludes manual testing instructions (if necessary)n/aUpdates relevant GitBook documentation (PR link: ___)n/aWhat does this PR do?
Updates
snyk-docker-pluginto version8.12.0to add support for Docker Hardened Images (DHI) package identification. DHI packages now use thedhinamespace in their PURLs instead of the distro namespace (debian), allowing the vulnerability service to correctly match vulnerabilities to the package.Example PURL change:
pkg:deb/debian/[email protected]+deb12u8?distro=debian-bookwormpkg:deb/dhi/[email protected]+deb12u8?distro=debian-bookwormThis prevents false positives from matching DHI's patched packages against vulnerability data for unpatched distro packages.
Where should the reviewer start?
test/tap/cli-test/cli-test.docker-dhi.spec.tsto understand the expected behaviorpackage.jsondependency update forsnyk-docker-pluginThe actual DHI detection logic (parsing the
Maintainerfield from dpkg database) lives insnyk-docker-plugin- this PR just integrates that change.What's the product update that needs to be communicated to CLI users?
The CLI now correctly identifies Docker Hardened Images (DHI) packages through snyk-docker-plugin. This prevents false positive vulnerability reports on DHI's patched packages. No action required from users - the detection happens automatically when scanning DHI containers.
Risk assessment (Low)?
Low
snyk-docker-plugindependency updateMaintainerfield parsingAny background context you want to provide?
Docker Hardened Images patches binaries in their container images to fix vulnerabilities. Without namespace differentiation, Snyk was incorrectly matching these patched packages against the standard distro vulnerability feed, causing false positives.
The vulnerability service maintains a separate feed for DHI packages, but needs the PURL namespace (
dhivsdebian) to determine which feed to query.What are the relevant tickets?
CN-488
snyk-docker-plugin diff
snyk/snyk-docker-plugin@v8.10.2...main
Only a few lines changed, the rest of the changes are test fixures and tests