Conversation
This version of resolving the dockerfile attribution bug does so with a reduced impact on the downstream CLI and registry logic. It does so by expanding both the dockerfile packages and auto-detected packages, ensuring those facts retain the same intent. Internal to snyk-docker-plugin, dependencies are always referenced by full name (i.e. zlib/zlib) when it is available, preventing earlier bugs caused by splitting the source segment of the name.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
61543fc to
7349c56
Compare
This comment has been minimized.
This comment has been minimized.
|
snyk-pr-review-bot's "Inconsistent Legacy Compatibility" comment is incorrect. The legacy expansion for |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
mtstanley-snyk
left a comment
There was a problem hiding this comment.
couple comments/qs, otherwise lgtm 🎉. Did we decide on a rollout for this? If not, might be worth a short section in your doc on impact and then can start a thread with team on breaking vs non-breaking change.
My understanding of the impact is:
- no(?) change to
snyk container test snyk container monitor -- exclude-base-...now excludes things, whereas before the command would have run but not excluded anything- monitored container projects from CLI where dockerfile was provided would now attribute a lot more vulns to user installed
- monitored container projects from CLI without dockerfile should be no(?) change
Mock analysis incorrectly had a second dummy node added as a dependency of the root node.
PR Reviewer Guide 🔍
|
Doc has been updated to start the rollout discussion. On # 4 above, monitored container projects without dockerfile will also see an increase in vulns attributed to the dockerfile. Previously there was no path to attribute vulns to the dockerfile, now Also, the impact would not be limited to the CLI assuming DRA and |
|
Changes lgtm, let's confirm the rollout plan here and then I'll 🚢 |
What does this PR do?
This PR fixes 2 related issues:
--exclude-base-image-vulnshas been disabled in SDP resulting in the flag not being effective incontainer monitormode.Where should the reviewer start?
buildResponseorchestrationcollectDockerfilePkgs, logic is inlined.getUserInstructionDepsup front (in place)dockerfilePkgsasdockerfileAnalysis?.dockerfilePackages ?? autoDetected…dockerfilePackagesand uses the result to conduct annotation and exclusion (matches CLI logic).depsAnalysis.depTree.dependencies = finalDeps)excludeBaseImageDepsextractDockerfileDeps, filtering is inlined.annotateLayerIdsHow should this be manually tested?
Unit tests have been added to demonstrate the new behavior.
The changes are most easily observed in monitor mode. Creating a small image with packages installed via a run instruction should show those dependencies attributed to the install instruction. Any base image vulns should be filterable, in test or monitor mode.
An example is shown below.
Any background context you want to provide?
More context provided in this write-up.
What are the relevant tickets?
Screenshots
Current Behavior:

PR Behavior:
