-
Notifications
You must be signed in to change notification settings - Fork 104
Make vulnerabilities scanner less strict #669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
368d448
to
a389f25
Compare
return vulnerabilities.critical() > 0 || vulnerabilities.high() > 0; | ||
} | ||
|
||
public boolean isLessVulnerable(DockerImage other) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do agree that, in general, a critical vulnerability has more priority that any number of high ones. However, since we are not just comparing two different scenarios but doing an upgrade, how about introducing a sanity check that prevents us from introducing a container with 1 less critical and thousands more high-scored vulns without noticing it?
After all, if we decide on making such a tradeoff, we can always adapt the heuristic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the only solution that is correct in 100% cases is that we only accept a new image if it contains less critical and less high vulnerabilities. In all other combinations we can't determine programmatically if the image is acceptable candidate for update or not (we will still rely on a manual check of the image).
What do you think?
if (numberOfHigh > 4 || numberOfCritical > 0) { | ||
shouldFail = true; | ||
// parse Grype output | ||
ByteArrayInputStream inputStream = new ByteArrayInputStream(execOutput.toByteArray()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The grype output is in json format. Can't we parse it using a json parse? It would make the vulns detection more reliable to output changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refactored that part ✔️
Please take a look again
a389f25
to
efa2077
Compare
What does this PR do?
Make vulnerabilities scanner less strict in order to accept slightly vulnerable images that are less vulnerable than the currently existing allowed images.
Fixes: #540