From dd571d7cd572dfdfaf66248e43b871b40081596a Mon Sep 17 00:00:00 2001 From: Deborah Servili Date: Thu, 17 Aug 2017 15:52:26 +0200 Subject: [PATCH] script mitre - version given as an input + renaming --- tools/mitre-cti/create_attack-pattern_galaxy.py | 16 ++++++++-------- .../mitre-cti/create_course-of-action_galaxy.py | 16 ++++++++-------- tools/mitre-cti/create_intrusion-set_galaxy.py | 16 ++++++++-------- tools/mitre-cti/create_malware_galaxy.py | 16 ++++++++-------- tools/mitre-cti/create_tool_galaxy.py | 16 ++++++++-------- 5 files changed, 40 insertions(+), 40 deletions(-) diff --git a/tools/mitre-cti/create_attack-pattern_galaxy.py b/tools/mitre-cti/create_attack-pattern_galaxy.py index 9617249..b9fed7d 100644 --- a/tools/mitre-cti/create_attack-pattern_galaxy.py +++ b/tools/mitre-cti/create_attack-pattern_galaxy.py @@ -4,11 +4,11 @@ import json import re import os +import argparse -''' -Create a couple galaxy/cluster with cti's attack-patterns -Must be in the mitre/cti/ATTACK/attack-pattern folder -''' +parser = argparse.ArgumentParser(description='Create a couple galaxy/cluster with cti\'s attack-patterns\nMust be in the mitre/cti/ATTACK/attack-pattern folder') +parser.add_argument("-v", "--version", type=int, required=True, help="Version of the galaxy. Please increment the previous one") +args = parser.parse_args() values = [] @@ -37,16 +37,16 @@ for element in os.listdir('.'): galaxy = {} galaxy['name'] = "Attack Pattern" -galaxy['type'] = "attack-pattern" +galaxy['type'] = "mitre-attack-pattern" galaxy['description'] = "ATT&CK Tactic" galaxy['uuid' ] = "c4e851fa-775f-11e7-8163-b774922098cd" -galaxy['version'] = 1 +galaxy['version'] = args.version cluster = {} cluster['name'] = "Attack Pattern" -cluster['type'] = "attack-pattern" +cluster['type'] = "mitre-attack-pattern" cluster['description'] = "ATT&CK tactic" -cluster['version'] = 1 +cluster['version'] = args.version cluster['source'] = "https://github.com/mitre/cti" cluster['uuid' ] = "dcb864dc-775f-11e7-9fbb-1f41b4996683" cluster['authors'] = ["MITRE"] diff --git a/tools/mitre-cti/create_course-of-action_galaxy.py b/tools/mitre-cti/create_course-of-action_galaxy.py index f120436..83a5e15 100644 --- a/tools/mitre-cti/create_course-of-action_galaxy.py +++ b/tools/mitre-cti/create_course-of-action_galaxy.py @@ -4,11 +4,11 @@ import json import re import os +import argparse -''' -Create a couple galaxy/cluster with cti's courses-of-action -Must be in the mitre/cti/ATTACK/course-of-action folder -''' +parser = argparse.ArgumentParser(description='Create a couple galaxy/cluster with cti\'s courses-of-action.\nMust be in the mitre/cti/ATTACK/course-of-action folder') +parser.add_argument("-v", "--version", type=int, required=True, help="Version of the galaxy. Please increment the previous one") +args = parser.parse_args() values = [] @@ -29,16 +29,16 @@ for element in os.listdir('.'): galaxy = {} galaxy['name'] = "Course of Action" -galaxy['type'] = "course-of-action" +galaxy['type'] = "mitre-course-of-action" galaxy['description'] = "ATT&CK Mitigation" galaxy['uuid' ] = "6fcb4472-6de4-11e7-b5f7-37771619e14e" -galaxy['version'] = 1 +galaxy['version'] = args.version cluster = {} cluster['name'] = "Course of Action" -cluster['type'] = "course-of-action" +cluster['type'] = "mitre-course-of-action" cluster['description'] = "ATT&CK Mitigation" -cluster['version'] = 1 +cluster['version'] = args.version cluster['source'] = "https://github.com/mitre/cti" cluster['uuid' ] = "a8825ae8-6dea-11e7-8d57-7728f3cfe086" cluster['authors'] = ["MITRE"] diff --git a/tools/mitre-cti/create_intrusion-set_galaxy.py b/tools/mitre-cti/create_intrusion-set_galaxy.py index 3e9e12f..0ef6f8e 100644 --- a/tools/mitre-cti/create_intrusion-set_galaxy.py +++ b/tools/mitre-cti/create_intrusion-set_galaxy.py @@ -4,11 +4,11 @@ import json import re import os +import argparse -''' -Create a couple galaxy/cluster with cti's intrusion-sets -Must be in the mitre/cti/ATTACK/intrusion-set folder -''' +parser = argparse.ArgumentParser(description='Create a couple galaxy/cluster with cti\'s intrusion-sets\nMust be in the mitre/cti/ATTACK/intrusion-set folder') +parser.add_argument("-v", "--version", type=int, required=True, help="Version of the galaxy. Please increment the previous one") +args = parser.parse_args() values = [] @@ -34,16 +34,16 @@ for element in os.listdir('.'): galaxy = {} galaxy['name'] = "Intrusion Set" -galaxy['type'] = "intrusion-set" +galaxy['type'] = "mitre-intrusion-set" galaxy['description'] = "Name of ATT&CK Group" galaxy['uuid' ] = "1023f364-7831-11e7-8318-43b5531983ab" -galaxy['version'] = 1 +galaxy['version'] = args.version cluster = {} cluster['name'] = "intrusion Set" -cluster['type'] = "intrusion-set" +cluster['type'] = "mitre-intrusion-set" cluster['description'] = "Name of ATT&CK Group" -cluster['version'] = 1 +cluster['version'] = args.version cluster['source'] = "https://github.com/mitre/cti" cluster['uuid' ] = "10df003c-7831-11e7-bdb9-971cdd1218df" cluster['authors'] = ["MITRE"] diff --git a/tools/mitre-cti/create_malware_galaxy.py b/tools/mitre-cti/create_malware_galaxy.py index 2140fd1..81721af 100644 --- a/tools/mitre-cti/create_malware_galaxy.py +++ b/tools/mitre-cti/create_malware_galaxy.py @@ -4,11 +4,11 @@ import json import re import os +import argparse -''' -Create a couple galaxy/cluster with cti's malwares -Must be in the mitre/cti/ATTACK/malware folder -''' +parser = argparse.ArgumentParser(description='Create a couple galaxy/cluster with cti\'s malwares\nMust be in the mitre/cti/ATTACK/malware folder') +parser.add_argument("-v", "--version", type=int, required=True, help="Version of the galaxy. Please increment the previous one") +args = parser.parse_args() values = [] @@ -35,16 +35,16 @@ for element in os.listdir('.'): galaxy = {} galaxy['name'] = "Malware" -galaxy['type'] = "malware" +galaxy['type'] = "mitre-malware" galaxy['description'] = "Name of ATT&CK software" galaxy['uuid' ] = "d752161c-78f6-11e7-a0ea-bfa79b407ce4" -galaxy['version'] = 1 +galaxy['version'] = args.version cluster = {} cluster['name'] = "Malware" -cluster['type'] = "malware" +cluster['type'] = "mitre-malware" cluster['description'] = "Name of ATT&CK software" -cluster['version'] = 1 +cluster['version'] = args.version cluster['source'] = "https://github.com/mitre/cti" cluster['uuid' ] = "d752161c-78f6-11e7-a0ea-bfa79b407ce4" cluster['authors'] = ["MITRE"] diff --git a/tools/mitre-cti/create_tool_galaxy.py b/tools/mitre-cti/create_tool_galaxy.py index 0a4461e..87f54fb 100644 --- a/tools/mitre-cti/create_tool_galaxy.py +++ b/tools/mitre-cti/create_tool_galaxy.py @@ -4,11 +4,11 @@ import json import re import os +import argparse -''' -Create a couple galaxy/cluster with cti's tools -Must be in the mitre/cti/ATTACK/tool folder -''' +parser = argparse.ArgumentParser(description='Create a couple galaxy/cluster with cti\'s tools\nMust be in the mitre/cti/ATTACK/tool folder') +parser.add_argument("-v", "--version", type=int, required=True, help="Version of the galaxy. Please increment the previous one") +args = parser.parse_args() values = [] @@ -35,16 +35,16 @@ for element in os.listdir('.'): galaxy = {} galaxy['name'] = "Tool" -galaxy['type'] = "tool" +galaxy['type'] = "mitre-tool" galaxy['description'] = "Name of ATT&CK software" galaxy['uuid' ] = "d5cbd1a2-78f6-11e7-a833-7b9bccca9649" -galaxy['version'] = 1 +galaxy['version'] = args.version cluster = {} cluster['name'] = "Tool" -cluster['type'] = "tool" +cluster['type'] = "mitre-tool" cluster['description'] = "Name of ATT&CK software" -cluster['version'] = 1 +cluster['version'] = args.version cluster['source'] = "https://github.com/mitre/cti" cluster['uuid' ] = "d700dc5c-78f6-11e7-a476-5f748c8e4fe0" cluster['authors'] = ["MITRE"]