django-DefectDojo icon indicating copy to clipboard operation
django-DefectDojo copied to clipboard

Sonarqube API import fails when using OWASP dependency-check

Open enidevops opened this issue 4 years ago • 0 comments

Bug description The Sonarqube API import doesn't work when results from OWASP dependency-check are integrated into Sonarqube. If the dependency-check report is removed from the Sonarqube project, the import works without any problems.

Deployment method

  • [ ] Docker Compose
  • [X ] Kubernetes
  • [ ] GoDojo

Environment information

  • DefectDojo: 2.10.0
  • Sonarqube: 9.4
  • OWASP dependency-check: 7.1.0
  • OWASP sonar-dependency-check: 3.0.1

Logs

/usr/local/lib/python3.8/site-packages/django/db/models/fields/__init__.py:1358: RuntimeWarning: DateTimeField Test.target_start received a naive datetime (2022-05-28 00:00:00) while time zone support is active.
  warnings.warn("DateTimeField %s.%s received a naive datetime "
/usr/local/lib/python3.8/site-packages/django/db/models/fields/__init__.py:1358: RuntimeWarning: DateTimeField Test.target_end received a naive datetime (2022-05-28 00:00:00) while time zone support is active.
  warnings.warn("DateTimeField %s.%s received a naive datetime "
[28/May/2022 15:20:09] ERROR [dojo.tools.sonarqube_api.importer:230] 'vulnerabilityDescription'
Traceback (most recent call last):
  File "/app/./dojo/tools/sonarqube_api/importer.py", line 191, in import_hotspots
    description = self.clean_rule_description_html(rule['vulnerabilityDescription'])
KeyError: 'vulnerabilityDescription'
[28/May/2022 15:20:09] ERROR [dojo.engagement.views:637] 'NoneType' object is not iterable
Traceback (most recent call last):
  File "/app/./dojo/engagement/views.py", line 622, in import_scan_results
    test, finding_count, closed_finding_count, _ = importer.import_scan(scan, scan_type, engagement, user, environment, active=active, verified=verified, tags=tags,
  File "/app/./dojo/importers/importer/importer.py", line 297, in import_scan
    parsed_findings = parser.get_findings(scan, test)
  File "/app/./dojo/tools/sonarqube_api/parser.py", line 25, in get_findings
    return SonarQubeApiImporter().get_findings(json_output, test)
  File "/app/./dojo/tools/sonarqube_api/importer.py", line 26, in get_findings
    items.extend(self.import_hotspots(test))

Screenshots image

image

enidevops avatar May 28 '22 15:05 enidevops