From 92d43e51a75d5178c737e11baac2171366d44dad Mon Sep 17 00:00:00 2001 From: security-companion <11234621+security-companion@users.noreply.github.com> Date: Tue, 6 Jun 2023 21:53:14 +0200 Subject: [PATCH] add check in rulecat.py if sid is None as otherwise script aborts --- idstools/scripts/rulecat.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/idstools/scripts/rulecat.py b/idstools/scripts/rulecat.py index 3017a0e..972ca0d 100644 --- a/idstools/scripts/rulecat.py +++ b/idstools/scripts/rulecat.py @@ -39,6 +39,7 @@ import shutil import glob import io +from pprint import pprint if sys.argv[0] == __file__: sys.path.insert( @@ -549,6 +550,10 @@ def build_rule_map(rules): rulemap = {} for rule in rules: + if rule["sid"] is None: + print("error in parsing rule, id is missing") + pprint(vars(rule)) + sys.exit(1) if rule.id not in rulemap: rulemap[rule.id] = rule else: