Skip to content

Commit

Permalink
Refactor mobsf parser for v4 reports
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Maryushkin committed Oct 16, 2024
1 parent c34958e commit 3d091f5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dojo/tools/mobsf/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ def get_findings(self, filename, test):
field_value = str(data.get("appsec", {}).get(field, ""))

if field_value:
test_description = "{0} **{1}:** {2}\n".format(test_description, field, field_value)
test_description = f"{test_description} **{field}:** {field_value}\n"

for field in main_fields_for_test_desc:

field_value = str(data.get(field, ""))

if field_value:
test_description = "{0} **{1}:** {2}\n".format(test_description, field, field_value)
test_description = f"{test_description} **{field}:** {field_value}\n"

test.description = test_description

Expand All @@ -81,13 +81,13 @@ def get_findings(self, filename, test):
title = str(mobsf_finding.get("title", ""))
description = str(mobsf_finding.get("description", ""))

unique_key = "{0} - {1} - {2} - {3}".format(finding_severity, section, title, description)
unique_key = f"{finding_severity}-{section}-{title}-{description}"

finding = Finding(
title=title,
cwe=919, # Weaknesses in Mobile Applications
test=test,
description="**Category:** {0}\n\n{1}".format(section, description),
description=f"**Category:** {section}\n\n{description}",
severity=finding_severities[finding_severity],
references=None,
date=find_date,
Expand Down

0 comments on commit 3d091f5

Please sign in to comment.