Suricata-Update Drop and Modify

Hey Team,

I am attempting to drop and then modify some rules with Suricata-Update version 1.1.2 on Suricata 5.0.3 but am having difficulty getting the best of both worlds.

I am looking to convert all etn_aggressive.rules ( to a drop, and then exclude a particular IP address ( from the list. Unfortunately the rule signature that the IP address is grouped in is always changing so I cannot just modify a set SID.

My thought was to add to Drop.conf :


and then add to Modify.conf: “(*)” “!\2”

The modify works (replacing to ! but all the rules within the etn_aggressive group stay at “alert” instead of converting to “drop”.

I tried a few other variations but have not had luck in converting them all to “drop” and modifying the IP address at the same time. I either get:

  • All rules within that group convert to drop but the IP address is not modified

  • The rule that contains the IP address is modified and converted to drop but all other rules within that group stay at alert

  • No changes are done. Rules stay at “alert” and IP address is unmodified

I have tried a few variations:

Modify.Conf without adding group to the Drop.conf: “(alert)(.)(” “drop\2!\4” “(alert)(.*)” “drop\2”



Modify.conf: “(drop)(.)(” “drop\2!\4”

But I still cannot get that mix of both, convert to drop and modify.

I reload the rules with:

suricata-update -f -v --disable-conf=/etc/suricata/disable.conf --enable-conf=/etc/suricata/enable.conf --drop-conf=/etc/suricata/drop.conf --modify-conf=/etc/suricata/modify.conf --local /etc/suricata/local.rules --reload-command=‘kill -USR2 $(cat /var/run/’

My thought is to convert the rules to drop and then use the regex finder to search for the string “” (since this is only applies to rules in that group) and then replace with ! Perhaps there is a better way and I am going about this wrong, or maybe my regex search and replace is wrong?

Any insight would be greatly appreciated!


I figured out a solution for this. It seems that the regex matcher can only match once, so when I had modify rules that looks for the same regex, it would only take the last one: “alert(.*)” “drop\1” “*)” “!\1”

Upon a rule reload the only modification that would occur would be whichever match came last, in the above example " “*)” “!\1"”.

I got around this by matching on a different regex and adding to drop.conf

Drop.conf: group:etn_aggressive.rules

Modify.conf: re: “alert(.)” “drop\1!\2”

Not sure if this is intended or if there is an enhancement that can be made to suricata-update.


Just verified there is an issue with modify rules that would apply more than one modification to a rule. I’ve created a ticket for this bug: