From fa64d0f750e2702e9f0a285fb33d4c0fb750e626 Mon Sep 17 00:00:00 2001 From: Jared Ondricek <90368810+jondricek@users.noreply.github.com> Date: Thu, 29 Feb 2024 13:36:26 -0600 Subject: [PATCH] Fix YAML loading of analytics --- scripts/generate_analytics.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/generate_analytics.py b/scripts/generate_analytics.py index 31d9d383..1906ba0a 100755 --- a/scripts/generate_analytics.py +++ b/scripts/generate_analytics.py @@ -22,7 +22,9 @@ analytics = [] for af in analytics_files: print("appending {}".format(af)) - analytics.append(yaml.load(open(af,encoding='utf-8').read())) + with open(af, encoding='utf-8') as f: + analytic_data = yaml.safe_load(f) + analytics.append(analytic_data) #analytics = [yaml.load(open(analytic_file).read()) for analytic_file in analytics_files] # Load ATT&CK content, which is needed to get names for technique IDs