-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
get procedure examples by technique (#172)
* get procedure examples by technique * update changelog * fix fn docs * typo
- Loading branch information
Showing
4 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from mitreattack.stix20 import MitreAttackData | ||
|
||
|
||
def main(): | ||
mitre_attack_data = MitreAttackData("enterprise-attack.json") | ||
technique_id = "attack-pattern--03259939-0b57-482f-8eb5-87c0e0d54334" | ||
|
||
procedure_examples = mitre_attack_data.get_procedure_examples_by_technique(technique_id) | ||
|
||
print(f"Retrieved {len(procedure_examples)} procedure example(s):") | ||
|
||
for procedure_example in procedure_examples: | ||
source_object = mitre_attack_data.get_object_by_stix_id(procedure_example.source_ref) | ||
source_attack_id = mitre_attack_data.get_attack_id(source_object.id) | ||
|
||
print(f"[{source_attack_id}] {source_object.name}: {procedure_example.description}") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters