-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Import EPSS data from Anchore Grype scans #12639
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: dev
Are you sure you want to change the base?
Conversation
Grype added EPSS metrics in v0.92.0, see: https://github.com/anchore/grype/releases/tag/v0.92.0 Adds EPSS support with a test based on the same busybox image used in anchore_grype/no_vuln.json. Also removes the hardcoded CWE value as Grype does not support CWE data.
This pull request contains a minor input validation weakness in the
Input Validation Weakness in
|
Vulnerability | Input Validation Weakness |
---|---|
Description | The get_epss_values method lacks comprehensive input validation when parsing EPSS scores from external JSON data. While the method uses a try-except block to handle type conversion, it does not perform explicit validation of the EPSS score and percentile values' format, range, or content. This could potentially allow malformed input to be processed without sufficient checks. |
django-DefectDojo/dojo/tools/anchore_grype/parser.py
Lines 210 to 229 in 27779e4
return vector | |
return None | |
def get_epss_values(self, vuln_id, epss_list): | |
if isinstance(epss_list, list): | |
for epss_data in epss_list: | |
if epss_data.get("cve") != vuln_id: | |
continue | |
try: | |
epss_score = float(epss_data.get("epss")) | |
epss_percentile = float(epss_data.get("percentile")) | |
except (TypeError, ValueError): | |
pass | |
else: | |
return epss_score, epss_percentile | |
return None, None | |
def get_vulnerability_ids(self, vuln_id, related_vulnerabilities): | |
vulnerability_ids = [] | |
if vuln_id: |
All finding details can be found in the DryRun Security Dashboard.
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.
Approved
Description
Grype added EPSS metrics in v0.92.0, see:
https://github.com/anchore/grype/releases/tag/v0.92.0
Adds EPSS support with a test based on the same busybox image used in anchore_grype/no_vuln.json.
Also removes the hardcoded CWE value as Grype does not support CWE data.
Test results
Adds
unittests.tools.test_anchore_grype_parser.TestAnchoreGrypeParser.test_grype_epss_values
.Modifies
unittests.tools.test_anchore_grype_parser.TestAnchoreGrypeParser.test_check_all_fields
to reflect CWE change.Fixes typo in
unittests.tools.test_anchore_grype_parser.TestAnchoreGrypeParser.test_grype_parser_with_one_critical_vuln_has_one_findings
.Documentation
Updates documentation with information on scanning SBOMs and newer style of getting Grype JSON output written to file.
Checklist
This checklist is for your information.
dev
.dev
.bugfix
branch.