Skip to content

Commit 843188e

Browse files
🔨 Merge the MobSF scanner (#12501)
* 🔨 Merge the MobSF scanner * add migration * udpate * Update 0229_merge_mobsf.py * udpate * Update settings.dist.py * update * update * update docs * Update 2.48.md * update upgrade notes * Update 2.48.md * Update 2.48.md * fix * update * update * update * update docs
1 parent 90214e2 commit 843188e

13 files changed

Lines changed: 566 additions & 583 deletions

File tree

docs/content/en/connecting_your_tools/parsers/file/mobsf.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
title: "MobSF Scanner"
33
toc_hide: true
44
---
5-
Export a JSON file using the API, api/v1/report\_json.
5+
"Mobsfscan Scan" has been merged into the "MobSF Scan" parser. The "Mobsfscan Scan" scan_type has been retained to keep deduplication working for existing Tests, but users are encouraged to move to the "MobSF Scan" scan_type.
6+
7+
Export a JSON file using the API, api/v1/report\_json and import it to Defectdojo or import a JSON report from <https://github.com/MobSF/mobsfscan>
68

79
### Sample Scan Data
810
Sample MobSF Scanner scans can be found [here](https://github.com/DefectDojo/django-DefectDojo/tree/master/unittests/scans/mobsf).

docs/content/en/connecting_your_tools/parsers/file/mobsfscan.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

docs/content/en/open_source/upgrading/2.52.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ This release introduces more important changes to the Helm chart configuration:
1111

1212
### Breaking changes
1313

14+
#### Merge of MobSF parsers
15+
16+
Mobsfscan Scan" has been merged into the "MobSF Scan" parser. The "Mobsfscan Scan" scan_type has been retained to keep deduplication working for existing Tests, but users are encouraged to move to the "MobSF Scan" scan_type.
17+
1418
#### Security context
1519

1620
This Helm chart extends security context capabilities to all deployed pods and containers.

dojo/settings/settings.dist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,7 @@ def saml2_attrib_map_format(din):
13571357
"HCLAppScan XML": ["title", "description"],
13581358
"HCL AppScan on Cloud SAST XML": ["title", "file_path", "line", "severity"],
13591359
"KICS Scan": ["file_path", "line", "severity", "description", "title"],
1360-
"MobSF Scan": ["title", "description", "severity"],
1360+
"MobSF Scan": ["title", "description", "severity", "file_path"],
13611361
"MobSF Scorecard Scan": ["title", "description", "severity"],
13621362
"OSV Scan": ["title", "description", "severity"],
13631363
"Snyk Code Scan": ["vuln_id_from_tool", "file_path"],

dojo/tools/mobsf/api_report_json.py

Lines changed: 388 additions & 0 deletions
Large diffs are not rendered by default.

dojo/tools/mobsf/parser.py

Lines changed: 9 additions & 384 deletions
Large diffs are not rendered by default.
Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import hashlib
2-
import json
32
import re
43

54
from dojo.models import Finding
65

76

8-
class MobsfscanParser:
7+
class MobSFjsonreport:
98

109
"""A class that can be used to parse the mobsfscan (https://github.com/MobSF/mobsfscan) JSON report file."""
1110

@@ -15,19 +14,7 @@ class MobsfscanParser:
1514
"INFO": "Low",
1615
}
1716

18-
def get_scan_types(self):
19-
return ["Mobsfscan Scan"]
20-
21-
def get_label_for_scan_types(self, scan_type):
22-
return "Mobsfscan Scan"
23-
24-
def get_description_for_scan_types(self, scan_type):
25-
return "Import JSON report for mobsfscan report file."
26-
27-
def get_findings(self, filename, test):
28-
data = json.load(filename)
29-
if len(data.get("results")) == 0:
30-
return []
17+
def get_findings(self, data, test):
3118
dupes = {}
3219
for key, item in data.get("results").items():
3320
metadata = item.get("metadata")

dojo/tools/mobsfscan/__init__.py

Whitespace-only changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)