Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Commit 8260223

Browse files
committed
docstring changes made from PR feedback, renamed file to technique_mappings_to_csv.py
1 parent 82b14d8 commit 8260223

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

scripts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ This folder contains one-off scripts for working with ATT&CK content. These scri
77
| [techniques_from_data_source.py](techniques_from_data_source.py) | Fetches the current ATT&CK STIX 2.0 objects from the ATT&CK TAXII server, prints all of the data sources listed in Enterprise ATT&CK, and then lists all the Enterprise techniques containing a given data source. Run `python3 techniques_from_data_source.py -h` for usage instructions. |
88
| [techniques_data_sources_vis.py](techniques_data_sources_vis.py) | Generate the csv data used to create the "Techniques Mapped to Data Sources" visualization in the ATT&CK roadmap. Run `python3 techniques_data_sources_vis.py -h` for usage instructions. |
99
| [diff_stix.py](diff_stix.py) | Create markdown and/or ATT&CK Navigator layers reporting on the changes between two versions of the STIX2 bundles representing the ATT&CK content. For default operation, put [enterprise-attack.json](https://github.com/mitre/cti/blob/master/enterprise-attack/enterprise-attack.json), [mobile-attack.json](https://github.com/mitre/cti/blob/master/mobile-attack/mobile-attack.json), and [pre-attack.json](https://github.com/mitre/cti/blob/master/pre-attack/pre-attack.json) bundles in 'old' and 'new' folders for the script to compare. Run `python3 diff_stix.py -h` for full usage instructions. |
10-
| [filter_techniques_by_category.py](filter_techniques_by_category.py) | Fetches the current ATT&CK content expressed as STIX2 and creates spreadsheet matching Techniques with Mitigations or Groups. Run `python3 filter_techniques_by_category.py -h` for usage instructions. |
10+
| [technique_mappings_to_csv.py](technique_mappings_to_csv.py) | Fetches the current ATT&CK content expressed as STIX2 and creates spreadsheet mapping Techniques with Mitigations, Groups or Software. Run `python3 technique_mappings_to_csv.py -h` for usage instructions. |
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
def build_taxii_source(collection_name):
10-
"""Downloads latest Enterprise ATT&CK content from GitHub."""
10+
"""Downloads latest Enterprise or Mobile ATT&CK content from MITRE TAXII Server."""
1111
# Establish TAXII2 Collection instance for Enterprise ATT&CK collection
1212
collection_map = {
1313
"enterprise_attack": "95ecc380-afe9-11e4-9b6c-751b66dd541e",
@@ -32,7 +32,7 @@ def get_all_techniques(src, source_name):
3232

3333

3434
def filter_for_term_relationships(src, relationship_type, object_id, target=True):
35-
"""Filters data source by relationship that matches type and source or target"""
35+
"""Filters data source by type, relationship_type and source or target"""
3636
filters = [
3737
stix2.Filter("type", "=", "relationship"),
3838
stix2.Filter("relationship_type", "=", relationship_type),
@@ -85,9 +85,9 @@ def escape_chars(a_string):
8585

8686
def arg_parse():
8787
"""Function to handle script arguments."""
88-
parser = argparse.ArgumentParser(description="Fetches the current ATT&CK content expressed as STIX2 and creates spreadsheet matching Techniques with Mitigations or Groups.")
89-
parser.add_argument("-c", "--collection", type=str, required=True, choices=["enterprise_attack", "mobile_attack"], help="Which collection to use (Enterprise, Mobile).")
90-
parser.add_argument("-o", "--operation", type=str, required=True, choices=["groups", "mitigations", "software"], help="Operation to perform on ATT&CK content.")
88+
parser = argparse.ArgumentParser(description="Fetches the current ATT&CK content expressed as STIX2 and creates spreadsheet mapping Techniques with Mitigations, Groups or Software.")
89+
parser.add_argument("-d", "--domain", type=str, required=True, choices=["enterprise_attack", "mobile_attack"], help="Which ATT&CK domain to use (Enterprise, Mobile).")
90+
parser.add_argument("-m", "--mapping-type", type=str, required=True, choices=["groups", "mitigations", "software"], help="Which type of object to output mappings for using ATT&CK content.")
9191
parser.add_argument("-s", "--save", type=str, required=False, help="Save the CSV file with a different filename.")
9292
return parser
9393

0 commit comments

Comments
 (0)