Avoiding duplicate entries for stix2 files with multiple malware definitions

This commit is contained in:
Nex 2022-08-06 14:49:05 +02:00
parent 6b8a23ae10
commit c4416d406a

View File

@ -91,7 +91,9 @@ class Command(object):
}
for coll in self.iocs.ioc_collections:
info["ioc_files"].append(coll.get("stix2_file_path", ""))
ioc_file_path = coll.get("stix2_file_path", "")
if ioc_file_path and ioc_file_path not in info["ioc_files"]:
info["ioc_files"].append(ioc_file_path)
# TODO: Revisit if setting this from environment variable is good
# enough.