Add more detailed vulnerability status on unfixed vulnerabilities #4763
Labels
kind/feature
Categorizes issue or PR as related to a new feature.
scan/vulnerability
Issues relating to vulnerability scanning
Milestone
Description
Currently, Trivy has only two statuses for vulnerabilities: "fixed" and "unfixed". While these labels provide a basic understanding of the vulnerability status, they do not provide sufficient detail for users to understand the current state of a given vulnerability, especially when dealing with unfixed vulnerabilities.
A more detailed status system could provide much-needed context and guidance for users. As an example, Red Hat has implemented a system of vulnerability status attributes that includes:
These statuses also comply with the VEX spec.
Incorporating these statuses into Trivy would allow users to better understand the state of a given vulnerability, reducing the need for them to search through comments and other metadata.
Implementation Details
I'd suggest implementing the following items.
Add a status field to each vulnerability in the JSON format:
We should add a
Status
field to the JSON format for each vulnerability. This field will carry one of the following values: "affected", "not_affected", "will_not_fix", etc.Add a
Status
column to the table format:For those users who prefer to view the data in a table format, we should add a
Status
column. This column will display the status of each vulnerability, providing a quick and easy way for users to get the information they need.Add a
--status
flag for status filteringTo make it easier for users to see needed vulnerabilities, we should add a
--status
flag that allows users to filter vulnerabilities based on their status. For example, a user could use--status fixed,affected
to only display vulnerabilities that are fixed or affected. It is specifically useful to filter out "will_not_fix" vulnerabilities as they are usually negligible.Make
--ignore-unfixed
an alias for--status fixed
For backward compatibility and ease of use, we keep the "--ignore-unfixed" flag, but make it an alias for
--status fixed
.This will ensure that users who are familiar with the old command can continue to use it as they always have.The text was updated successfully, but these errors were encountered: