From 5f929693fd93bfbaecd17fcbe4202caec05f68f4 Mon Sep 17 00:00:00 2001 From: P4T12ICK Date: Wed, 16 Dec 2020 15:03:56 +0100 Subject: [PATCH] new detections --- bin/generate.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/generate.py b/bin/generate.py index 18adca45f2..c4521801eb 100644 --- a/bin/generate.py +++ b/bin/generate.py @@ -46,7 +46,7 @@ def generate_transforms_conf(lookups, TEMPLATE_PATH, OUTPUT_PATH): template = j2_env.get_template('transforms.j2') output_path = path.join(OUTPUT_PATH, 'default/transforms.conf') output = template.render(lookups=sorted_lookups, time=utc_time) - with open(output_path, 'w') as f: + with open(output_path, 'w', encoding="utf-8") as f: f.write(output) return output_path @@ -62,7 +62,7 @@ def generate_collections_conf(lookups, TEMPLATE_PATH, OUTPUT_PATH): template = j2_env.get_template('collections.j2') output_path = path.join(OUTPUT_PATH, 'default/collections.conf') output = template.render(lookups=sorted_lookups, time=utc_time) - with open(output_path, 'w') as f: + with open(output_path, 'w', encoding="utf-8") as f: f.write(output) return output_path @@ -179,7 +179,7 @@ def generate_analytics_story_conf(stories, detections, response_tasks, baselines template = j2_env.get_template('analytic_stories.j2') output_path = path.join(OUTPUT_PATH, 'default/analytic_stories.conf') output = template.render(stories=stories, time=utc_time) - with open(output_path, 'w') as f: + with open(output_path, 'w', encoding="utf-8") as f: f.write(output) return output_path @@ -223,7 +223,7 @@ def generate_use_case_library_conf(stories, detections, response_tasks, baseline output = template.render(stories=stories, detections=detections, response_tasks=response_tasks, baselines=baselines, time=utc_time) - with open(output_path, 'w') as f: + with open(output_path, 'w', encoding="utf-8") as f: f.write(output) return output_path @@ -248,7 +248,7 @@ def generate_macros_conf(macros, detections, TEMPLATE_PATH, OUTPUT_PATH): template = j2_env.get_template('macros.j2') output_path = path.join(OUTPUT_PATH, 'default/macros.conf') output = template.render(macros=all_macros, time=utc_time) - with open(output_path, 'w') as f: + with open(output_path, 'w', encoding="utf-8") as f: f.write(output) return output_path @@ -291,14 +291,14 @@ def generate_workbench_panels(response_tasks, stories, TEMPLATE_PATH, OUTPUT_PAT template = j2_env.get_template('es_investigations.j2') output_path = path.join(OUTPUT_PATH, 'default/es_investigations.conf') output = template.render(response_tasks=workbench_panel_objects, stories=stories) - with open(output_path, 'w') as f: + with open(output_path, 'w', encoding="utf-8") as f: f.write(output) j2_env = Environment(loader=FileSystemLoader(TEMPLATE_PATH), trim_blocks=True) template = j2_env.get_template('workflow_actions.j2') output_path = path.join(OUTPUT_PATH, 'default/workflow_actions.conf') output = template.render(response_tasks=workbench_panel_objects) - with open(output_path, 'w') as f: + with open(output_path, 'w', encoding="utf-8") as f: f.write(output) @@ -614,4 +614,4 @@ def main(args): if __name__ == "__main__": - main(sys.argv[1:]) \ No newline at end of file + main(sys.argv[1:])