Skip to content

Commit 7d3b999

Browse files
🎉 Add fix_available information to jfrog (#13115)
1 parent 8e949da commit 7d3b999

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

dojo/tools/jfrogxray/parser.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def get_item(vulnerability, test):
7676
cvssv3 = None
7777
cvss_v3 = "No CVSS v3 score."
7878
mitigation = None
79+
fix_available = False
7980
extra_desc = ""
8081
# Some entries have no CVE entries, despite they exist. Example
8182
# CVE-2017-1000502.
@@ -95,6 +96,7 @@ def get_item(vulnerability, test):
9596
mitigation += "\n".join(
9697
vulnerability["component_versions"]["fixed_versions"],
9798
)
99+
fix_available = True
98100

99101
if "vulnerable_versions" in vulnerability["component_versions"]:
100102
extra_desc = "\n**Versions that are vulnerable:**\n"
@@ -160,6 +162,7 @@ def get_item(vulnerability, test):
160162
static_finding=True,
161163
dynamic_finding=False,
162164
cvssv3=cvssv3,
165+
fix_available=fix_available,
163166
)
164167
if vulnerability_ids:
165168
finding.unsaved_vulnerability_ids = vulnerability_ids

unittests/tools/test_jfrogxray_parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def test_parse_file_with_one_vuln(self):
1717
self.assertEqual(1, len(item.unsaved_vulnerability_ids))
1818
self.assertEqual("CVE-2018-14600", item.unsaved_vulnerability_ids[0])
1919
self.assertEqual(787, item.cwe)
20+
self.assertEqual(True, item.fix_available)
2021

2122
def test_parse_file_with_many_vulns(self):
2223
testfile = (get_unit_tests_scans_path("jfrogxray") / "many_vulns.json").open(encoding="utf-8")

0 commit comments

Comments
 (0)