File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from mitreattack .attackToExcel import attackToExcel
2+ from stix2 import MemoryStore
3+ import os
4+
5+ def main ():
6+ # List of domains and version to process
7+ domains = ["enterprise-attack" , "mobile-attack" , "ics-attack" ]
8+ output_dir = "output/"
9+
10+ # Path to the STIX bundles for each domain (assumes STIX files are downloaded)
11+ stix_base_dir = os .environ .get ("STIX_BASE_DIR" , "attack-releases/stix-2.0/v17.1" )
12+ stix_files = {
13+ "enterprise-attack" : os .path .join (stix_base_dir , "enterprise-attack.json" ),
14+ "mobile-attack" : os .path .join (stix_base_dir , "mobile-attack.json" ),
15+ "ics-attack" : os .path .join (stix_base_dir , "ics-attack.json" ),
16+ }
17+
18+ for domain in domains :
19+ stix_file = stix_files [domain ]
20+ print (f"Exporting { domain } to Excel..." )
21+
22+ # Load STIX data into MemoryStore
23+ mem_store = MemoryStore ()
24+ mem_store .load_from_file (stix_file )
25+
26+ # Export to Excel
27+ attackToExcel .export (
28+ domain = domain ,
29+ output_dir = output_dir ,
30+ mem_store = mem_store ,
31+ )
32+
33+ if __name__ == "__main__" :
34+ main ()
You can’t perform that action at this time.
0 commit comments