Skip to content

Commit

Permalink
t
Browse files Browse the repository at this point in the history
  • Loading branch information
pna-nca committed Jul 31, 2024
1 parent dfc261b commit 32b582d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions dojo/tools/trivy_operator/checks_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ def handle_checks(self, endpoint, service, checks, test):
for message in check.get("messages"):
details += f"{message}\n"

scope = ""
scope = "undefined"
if check.get("scope"):
scope_type = check.get("scope").get("type")
scope_value = check.get("scope").get("value")
scope=f"{scope_type} {scope_value}"
scope = f"{scope_type} {scope_value}"

description = CHECK_DESCRIPTION_TEMPLATE.format(
category=check.get("category"),
Expand Down
7 changes: 6 additions & 1 deletion dojo/tools/trivy_operator/vulnerability_handler.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from dojo.models import Finding

DESCRIPTION_TEMPLATE = """{title}
**Details:**
{description}
**Fixed version:** {fixed_version}
CVE published on: {published_date}
Expand Down Expand Up @@ -56,11 +57,15 @@ def handle_vulns(self, endpoint, service, vulnerabilities, test):
else:
file_path = None

vuln_description = "no details"
if len(vulnerability.get("description", "")) > 0:
vuln_description = vulnerability.get("description")

description = DESCRIPTION_TEMPLATE.format(
title=vulnerability.get("title"),
fixed_version=mitigation,
published_date=vulnerability.get("publishedDate"),
description=vulnerability.get("description")
description=vuln_description
)

title = f"{vuln_id} {package_name} {package_version}"
Expand Down

0 comments on commit 32b582d

Please sign in to comment.