-
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(alpine): support unfixed vulnerabilities #1235
Conversation
pkg/detector/ospkg/alpine/alpine.go
Outdated
|
||
// This logic is for unfixed vulnerabilities, but Trivy DB doesn't have advisories for unfixed vulnerabilities | ||
// because Alpine just provides potentially vulnerable packages. It will cause a lot of false positives. | ||
if adv.FixedVersion == "" { |
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.
Current logic in Cybercenter is, we look for range.
If installedVersion >AffectedFrom && installedVersion <= AffectedTo{
vulns = append(vulns, vuln)
}
We need to add affectedFrom and affectedTo in trivy-db types.
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.
If we take the information from NVD, it is true. But we take it from Alpine Security Tracker which provides potentially vulnerable packages. We don't need to care about affectedFrom and affectedTo because secfixes tracker already compares versions with minimum and maximum versions.
https://gitlab.alpinelinux.org/kaniini/secfixes-tracker/-/blob/master/secfixes_tracker/models.py#L266-301
If we compare it again, it doesn't make sense. We just do the same thing twice.
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.
Okay. I get it. Please consider below scenario
- I have curl v1.5 package
- sec fix tracker says that 2.0 (current/latest version) is vulnerable
- Now, with this logic we will show v1.5 also as vulnerable.
there can be a chance that the installed version is not vulnerable. latest version of the package is only vulnerable.
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 see, but it is the same as fixed vulnerabilities, right? Alpine doesn't provide introduced versions, but fixed versions only. What do you think about it? Do we support the introduced versions only for unpatched vulnerabilities?
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.
okay, so all version below this version are vulnerable. Okay this is good
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 it is enough to support minimum versions. I've fixed that. While building DB, you need to insert minimum versions into the AffectedVersion field.
03eece3
Overview
Trivy DB doesn't insert security advisories for unfixed vulnerabilities, so Trivy cannot detect unfixed vulnerabilities at the moment. This PR is for the future.
Related PRs