Merge branch 'pivoting-and-fixes' of https://gitlab.com/krakow2600/atomic-threat-coverage into pivoting-and-fixes

This commit is contained in:
Yugoslavskiy Daniil 2019-02-11 18:27:28 +01:00
commit 192ce79be9

View File

@ -51,6 +51,8 @@ def main(**kwargs):
# Iterate through alerts and pathes to them
for alert, path in zip(alerts, path_to_alerts):
if not isinstance(alert.get('tags'), list):
continue
threats = [tag for tag in alert['tags'] if tag.startswith('attack')]
tactics = [f'{ta_mapping[threat][1]}: {ta_mapping[threat][0]}' for threat in threats if threat in ta_mapping.keys() ]
techniques = [threat for threat in threats if threat.startswith('attack.t')]