Currently when suricata-update encounters a rule with duplicate SIDs,
it silently uses the one with the higher revision without logging the
warnings.
On duplicate SID, warnings are logged for equal as well as different
revisions.
if rule.id not in rulemap:
rulemap[rule.id] = rule
else:
+ if rule["rev"] == rulemap[rule.id]["rev"]:
+ logger.warning(
+ "Found duplicate rule SID {} with same revision, "
+ "keeping the first rule seen.".format(rule.sid))
if rule["rev"] > rulemap[rule.id]["rev"]:
+ logger.warning(
+ "Found duplicate rule SID {}, "
+ "keeping the rule with greater revision.".format(rule.sid))
rulemap[rule.id] = rule
return rulemap