Add Open Pentest Format (OPF) parser - #15558
Conversation
Parse an OPF .opf.json finding library into DefectDojo findings, mapping severity, CVSS score and vector, CWE, CVE, mitigation, impact, steps to reproduce, references, endpoints and tags. Includes unit tests, sample scans, docs and dedupe config for the OPF Scan scan type. Spec: https://cairnsecurity.com/opf
|
The two red checks are the This change is a file parser that doesn't touch the UI, and the rest-framework unit tests pass, so nothing that exercises the parser is red. Could a maintainer re-run the failed jobs when you have a moment? Happy to rebase or push a change if you'd prefer. |
|
Correction to my note above: I misread the log. The The shard actually failed on The conclusion is unchanged, but the evidence I cited for it was wrong. This PR adds a file parser under Happy to rebase onto current master so the shard re-runs, or to make any changes you would prefer. |
Adds a parser for the Open Pentest Format (OPF), a JSON format for pentest
findings (spec: https://cairnsecurity.com/opf). It reads a
.opf.jsonfile andmaps each finding to a DefectDojo finding, so an OPF export imports directly with
no conversion step.
Mapping
severityseverity(informationalbecomesInfo)cvssScore/cvssVectorcvssv3_score/cvssv3cweIds/cweIdcwecveIdsunsaved_vulnerability_idsrecommendationmitigationimpactimpactstepsToReproducesteps_to_reproducereferencesreferencesaffectedAssetstestType,owaspCategory,mitreTechniquesidunique_id_from_tool/vuln_id_from_toolOPF text is sometimes HTML (
textFormat: "html"), so the parser flattens it toplain text.
Included
dojo/tools/opf/parserunittests/tools/test_opf_parser.py) and two sample scans (unittests/scans/opf/)docs/content/supported_tools/parsers/file/opf.md)OPF Scanscan type insettings.dist.pyTesting
python manage.py test unittests.tools.test_opf_parser --keepdbcovers an emptydocument and a four-finding document: severity mapping, CWE, CVSS score and
vector, HTML flattening, tags, and findings that carry no CVSS.