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

Commit e09e63f

Browse files
committed
removed pre-attack from diff_stix
1 parent 3ef0ffd commit e09e63f

3 files changed

Lines changed: 10 additions & 14 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Changes staged on develop
2+
## Improvements
3+
- Removed pre-ATT&CK domain from scripts to support migration of that content to enterprise tactics. See issue [#36](https://github.com/mitre-attack/attack-scripts/issues/36).
4+
15
# v1.6 - 5 October 2020
26
## Improvements
37
- Added [layer to SVG](https://github.com/mitre-attack/attack-scripts/tree/master/layers#to_svgpy) converter. See issue [#1](https://github.com/mitre-attack/attack-scripts/issues/1).

scripts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ This folder contains one-off scripts for working with ATT&CK content. These scri
66
|:-------|:------------|
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. |
9-
| [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. |
9+
| [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) and [mobile-attack.json](https://github.com/mitre/cti/blob/master/mobile-attack/mobile-attack.json) bundles in 'old' and 'new' folders for the script to compare. Run `python3 diff_stix.py -h` for full usage instructions. |
1010
| [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. |

scripts/diff_stix.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,15 @@
1212
# helper maps
1313
domainToDomainLabel = {
1414
'enterprise-attack': 'Enterprise',
15-
'pre-attack': 'PRE-ATT&CK',
1615
'mobile-attack': 'Mobile'
1716
}
1817
domainToLayerFileDomain = {
1918
'enterprise-attack': 'mitre-enterprise',
20-
'mobile-attack': 'mitre-mobile',
21-
'pre-attack': 'pre-attack'
19+
'mobile-attack': 'mitre-mobile'
2220
}
2321
domainToTaxiiCollectionId = {
2422
"enterprise-attack": "95ecc380-afe9-11e4-9b6c-751b66dd541e",
2523
"mobile-attack": "2f669986-b40b-4423-b720-4396ca6a462b",
26-
"pre-attack": "062767bd-02d2-4b72-84ba-56caef0f8658"
2724
}
2825
attackTypeToStixFilter = { # stix filters for querying for each type of data
2926
'technique': [Filter('type', '=', 'attack-pattern')],
@@ -69,7 +66,7 @@ class DiffStix(object):
6966
"""
7067
def __init__(
7168
self,
72-
domains=['enterprise-attack', 'pre-attack', 'mobile-attack'],
69+
domains=['enterprise-attack', 'mobile-attack'],
7370
layers=None,
7471
markdown=None,
7572
minor_changes=False,
@@ -502,10 +499,6 @@ def get_layers_dict(self):
502499
"tacticRowBackground": "#205b8f",
503500
"selectTechniquesAcrossTactics": True
504501
}
505-
# default to show pre-attack on pre layer
506-
if domain == "pre-attack": layer_json["filters"] = {
507-
"stages": ["prepare"]
508-
}
509502

510503
layers[domain] = layer_json
511504

@@ -538,7 +531,6 @@ def layers_dict_to_files(outfiles, layers):
538531
# write each layer to separate files
539532
json.dump(layers['enterprise-attack'], open(outfiles[0], "w"), indent=4)
540533
json.dump(layers['mobile-attack'], open(outfiles[1], "w"), indent=4)
541-
json.dump(layers['pre-attack'], open(outfiles[2], "w"), indent=4)
542534

543535
verboseprint("done")
544536

@@ -554,7 +546,7 @@ def layers_dict_to_files(outfiles, layers):
554546
]
555547

556548
parser = argparse.ArgumentParser(
557-
description="Create -markdown and/or -layers reporting on the changes between two versions of the ATT&CK content. Takes STIX bundles as input. For default operation, put enterprise-attack.json, mobile-attack.json, and pre-attack.json bundles in 'old' and 'new' folders for the script to compare."
549+
description="Create -markdown and/or -layers reporting on the changes between two versions of the ATT&CK content. Takes STIX bundles as input. For default operation, put enterprise-attack.json and mobile-attack.json bundles in 'old' and 'new' folders for the script to compare."
558550
)
559551

560552
parser.add_argument("-old",
@@ -588,10 +580,10 @@ def layers_dict_to_files(outfiles, layers):
588580
nargs="+",
589581
metavar="DOMAIN",
590582
choices=[
591-
"enterprise-attack", "pre-attack", "mobile-attack"
583+
"enterprise-attack", "mobile-attack"
592584
],
593585
default=[
594-
"enterprise-attack", "pre-attack", "mobile-attack"
586+
"enterprise-attack", "mobile-attack"
595587
],
596588
help="which domains to report on. Choices (and defaults) are %(choices)s"
597589
)

0 commit comments

Comments
 (0)