Skip to content

Commit 0ec4777

Browse files
committed
fixing base on feedback
1 parent f82bed7 commit 0ec4777

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

contentctl/output/attack_nav_output.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
1+
# Standard library imports
12
import json
23
import pathlib
34
from datetime import datetime
4-
from typing import Any, Dict, List, Set, TypedDict, Union
5+
from typing import Any, TypedDict, Union
56

7+
# Third-party imports
68
from contentctl.objects.detection import Detection
79

810

911
class TechniqueData(TypedDict):
1012
score: int
11-
file_paths: List[str]
12-
links: List[Dict[str, str]]
13+
file_paths: list[str]
14+
links: list[dict[str, str]]
1315

1416

1517
class LayerData(TypedDict):
1618
name: str
17-
versions: Dict[str, str]
19+
versions: dict[str, str]
1820
domain: str
1921
description: str
20-
filters: Dict[str, List[str]]
22+
filters: dict[str, list[str]]
2123
sorting: int
22-
layout: Dict[str, Union[str, bool]]
24+
layout: dict[str, Union[str, bool]]
2325
hideDisabled: bool
24-
techniques: List[Dict[str, Any]]
25-
gradient: Dict[str, Union[List[str], int]]
26-
legendItems: List[Dict[str, str]]
26+
techniques: list[dict[str, Any]]
27+
gradient: dict[str, Union[list[str], int]]
28+
legendItems: list[dict[str, str]]
2729
showTacticRowBackground: bool
2830
tacticRowBackground: str
2931
selectTechniquesAcrossTactics: bool
3032
selectSubtechniquesWithParent: bool
3133
selectVisibleTechniques: bool
32-
metadata: List[Dict[str, str]]
34+
metadata: list[dict[str, str]]
3335

3436

3537
class AttackNavOutput:
@@ -44,16 +46,16 @@ def __init__(
4446
self.layer_domain = layer_domain
4547

4648
def writeObjects(
47-
self, detections: List[Detection], output_path: pathlib.Path
49+
self, detections: list[Detection], output_path: pathlib.Path
4850
) -> None:
4951
"""
5052
Generate MITRE ATT&CK Navigator layer file from detections
5153
Args:
5254
detections: List of Detection objects
5355
output_path: Path to write the layer file
5456
"""
55-
techniques: Dict[str, TechniqueData] = {}
56-
tactic_coverage: Dict[str, Set[str]] = {}
57+
techniques: dict[str, TechniqueData] = {}
58+
tactic_coverage: dict[str, set[str]] = {}
5759

5860
# Process each detection
5961
for detection in detections:

0 commit comments

Comments
 (0)