Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] showSubtechniques in SVGConfig does not show the sub techniques in the SVG #169

Open
KustoKing opened this issue Apr 8, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@KustoKing
Copy link

Expected Behavior

Expanded sub techniques in SVG

Actual Behavior

SVG is not showing sub techniques, while the attack navigator does

Steps to Reproduce the Problem

  1. create a json with:
    layout: "expandedSubtechniques": "all"
    techniques "showSubtechniques": True
    "selectSubtechniquesWithParent": True
  2. Validate that the json contains:
    layout: "expandedSubtechniques": "all"
    techniques: "showSubtechniques": true
    "selectSubtechniquesWithParent": true
  3. Validate that the json works in attack explorer
  4. Import: from mitreattack.navlayers.exporters.to_svg import ToSvg, SVGConfig
  5. svgconf =SVGConfig(width=118.9, height=84.1, unit="cm", showHeader=False, fontSize=12, showSubtechniques="all")
  6. export with
    exporter = ToSvg(domain='enterprise', source='local', resource=resource_path, config=svgconf)
    exporter.to_svg(layerInit=layer, filepath="Coverage.svg")

Possible Solution

Review > mitreattack.navlayers.exporters.to_svg

@KustoKing KustoKing added the bug Something isn't working label Apr 8, 2024
@adpare
Copy link
Contributor

adpare commented Apr 16, 2024

Hi @KustoKing,

Thanks for opening a request! You are right. There is a bug in the code used to expand the subtechniques in the SVG. We do plan to address this issue. As a workaround, I suggest you follow the steps below -

  1. Open the layer in ATT&CK navigator
  2. Select expand sub-techniques in the navigator toolbar
  3. Download the layer
  4. Then you can create the SVG using the new layer file and the mitreattack-python library

Alternatively, if you want to strictly make use of the mitreattack-python library, ensure that ALL techniques have been included in the layer file with showSubtechniques: true.

Let us know if you encounter any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants