From 45c0efe7ee70dd4177007aeffac4c2cdd75fdd9a Mon Sep 17 00:00:00 2001 From: jzsplunk Date: Tue, 18 Aug 2020 13:21:33 -0700 Subject: [PATCH] [TR-82] code cleanup for generate.py --- bin/generate.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bin/generate.py b/bin/generate.py index 01093c428b..1c91b3ffd7 100644 --- a/bin/generate.py +++ b/bin/generate.py @@ -74,6 +74,13 @@ def generate_collections_conf(lookups): def generate_savedsearches_conf(detections, response_tasks, baselines, deployments): + ''' + @param detections: input list of individual YAML detections in detections/ directory + @param response_tasks: + @param baselines: + @param deployments: + @return: the savedsearches.conf file located in package/default/ + ''' for detection in detections: # parse out data_models @@ -91,7 +98,6 @@ def generate_savedsearches_conf(detections, response_tasks, baselines, deploymen keys = ['mitre_attack', 'kill_chain_phases', 'cis20', 'nist', 'security_domain', 'asset_type', 'risk_object', 'risk_object_type', 'risk_score'] mappings = {} for key in keys: - #print(key) if key == 'mitre_attack': if 'mitre_attack_id' in detection['tags']: mappings[key] = detection['tags']['mitre_attack_id'] @@ -102,13 +108,10 @@ def generate_savedsearches_conf(detections, response_tasks, baselines, deploymen if 'risk_object' in detection['tags']: detection['risk_object'] = detection['tags']['risk_object'] - print(detection['tags']['risk_object']) if 'risk_object_type' in detection['tags']: detection['risk_object_type'] = detection['tags']['risk_object_type'] - print(detection['tags']['risk_object_type']) if 'risk_score' in detection['tags']: detection['risk_score'] = detection['tags']['risk_score'] - print(detection['tags']['risk_score']) for baseline in baselines: data_model = parse_data_models_from_search(baseline['search'])