new detections

This commit is contained in:
P4T12ICK
2020-12-16 15:03:56 +01:00
parent 9a775408c8
commit 5f929693fd
+8 -8
View File
@@ -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:])
main(sys.argv[1:])