Skip to content

feat(parsers): add IriusRisk threat model CSV parser#14384

Open
skywalke34 wants to merge 6 commits intoDefectDojo:devfrom
skywalke34:iriusrisk-parser
Open

feat(parsers): add IriusRisk threat model CSV parser#14384
skywalke34 wants to merge 6 commits intoDefectDojo:devfrom
skywalke34:iriusrisk-parser

Conversation

@skywalke34
Copy link
Contributor

Description

New parser for IriusRisk threat model CSV exports. IriusRisk is a threat
modeling and risk management platform. The parser:

  • Parses CSV exports from IriusRisk threat model views
  • Maps all 14 CSV fields to DefectDojo Finding fields
  • Maps IriusRisk risk levels (Critical/High/Medium/Low/Very low) to
    DefectDojo severity levels
  • Extracts CWE numbers from MITRE references when present
  • Generates SHA-256 unique IDs for deduplication across reimports
  • Sets findings inactive when Current Risk is "Very low" (fully mitigated)

Test results

23 unit tests covering:

  • Empty file, single finding, and multiple findings parsing
  • All 5 severity levels (Critical, High, Medium, Low, Info)
  • Title truncation, component name extraction, description construction
  • Mitigation field mapping, active/inactive status logic
  • Unique ID generation and consistency
  • CWE extraction from MITRE references
  • STRIDE-LM and owner field handling

Documentation

Parser documentation at docs/content/supported_tools/parsers/file/iriusrisk.md
with export instructions, complete field mapping table, severity mapping, and
special processing notes.

Checklist

  • Rebased against the very latest dev
  • Submitted against dev branch
  • Meaningful PR name
  • Code is flake8/ruff compliant
  • Code is Python 3.13 compliant
  • Documentation included
  • No model changes, no migrations needed
  • Unit tests included (23 tests)
  • Label: Import Scans

Authored by T. Walker - DefectDojo

Authored by T. Walker - DefectDojo
Authored by T. Walker - DefectDojo
Authored by T. Walker - DefectDojo
Authored by T. Walker - DefectDojo
Authored by T. Walker - DefectDojo
- Update test CSVs from 12 to 14 columns (add MITRE reference, STRIDE-LM)
- Parse MITRE reference: CWE-NNN extracts to cwe field, other values to references
- Include STRIDE-LM in description when populated
- Add Critical to severity mapping
- Change static_finding to False per connector spec
- Update documentation to reflect all changes
- Add tests for CWE extraction, references, STRIDE-LM, and Critical severity

Authored by T. Walker - DefectDojo

### Deduplication

The parser generates a `unique_id_from_tool` by computing a SHA-256 hash of the Component, Threat, and Risk Response fields concatenated with pipe delimiters (lines 74-77). This ensures that each distinct combination of component, threat, and mitigation state produces a unique identifier. On reimport, findings with matching unique IDs are recognized as the same finding rather than being duplicated.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been informed we must never compute this value in a parser. I think there is great value in letting the parsers calculate this value or possible a new field called unique_id_from_parser, but until now haven't been seen agreement on doing this.

@valentijnscholten valentijnscholten added this to the 2.56.0 milestone Feb 25, 2026
Copy link
Contributor

@Maffooch Maffooch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty close overall!


| Source Field | DefectDojo Field | Parser Line # | Notes |
| ------------------------ | -------------------- | ------------- | --------------------------------------------------------------------- |
| Threat | title | 51 | Truncated to 150 characters with "..." suffix if longer |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the past, we have pushed back on line numbers in the docs as drift can occur in the parser over time to make the documented line numbers inaccurate

Comment on lines +50 to +51
# Title: truncate to 150 chars with ellipsis if needed
title = threat[:147] + "..." if len(threat) > 150 else threat
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have upwards of 511 characters to work with here. May want to increase the threshold that we start adding ellipses to, but I am not super opinionated here

@Maffooch Maffooch modified the milestones: 2.56.0, 2.57.0 Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants