pfsense:suricata:custom_rules
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
pfsense:suricata:custom_rules [2021/01/06 12:00] – peter | pfsense:suricata:custom_rules [2021/01/21 10:21] (current) – removed peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== PFSense - Suricata - Custom Rules ====== | ||
- | |||
- | <WRAP warning> | ||
- | **WARNING: | ||
- | |||
- | Make sure you pick a starting SID number that does not conflict with any existing SIDs from other enabled rules. | ||
- | |||
- | Usually from 1000000. | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | Navigate to **Services -> Suricata -> Interfaces -> INTERFACE > INTERFACE Rules -> custom rules**. | ||
- | |||
- | Choose CUSTOM RULES in the Category drop-down and then type in the rules you need. | ||
- | |||
- | {{: | ||
- | |||
- | ---- | ||
- | |||
- | There are plenty of examples on the web. | ||
- | |||
- | You can add restrictions by protocol, port and source or destination IP address. | ||
- | |||
- | <WRAP important> | ||
- | **WARNING: | ||
- | </ | ||
- | |||
- | |||
- | < | ||
- | alert tcp [$EXTERNAL_NET, | ||
- | |||
- | alert icmp any any -> any any (msg:" | ||
- | |||
- | alert tcp $HOME_NET any -> $EXTERNAL_NET ![80,8080] (msg:" | ||
- | alert tcp $HOME_NET any -> $EXTERNAL_NET !443 (msg:" | ||
- | |||
- | pass ip 1.2.3.4 any <> any any (msg:" | ||
- | |||
- | pass ip 192.168.1.22/ | ||
- | </ | ||
- | |||
- | <WRAP info> | ||
- | **INFO: | ||
- | |||
- | So the rule using "<>" | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | ===== Protocol Anomalies Detection ===== | ||
- | |||
- | Suricata IDS/IPS/NSM is also capable of doing protocol anomaly detection. | ||
- | |||
- | Please find below a few self explanatory rule examples (look at the rule msg) of how to do this: | ||
- | |||
- | < | ||
- | HTTP | ||
- | |||
- | alert tcp any any -> any ![80,8080] (msg:" | ||
- | alert tcp any any -> any 80 (msg:" | ||
- | |||
- | HTTPS | ||
- | |||
- | alert http any any -> any 443 (msg:" | ||
- | |||
- | TLS | ||
- | |||
- | alert tcp any any -> any 443 (msg:" | ||
- | |||
- | FTP | ||
- | |||
- | alert tcp any any -> any ![20,21] (msg:" | ||
- | alert tcp any any -> any [20,21] (msg:" | ||
- | |||
- | SMTP | ||
- | |||
- | alert tcp any any -> any ![25, | ||
- | alert tcp any any -> any [25, | ||
- | |||
- | SSH | ||
- | |||
- | alert tcp any any -> any !22 (msg:" | ||
- | alert tcp any any -> any 22 (msg:" | ||
- | |||
- | IMAP | ||
- | |||
- | alert tcp any any -> any !143 (msg:" | ||
- | alert tcp any any -> any 143 (msg:" | ||
- | |||
- | SMB | ||
- | |||
- | alert tcp any any -> any 139 (msg:" | ||
- | |||
- | DCERPC | ||
- | |||
- | alert tcp any any -> any [80,8080] (msg:" | ||
- | |||
- | DNS | ||
- | |||
- | alert tcp any any -> any 53 (msg:" | ||
- | alert udp any any -> any 53 (msg:" | ||
- | |||
- | MODBUS | ||
- | |||
- | alert tcp any any -> any 502 (msg:" | ||
- | </ | ||
- | |||
- | |||
- | |||
- | ===== References ===== | ||
- | |||
- | https:// | ||
- | |||
- | http:// | ||
- | |||
- | https:// | ||
pfsense/suricata/custom_rules.1609934402.txt.gz · Last modified: 2021/01/06 12:00 by peter