From b18c830fb256cd8e85e84ecd6cab1e27e2a8a0f7 Mon Sep 17 00:00:00 2001 From: Dan Brodjieski Date: Mon, 9 May 2022 16:41:34 -0400 Subject: [PATCH] Combine custom tags with original --- scripts/generate_guidance.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/generate_guidance.py b/scripts/generate_guidance.py index 31c29778..135c119a 100755 --- a/scripts/generate_guidance.py +++ b/scripts/generate_guidance.py @@ -5,6 +5,7 @@ import types import sys import os.path import plistlib +from unittest import result import xlwt import io import glob @@ -1121,7 +1122,14 @@ def get_rule_yaml(rule_file, custom=False, baseline_name=""): resulting_yaml['customized'] = ["customized references"] except: pass - + elif yaml_field == "tags": + # try to concatenate tags from both original yaml and custom yaml + if og_rule_yaml["tags"] == rule_yaml["tags"]: + #print("using default data in yaml field {}".format("tags")) + resulting_yaml['tags'] = og_rule_yaml['tags'] + else: + #print("Found custom tags... concatenating them") + resulting_yaml['tags'] = og_rule_yaml['tags'] + rule_yaml['tags'] else: try: if og_rule_yaml[yaml_field] == rule_yaml[yaml_field]: