+
Skip to content

Add risk score to results and sort by risk by default #2587

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

Merged
merged 4 commits into from
May 5, 2025

Conversation

wagoodman
Copy link
Contributor

@wagoodman wagoodman commented Apr 9, 2025

Screenshot 2025-04-30 at 9 17 57 AM

This adds a new risk metric to the grype results, allowing us to show prioritized vulnerability mathces in a way that helps users remediate the most "important" vulnerabilities first.

The new risk metric is defined as risk ~= threat * severity, where:

  • threat is the EPSS score for the CVE matched with (between 0-1), or if present on the KEV list, then boosted by 5% (10% if the vulnerability is being used in ransomeware)
  • severity is the average CVSS base score + string severity on the vulnerability record (scaled to between 0-1)
  • the entire result is scaled to be a result from 0-100

Grype results, regardless of the format, will be sorted by highest-risk-first by default. Also the raw risk value will be added to the table and json output formats.

A new --sort-by <value> flag is being added with the following available options:

  • severity: sort by severity
  • epss: sort by EPSS percentile (aka, "threat")
  • risk: sort by risk score (default)
  • kev: just like risk, except that KEV entries are always above non-KEV entries
  • package: sort by package name, version, type
  • vulnerability: sort by vulnerability ID

Further adjustments have been made to the table output to help users with remediation:

  • add a new EPSS percentile column: teams typically need to balance risk tolerance and budget when choosing how many vulnerabilities to remediate from the full set of results. The EPSS documentation illustrates that selecting EPSS percentile cutoff could be a good way to maximize coverage and minimize effort relative to your teams needs. Exposing this raw metric makes following this advise much easier.

  • add KEV "pill" annotations next to table rows: though presence on the KEV list typically means that the vulnerability has a high risk score (thus will float to the top of the results) it does not guarantee that a) there are non-KEV entries above it, or b) it is within your teams remediation cutoff (however you choose this). From this perspective it makes sense to make this "exploited in the wild" dimension more visible and not depend on purely sorting methods. If you want a high coupling of KEV evidence and the sort method, I'd recommend using --sort-by kev.

  • emphasize the minimum version upgrade path: this is really de-emphasizing other upgrade paths and truncating the fixes column in the table output when there are several updates (the JSON output will show all values). This better focuses users toward useful information by removing flashier formatting.

Fixes #1511
Fixes #1973

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman force-pushed the add-match-sorting branch 4 times, most recently from 4659913 to b478866 Compare April 30, 2025 17:55
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman marked this pull request as ready for review April 30, 2025 18:30
@wagoodman wagoodman added the enhancement New feature or request label Apr 30, 2025
@wagoodman wagoodman changed the title Add risk score and sorting Add risk score to results and sort by risk by default Apr 30, 2025
@spiffcs spiffcs self-requested a review May 1, 2025 15:05
Copy link
Contributor

@spiffcs spiffcs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 with small nit comments

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman enabled auto-merge (squash) May 5, 2025 16:31
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman merged commit 2aedfb5 into main May 5, 2025
12 checks passed
@wagoodman wagoodman deleted the add-match-sorting branch May 5, 2025 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add EPSS metrics to grype results Show indication of known exploited vulnerabilities (from CISA)
2 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载