Skip to content

Commit

Permalink
Set finding title to component name as this makes more sense within t…
Browse files Browse the repository at this point in the history
…he UI display
  • Loading branch information
mwager committed Apr 26, 2024
1 parent 9345115 commit fb052cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion dojo/tools/kiuwan_sca/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,17 @@ def get_findings(self, filename, test):

finding = Finding(test=test)
finding.unique_id_from_tool = row["id"]
finding.title = row["cve"]
finding.cve = row["cve"]
finding.description = row["description"]
finding.severity = self.SEVERITY[row["securityRisk"]]

if "components" in row and len(row["components"]) > 0:
finding.component_name = row["components"][0]["artifact"]
finding.component_version = row["components"][0]["version"]
finding.title = finding.component_name

if not finding.title:
finding.title = row["cve"]

if "cwe" in row:
try:
Expand Down
2 changes: 1 addition & 1 deletion unittests/tools/test_kiuwan_sca_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_correct_mapping(self):
findings = parser.get_findings(testfile, Test())

finding1 = findings[0]
self.assertEqual(finding1.title, "CVE-2021-30468")
self.assertEqual(finding1.title, "org.apache.cxf:cxf-rt-ws-policy")
self.assertEqual(finding1.cve, "CVE-2021-30468")
self.assertEqual(finding1.severity, "High")
self.assertEqual(finding1.component_name, "org.apache.cxf:cxf-rt-ws-policy")
Expand Down

0 comments on commit fb052cc

Please sign in to comment.