LOGBOOK

HELP

Quiz Entry - updated: 2026.11.26

What are the parts of a Suricata rule?

Action, header (protocol, source IP and port, direction, destination IP and port), and options in parentheses (message, detection keywords, sid, rev, classtype…).

Anatomy of a Suricata rule

* Action, then the header that selects the traffic, then the options that describe the match. *

alert tcp any any -> any any (msg:"Suricata NIDS - Testing"; content:"evilliveshere"; nocase; classtype:not-suspicious; sid:1234567; rev:1;)
└─┬─┘ └┬┘ └┬┘ └┬┘ └┬┘ └┬┘ └┬┘ └────────────────────────────── options ──────────────────────────────┘
action proto src  sport dir dst dport
  1. Action: what to do on a match. alert logs an alert; pass stops inspecting the packet; drop and reject block it, which only works when Suricata runs inline as an IPS.
  2. Header:
    • protocol (tcp, udp, icmp, ip for all, or an application protocol such as http),
    • source address and port (any, an IP or CIDR, or a variable such as $HOME_NET),
    • direction: -> from source to destination, <> both ways,
    • destination address and port.
  3. Options, separated by semicolons: general (meta) options such as msg, sid, rev, classtype and reference, and detection options such as content, nocase, pcre and flow.

The header narrows down which traffic is examined; the detection options decide whether it matches.

Go deeper:

From Quiz: ISLAB / Network Security Monitoring | Updated: Nov 26, 2026