Combine custom tags with original

This commit is contained in:
Dan Brodjieski
2022-05-09 16:41:34 -04:00
parent bd38296159
commit b18c830fb2

View File

@@ -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]: