Skip to content

Commit 73f3e9e

Browse files
committed
update
1 parent 1cbf8f4 commit 73f3e9e

5 files changed

Lines changed: 27 additions & 27 deletions

File tree

unittests/scans/deepfence_threatmapper/ComplianceScanReport.xlsx renamed to unittests/scans/deepfence_threatmapper/compliance_report_newformat.xlsx

File renamed without changes.

unittests/scans/deepfence_threatmapper/MalwareScanReport.xlsx renamed to unittests/scans/deepfence_threatmapper/malware_report_newformat.xlsx

File renamed without changes.

unittests/scans/deepfence_threatmapper/SecretScanReport.xlsx renamed to unittests/scans/deepfence_threatmapper/secret_report_newformat.xlsx

File renamed without changes.

unittests/scans/deepfence_threatmapper/VulnerabilityScanReport.xlsx renamed to unittests/scans/deepfence_threatmapper/vulnerability_report_newformat.xlsx

File renamed without changes.

unittests/tools/test_deepfence_threatmapper_parser.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,39 +13,14 @@ def test_parse_file_compliance_report(self):
1313
self.assertEqual(findings[0].title, "Threatmapper_Compliance_Report-gdpr_3.6")
1414
self.assertEqual(findings[0].severity, "Info")
1515

16-
def test_parse_file_ComplianceScanReport(self):
17-
with (get_unit_tests_scans_path("deepfence_threatmapper") / "ComplianceScanReport.xlsx").open("rb") as testfile:
16+
def test_parse_file_compliance_report_newformat(self):
17+
with (get_unit_tests_scans_path("deepfence_threatmapper") / "compliance_report_newformat.xlsx").open("rb") as testfile:
1818
parser = DeepfenceThreatmapperParser()
1919
findings = parser.get_findings(testfile, Test())
2020
self.assertEqual(66, len(findings))
2121
self.assertEqual(findings[0].title, "Threatmapper_Compliance_Report-gdpr_3.4")
2222
self.assertEqual(findings[0].severity, "Info")
2323

24-
def test_parse_file_MalwareScanReport(self):
25-
with (get_unit_tests_scans_path("deepfence_threatmapper") / "MalwareScanReport.xlsx").open("rb") as testfile:
26-
parser = DeepfenceThreatmapperParser()
27-
findings = parser.get_findings(testfile, Test())
28-
self.assertEqual(66, len(findings))
29-
self.assertEqual(findings[0].title, "spyeye")
30-
self.assertEqual(findings[0].severity, "High")
31-
32-
def test_parse_file_SecretScanReport(self):
33-
with (get_unit_tests_scans_path("deepfence_threatmapper") / "SecretScanReport.xlsx").open("rb") as testfile:
34-
parser = DeepfenceThreatmapperParser()
35-
findings = parser.get_findings(testfile, Test())
36-
self.assertEqual(15, len(findings))
37-
self.assertEqual(findings[0].title, "index-username_and_password_in_uri in /var/lib/host-containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/1/fs/usr/lib64/python2.7/urllib2.py")
38-
self.assertEqual(findings[0].severity, "High")
39-
40-
def test_parse_file_VulnerabilityScanReport(self):
41-
with (get_unit_tests_scans_path("deepfence_threatmapper") / "VulnerabilityScanReport.xlsx").open("rb") as testfile:
42-
parser = DeepfenceThreatmapperParser()
43-
findings = parser.get_findings(testfile, Test())
44-
self.assertEqual(254, len(findings))
45-
self.assertEqual(findings[0].title, "Threatmapper_Vuln_Report-CVE-2005-2541")
46-
self.assertEqual(findings[0].severity, "Critical")
47-
self.assertEqual(findings[0].cve, "CVE-2005-2541")
48-
4924
def test_parse_file_malware_report(self):
5025
with (get_unit_tests_scans_path("deepfence_threatmapper") / "malware_report.xlsx").open("rb") as testfile:
5126
parser = DeepfenceThreatmapperParser()
@@ -55,6 +30,14 @@ def test_parse_file_malware_report(self):
5530
self.assertEqual(findings[0].severity, "Low")
5631
self.assertEqual(findings[0].file_path, "/tmp/Deepfence/YaraHunter/df_db09257b02e615049e0aecc05be2dc2401735e67db4ab74225df777c62c39753/usr/sbin/mkfs.cramfs")
5732

33+
def test_parse_file_malware_report_newformat(self):
34+
with (get_unit_tests_scans_path("deepfence_threatmapper") / "malware_report_newformat.xlsx").open("rb") as testfile:
35+
parser = DeepfenceThreatmapperParser()
36+
findings = parser.get_findings(testfile, Test())
37+
self.assertEqual(66, len(findings))
38+
self.assertEqual(findings[0].title, "spyeye")
39+
self.assertEqual(findings[0].severity, "High")
40+
5841
def test_parse_file_secret_report(self):
5942
with (get_unit_tests_scans_path("deepfence_threatmapper") / "secret_report.xlsx").open("rb") as testfile:
6043
parser = DeepfenceThreatmapperParser()
@@ -64,6 +47,14 @@ def test_parse_file_secret_report(self):
6447
self.assertEqual(findings[0].severity, "High")
6548
self.assertEqual(findings[0].file_path, "usr/share/doc/curl-8.3.0/TheArtOfHttpScripting.md")
6649

50+
def test_parse_file_secret_report_newformat(self):
51+
with (get_unit_tests_scans_path("deepfence_threatmapper") / "secret_report_newformat.xlsx").open("rb") as testfile:
52+
parser = DeepfenceThreatmapperParser()
53+
findings = parser.get_findings(testfile, Test())
54+
self.assertEqual(15, len(findings))
55+
self.assertEqual(findings[0].title, "index-username_and_password_in_uri in /var/lib/host-containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/1/fs/usr/lib64/python2.7/urllib2.py")
56+
self.assertEqual(findings[0].severity, "High")
57+
6758
def test_parse_file_vulnerability_report(self):
6859
with (get_unit_tests_scans_path("deepfence_threatmapper") / "vulnerability_report.xlsx").open("rb") as testfile:
6960
parser = DeepfenceThreatmapperParser()
@@ -73,3 +64,12 @@ def test_parse_file_vulnerability_report(self):
7364
self.assertEqual(findings[0].severity, "Low")
7465
self.assertEqual(findings[0].mitigation, "2.5-10.amzn2.0.1")
7566
self.assertEqual(findings[0].cve, "CVE-2021-36084")
67+
68+
def test_parse_file_vulnerability_report_newformat(self):
69+
with (get_unit_tests_scans_path("deepfence_threatmapper") / "vulnerability_report_newformat.xlsx").open("rb") as testfile:
70+
parser = DeepfenceThreatmapperParser()
71+
findings = parser.get_findings(testfile, Test())
72+
self.assertEqual(254, len(findings))
73+
self.assertEqual(findings[0].title, "Threatmapper_Vuln_Report-CVE-2005-2541")
74+
self.assertEqual(findings[0].severity, "Critical")
75+
self.assertEqual(findings[0].cve, "CVE-2005-2541")

0 commit comments

Comments
 (0)