Suricata custom rules error
-
Hi,
i would like to ask for some help about custom rules.
Suricata version: 4.0.13_9
Pfsense version:
2.4.4-RELEASE (amd64)
built on Thu Sep 20 09:03:12 EDT 2018
FreeBSD 11.2-RELEASE-p3These custom rules used to parsed ok but now I get:
31/10/2018 -- 09:42:16 - <Error> -- [ERRCODE: SC_ERR_INVALID_SIGNATURE(39)] - error parsing signature "pass tcp $HOME_NET any -> [138.128.181.26,198.241.44.44,207.7.86.99,188.138.33.107,91.82.85.115,84.2.36.214,87.229.111.247,82.131.163.200,194.140.248.43,198.91.84.81] (msg:"pass tcp traffic from HOME_NET to exceptions"; sid:100001;)" from file /usr/local/etc/suricata/suricata_11138_em0/rules/custom.rules at line 1
What am I missing?
pass tcp $HOME_NET any -> [138.128.181.26,198.241.44.44,207.7.86.99,188.138.33.107,91.82.85.115,84.2.36.214,87.229.111.247,82.131.163.200,194.140.248.43,198.91.84.81] (msg:"pass tcp traffic from HOME_NET to exceptions"; sid:100001;) pass tcp [138.128.181.26,198.241.44.44,207.7.86.99,188.138.33.107,91.82.85.115,84.2.36.214,87.229.111.247,82.131.163.200,194.140.248.43,198.91.84.81] [80,443] -> $HOME_NET any (msg:"pass tcp traffic from EXT_NET to exceptions"; sid:100002;)
Thank you.
-
You appear to be missing the PORTS part of your rule. The general syntax looks like this:
IP_ADDRESS PORT of Source and IP_ADDRESS PORT of Destination. So try putting another "any" at the end of your list of IP addresses in the brackets. That would make your rule look like this:
pass tcp $HOME_NET any -> [138.128.181.26,198.241.44.44,207.7.86.99,188.138.33.107,91.82.85.115,84.2.36.214,87.229.111.247,82.131.163.200,194.140.248.43,198.91.84.81] any (msg:"pass tcp traffic from HOME_NET to exceptions"; sid:100001;)
-
Thank you, that was the problem.
Do you recommend disabling the rules that fail to parse during suricata start or just leave them?
-
They aren't going to be used, so it's your call. Really doesn't matter since they are not loaded anyway and thus won't consume any resources (other than the brief milliseconds of CPU time expended during the initial startup of Suricata).