-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat(vuln): Add --detection-priority
flag for accuracy tuning
#7288
Conversation
Signed-off-by: knqyf263 <[email protected]>
Signed-off-by: knqyf263 <[email protected]>
Signed-off-by: knqyf263 <[email protected]>
Signed-off-by: knqyf263 <[email protected]>
Signed-off-by: knqyf263 <[email protected]>
Signed-off-by: knqyf263 <[email protected]>
Signed-off-by: knqyf263 <[email protected]>
Signed-off-by: knqyf263 <[email protected]>
Signed-off-by: knqyf263 <[email protected]>
Signed-off-by: knqyf263 <[email protected]>
Signed-off-by: knqyf263 <[email protected]>
Signed-off-by: knqyf263 <[email protected]>
Signed-off-by: knqyf263 <[email protected]>
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.
LGTM
Left a couple of comments.
Signed-off-by: knqyf263 <[email protected]>
Signed-off-by: knqyf263 <[email protected]>
| Poetry | poetry.lock | ✓ | Exclude | ✓ | - | | ||
| Package manager | File | Transitive dependencies | Dev dependencies | [Dependency graph][dependency-graph] | Position | [Detection Priority][detection-priority] | | ||
|-----------------|------------------|:-----------------------:|:----------------:|:------------------------------------:|:--------:|:----------------------------------------:| | ||
| pip | requirements.txt | - | Include | - | ✓ | - | |
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.
we can add table for conda environment.yml
files (this file list requirements.txt
)
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.
Did we forget to add environment.yaml
to the doc?
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.
Oh, I found it under OS. Do you remember why we put it here?
https://aquasecurity.github.io/trivy/v0.54/docs/coverage/os/conda/
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.
Conda
doesn't only contain Python
packages.
You can install OS packages.
Conda
is thus compilation of package manager (like apt
) and pip
.
I thought about adding Conda
to package managers, but we don't have pages for that.
So we decided to put Conda
in OS first.
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.
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.
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 have reconsidered this, but my personal definition of "OS packages" is a package distributed by an OS vendor, such as Red Hat and SUSE. Conda is simply building and distributing third-party software, which is different from an operating system. Bitnami does the same and it seems better to create a new category in addition to OS and Language. We should discuss it later.
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.
We just didn't have a suitable category.
But in general we can separate conda
+ bitnami
into a separate category.
Signed-off-by: knqyf263 <[email protected]>
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.
LGTM
Description
This PR introduces a new
--detection-priority
flag to Trivy, allowing users to control the balance between false positives and false negatives in vulnerability detection. This feature enhances Trivy's flexibility in different use cases and risk tolerance levels.Red Hat UBI 8
--detection-priority precise
Result
--detection-priority comprehensive
Result
cgr.dev/chainguard/argocd
--detection-priority precise
Result
--detection-priority comprehensive
Result
Notes
OS packages:
--detection-priority comprehensive
may not significantly increase true positive detections. Newly detected vulnerabilities are likely to be false positives or duplicates of vulnerabilities already detected via OS vendor advisories (see the above example).Language-specific packages:
--detection-priority comprehensive
uses the lower bound of version ranges for vulnerability detection. This detects possible vulnerabilities, but may lead to false positives if the actual version used is not at this lower bound.Key changes
--detection-priority
flag with two modes:precise
andcomprehensive
Implementation details
precise
mode (default): Focuses on reducing false positives, resulting in less noisy vulnerability reportscomprehensive
mode: Aims to detect more vulnerabilities, potentially including some false positives, for broader coverageTerminology
I chose
comprehensive
instead ofcoverage
for the following reasons:comprehensive
better describes the broader detection approachcoverage
has specific meanings in testing contextsRelated issues
--detection-priority
#7270Related PRs
Checklist