Skip to content

Commit

Permalink
render Attack Tree nodes bottom to top, remove labels from edges, fix…
Browse files Browse the repository at this point in the history
… typo in config
  • Loading branch information
allisonrobbins committed Jun 3, 2024
1 parent f34e4cb commit a78aa7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/attack_flow/graphviz.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def convert_attack_tree(bundle):
:rtype: str
"""

gv = graphviz.Digraph()
gv = graphviz.Digraph(graph_attr={'rankdir':'BT'})
gv.body = _get_body_label(bundle)
ignored_ids = get_viz_ignored_ids(bundle)

Expand Down Expand Up @@ -124,9 +124,9 @@ def convert_attack_tree(bundle):
shape="plaintext",
)
for ref in o.get("asset_refs", []):
gv.edge(o.id, ref, "asset")
gv.edge(o.id, ref)
for ref in o.get("effect_refs", []):
gv.edge(o.id, ref, "effect")
gv.edge(o.id, ref)
elif o.type == "attack-asset":
gv.node(o.id, _get_asset_label(o), shape="plaintext")
if object_ref := o.get("object_ref"):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const config: AppConfiguration = {
["campaign", "Campaign"],
["threat-actor", "Threat Actor"],
["malware", "Malware"],
["attack-tree", "ATT&CK Tree"],
["attack-tree", "Attack Tree"],
["other", "Other"]
]
},
Expand Down

0 comments on commit a78aa7d

Please sign in to comment.