Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions run_simulation_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,12 @@ def run_uuid(ioc_filename):
logging.info(data)
write_row(time_to_log, rule_name, action, mitre_phase, mitre_tech, windows)

'''
# if you want to post to slack uncomment this and set the slack hook above
json = {'text': "Automated Purple Team --> Simulation: {} | Action: {} | Host: {} | Execution Time: {} UTC".format(rule_name,action,windows,datetime.datetime.utcnow())}
post_to_slack(hook,json)
'''
json_data = {'text': "Automated Purple Team --> Simulation: {} | Action: {} | Host: {} | Execution Time: {} UTC".format(rule_name,action,windows,datetime.datetime.utcnow())}
post_to_slack(hook,json_data)
'''

time.sleep(randint(2, 30))
except Exception as e:
print(e)
Expand All @@ -150,11 +151,12 @@ def run_uuid(ioc_filename):
data = json.dumps({'time': time_to_log, 'rule_name': rule_name, 'action': action, 'mitre_attack_phase': mitre_phase, 'mitre_attack_technique': mitre_tech, 'host': osx})
logging.info(data)
write_row(time_to_log, rule_name, action, mitre_phase, mitre_tech, osx)

'''
# if you want to post to slack uncomment this and set the slack hook above
json = {'text': "Automated Purple Team --> Simulation: {} | Action: {} | Host: {} | Execution Time: {} UTC".format(rule_name,action,osx,datetime.datetime.utcnow())}
post_to_slack(hook,json)
json_data = {'text': "Automated Purple Team --> Simulation: {} | Action: {} | Host: {} | Execution Time: {} UTC".format(rule_name,action,osx,datetime.datetime.utcnow())}
post_to_slack(hook,json_data)
'''

time.sleep(randint(2, 30))
except Exception as e:
print(e)
Expand All @@ -172,11 +174,13 @@ def run_uuid(ioc_filename):
data = json.dumps({'time': time_to_log, 'rule_name': rule_name, 'action': action, 'mitre_attack_phase': mitre_phase, 'mitre_attack_technique': mitre_tech, 'host': linux})
logging.info(data)
write_row(time_to_log, rule_name, action, mitre_phase, mitre_tech, linux)

'''
# if you want to post to slack uncomment this and set the slack hook above
json = {'text': "Automated Purple Team --> Simulation: {} | Action: {} | Host: {} | Execution Time: {} UTC".format(rule_name,action,osx,datetime.datetime.utcnow())}
post_to_slack(hook,json)
json_data = {'text': "Automated Purple Team --> Simulation: {} | Action: {} | Host: {} | Execution Time: {} UTC".format(rule_name,action,osx,datetime.datetime.utcnow())}
post_to_slack(hook,json_data)
'''

time.sleep(randint(2, 30))
except Exception as e:
print(e)
Expand All @@ -194,11 +198,13 @@ def run_uuid(ioc_filename):
data = json.dumps({'time': time_to_log, 'rule_name': rule_name, 'action': action, 'mitre_attack_phase': mitre_phase, 'mitre_attack_technique': mitre_tech, 'host': kali})
logging.info(data)
write_row(time_to_log, rule_name, action, mitre_phase, mitre_tech, kali)

'''
#if you want to post to slack uncomment this and set the slack hook above
#json = {'text': "Automated Purple Team --> Simulation: {} | Action: {} | Host: {} | Execution Time: {} UTC".format(rule_name,action,osx,datetime.datetime.utcnow())}
#post_to_slack(hook,json)
json_data = {'text': "Automated Purple Team --> Simulation: {} | Action: {} | Host: {} | Execution Time: {} UTC".format(rule_name,action,osx,datetime.datetime.utcnow())}
post_to_slack(hook,json_data)
'''

time.sleep(randint(2, 30))
except Exception as e:
print(e)
Expand Down