Skip to content

Commit

Permalink
Optimize EPSS
Browse files Browse the repository at this point in the history
Signed-off-by: Tushar Goel <[email protected]>
  • Loading branch information
TG1999 committed Jan 21, 2025
1 parent e7edab3 commit 2c46dc5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions vulnerabilities/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,15 @@ def get_context_data(self, **kwargs):
severity_vectors.append({"vector": vector_values, "origin": severity.url})
except (CVSS2MalformedError, CVSS3MalformedError, CVSS4MalformedError, NotImplementedError):
logging.error(f"CVSSMalformedError for {severity.scoring_elements}")

epss_severity = vulnerability.severities.filter(scoring_system='epss').first()
epss_data = None
if epss_severity:
epss_data = {
"percentile": epss_severity.scoring_elements,
"score": epss_severity.value,
"published_at": epss_severity.published_at,
}

context.update(
{
Expand All @@ -220,6 +229,7 @@ def get_context_data(self, **kwargs):
"weaknesses": weaknesses_present_in_db,
"status": vulnerability.get_status_label,
"history": vulnerability.history,
"epss_data": epss_data
}
)
return context
Expand Down

0 comments on commit 2c46dc5

Please sign in to comment.