What You'll Learn
- Read and understand any Suricata rule by breaking it into action, header, and options
- Identify key rule keywords: content, flow, sid, rev, msg, classtype, threshold
- Understand severity categories and how they map to alert priority
- Navigate EveBox's alert management interface (inbox, escalate, archive)
- Explain the difference between ET (Emerging Threats) community rules and custom rules
- Write a basic rule description from a given rule signature
Rules Are the Heart of Detection
In the previous lesson you learned how a Network Intrusion Detection System watches traffic — sniffing packets on the wire, reassembling streams, and comparing what it sees against a library of known-bad patterns. That library is a ruleset, and without it Suricata is nothing more than an expensive packet sniffer.
Rules are what turn raw network data into actionable intelligence. Every alert that appears in your dashboard exists because a rule matched. Every threat that goes undetected slipped past because no rule covered it. Understanding how rules work — how they're structured, where they come from, and how they're tuned — is the single most important skill for a network detection analyst.
This lesson breaks down Suricata's rule language piece by piece, walks through the major rule sources, explains the severity classification system, and then shows you how to navigate alerts in EveBox, the management interface you'll use in every network detection lab going forward.
Anatomy of a Suricata Rule
Every Suricata rule is a single line of text with two major sections: the header (what traffic to inspect) and the options (what to look for and how to report it). Let's start with a real rule from the lab environment:
alert http $EXTERNAL_NET any -> $HOME_NET any (msg:"CYBERBLUE EXPLOIT - SQL Injection sqlmap User-Agent"; flow:to_server,established; content:"sqlmap"; http_user_agent; classtype:web-application-attack; sid:9000010; rev:1;)
This rule fires when Suricata sees an HTTP request from an external address to an internal server where the User-Agent header contains the string "sqlmap" — the default fingerprint of the popular SQL injection tool. Let's dissect it.
The Action
The first word in every rule tells Suricata what to do when the rule matches:
| Action | Behavior |
|---|---|
| alert | Generate an alert and log the event (IDS mode — most common) |
| pass | Stop processing this packet — whitelist it |
| drop | Block the packet silently (IPS mode only) |
| reject | Block the packet and send a TCP RST or ICMP unreachable back to the sender (IPS mode only) |
In the CyberBlueSOC lab, Suricata runs in IDS mode, so every matching rule uses alert. In production environments running IPS (Inline Prevention), security engineers may promote high-confidence rules to drop so malicious traffic is blocked automatically.
The Header
The header specifies the protocol, source address and port, direction, and destination address and port:
alert http $EXTERNAL_NET any -> $HOME_NET any
^^^^ ^^^^^^^^^^^^^ ^^^ ^^^^^^^^^ ^^^
proto src_addr src_port dst_addr dst_port
- Protocol:
http,tcp,udp,icmp,tls,dns,smtp,ftp, or the genericip. Using application-layer protocols likehttpunlocks protocol-specific keywords (sticky buffers). - Source/Destination: Variables like
$HOME_NET(your internal network) and$EXTERNAL_NET(everything else) are defined insuricata.yaml. Using variables instead of hard-coded IPs means the same ruleset works across different network configurations. - Direction:
->means source-to-destination.<>means bidirectional (match traffic in either direction). - Ports:
anymatches all ports. You can specify single ports (443), ranges (1024:65535), or lists ([80,443,8080]).
The Options
Everything inside the parentheses is a semicolon-delimited list of keywords that define the detection logic and metadata. This is where the real intelligence lives.
Here's a detailed reference for the keywords you'll encounter most:
| Keyword | Purpose | Example |
|---|---|---|
| msg | Alert message displayed to the analyst | "SQL Injection detected" |
| content | Byte or string pattern to match in traffic | "sqlmap" |
| flow | Direction and state of the connection | to_server,established |
| http_user_agent | Match against the HTTP User-Agent header | (sticky buffer modifier) |
| sid | Unique Suricata rule identifier | 9000010 |
| rev | Rule revision number (incremented on updates) | 1 |
| classtype | Alert category for severity classification | web-application-attack |
| threshold | Rate limiting — suppress duplicate alerts | type limit, track by_src, count 1, seconds 60 |
| pcre | Perl-compatible regex matching for complex patterns | "/union.*select/i" |
| reference | URL for more information about the threat | url,attack.mitre.org/techniques/T1190 |
A few keywords deserve extra attention:
content is the workhorse. Most rules match specific strings or byte sequences in the traffic. You can have multiple content matches in a single rule, and they're evaluated in order. The nocase modifier makes the match case-insensitive. The depth, offset, distance, and within modifiers constrain where in the payload the content must appear — this reduces false positives and improves performance.
Sticky buffers like http_user_agent, http_uri, http_header, and http_method tell Suricata to apply the preceding content match only against a specific part of the parsed HTTP request rather than the entire payload. The rule above uses http_user_agent so that "sqlmap" is matched only in the User-Agent header — not anywhere else in the HTTP stream.
flow ensures Suricata only checks traffic in the right direction and state. to_server,established means "match packets going from the client to the server in an already-established TCP session." This prevents false positives on SYN packets, retransmissions, and server responses.
Reading Rules Quickly: After you've seen a few dozen rules, you'll develop a pattern. Start with msg to understand what the rule detects. Then look at content keywords to see what specific strings or patterns it matches. Check flow and any sticky buffers to understand the context. Finally, note the sid — you'll use this to reference the rule in reports and tuning requests.
Rule Sources — ET Rules vs Custom Rules
No SOC writes every rule from scratch. The Suricata ecosystem provides massive community-maintained rulesets that cover known threats, plus the ability to add your own.
ET (Emerging Threats) Community Rules
The Emerging Threats (ET) Community ruleset is the backbone of most Suricata deployments. Maintained by Proofpoint, it includes:
- 40,000+ signatures covering malware, exploits, botnets, C2 infrastructure, policy violations, and more
- Daily updates reflecting the latest threat intelligence
- Free for any use — commercial or non-commercial
- Categorized by threat type with standardized naming:
ET MALWARE,ET EXPLOIT,ET SCAN,ET POLICY,ET TROJAN,ET CNC(command and control)
When you see an alert like "ET SCAN Sqlmap SQL Injection Scan" in EveBox, the "ET" prefix tells you the signature came from the Emerging Threats community ruleset. The naming convention immediately communicates the threat category.
ET Pro Rules
ET Pro is the commercial tier from Proofpoint. It includes everything in the community set plus:
- Faster release cycle (signatures for zero-days within hours)
- More signatures for advanced threats, targeted attacks, and APT infrastructure
- Commercial support and SLA guarantees
Most enterprise SOCs pay for ET Pro. For training and smaller deployments, the community set is more than sufficient.
Custom Rules
Every organization has unique detection needs. Custom rules cover:
- Internal policy enforcement — detecting unauthorized VPN clients, unapproved cloud storage services, or protocol violations
- Organization-specific IOCs — rules built from your own threat intelligence or incident investigations
- Gap-filling — covering threats that community rules haven't addressed yet
In the CyberBlueSOC lab environment, custom rules use the CYBERBLUE prefix and SID range 9000xxx. These sit alongside ET community rules in the same ruleset.
The "Operation Wire Tap" lab scenario (Labs 3.1 and 3.2) includes 25 custom CYBERBLUE rules alongside ET community rules, producing 47 unique alert signatures across 49 alert groups. You'll see both sources firing on the same traffic — an ET rule catching a known sqlmap user-agent while a CYBERBLUE rule flags the SQL injection payload in the URI. This dual-coverage mirrors real production environments where community and custom rules complement each other.
Severity and Classification
Not all alerts are equal. A port scan from a known scanner is noise. A confirmed C2 beacon from an internal host is a five-alarm fire. Suricata uses the classtype keyword to categorize alerts by severity, and EveBox uses these classifications to help you prioritize your queue.
Priority Levels
| Priority | Severity | Example Classtypes | What It Means |
|---|---|---|---|
| 1 | Critical | trojan-activity, exploit-kit, web-application-attack | Active exploitation or confirmed malware — investigate immediately |
| 2 | High | attempted-admin, policy-violation, attempted-user | Serious attempt that may have succeeded — investigate soon |
| 3 | Medium | misc-attack, suspicious-login, attempted-recon | Suspicious but not confirmed malicious — triage and assess |
| 4 | Low | not-suspicious, protocol-command-decode, network-scan | Informational or low-confidence — review during quiet periods |
The priority assignment comes from the classification.config file that ships with Suricata. When a rule specifies classtype:web-application-attack, Suricata looks up that classtype in the config and assigns priority 1. Rule authors can also override the default priority with an explicit priority keyword.
In real SOC operations, analysts filter EveBox by severity to work the most critical alerts first. A priority-1 C2 alert should never wait in the queue while you investigate priority-4 protocol anomalies. Build the habit now: when you open EveBox, sort by severity, handle criticals first, then work your way down. This mirrors how every production SOC manages alert fatigue.
Severity in Context
Raw severity is a starting point, not the final word. Context transforms a medium-severity alert into a critical incident:
- A port scan (priority 3) from an external IP is routine. A port scan from an internal server that shouldn't be scanning is priority 1 — it suggests lateral movement.
- A policy violation (priority 2) for TLS to a crypto-mining pool is annoying. The same violation from a domain controller means it's compromised.
- A single C2 beacon (priority 1) is bad. The same beacon firing every 60 seconds for 6 hours means the attacker has persistent, reliable access.
Alert count and source context always modify the baseline severity. This is a judgment call that no rule engine can make for you — it's why organizations hire SOC analysts.
EveBox — Your Alert Management Dashboard
EveBox is a web-based interface purpose-built for managing Suricata alerts. While Suricata writes detection events to eve.json (its unified log format), EveBox reads that data and presents it in a clean, searchable, analyst-friendly dashboard. In the CyberBlueSOC lab, EveBox is your primary tool for network alert investigation.
The Inbox
The Inbox is your starting point. It displays alerts grouped by signature — rather than showing 200 individual C2 beacon alerts, EveBox groups them under a single entry with a count badge showing how many times that signature fired. This grouping prevents alert fatigue and lets you focus on the unique threats.
Each inbox entry shows:
- Signature name — the
msgfield from the rule - Alert count — how many times this signature fired in the selected time range
- Severity indicator — color-coded by priority
- Latest timestamp — when the most recent instance fired
- Source and destination IPs — the most common pairs
Alert Details
Clicking into an alert group reveals the individual events. For each event, EveBox shows:
- Full timestamp with microsecond precision
- Source IP and port → Destination IP and port
- Protocol and any parsed application-layer data (HTTP headers, DNS queries, TLS SNI)
- Rule metadata — SID, classtype, the full rule text
- Packet payload — the actual bytes that matched the rule (when available)
Actions
EveBox provides three workflow actions for managing alerts:
- Escalate — flag the alert for deeper investigation. Escalated alerts move to a separate view so they don't get lost in the noise.
- Archive — acknowledge the alert and remove it from the active inbox. Use this for confirmed false positives, tuned-out signatures, or alerts you've fully investigated.
- Comment (in some deployments) — add analyst notes directly to the alert for team communication.
Filters and Search
The filter bar at the top of EveBox lets you narrow results by:
- Time range — last hour, last 24 hours, last 7 days, or custom
- Severity — show only critical, or filter out low/informational
- Source or destination IP — focus on a specific host
- Signature text — search for keywords in the alert message
- Event type — EveBox doesn't just show alerts. Suricata's
eve.jsonalso contains HTTP logs, DNS logs, TLS logs, and flow records. You can switch between these event types to get full protocol visibility.
Alert count matters. A signature firing 200 times from the same source tells a very different story than the same signature firing twice. 200 instances of a port scan means aggressive reconnaissance — likely automated. 200 instances of a C2 beacon means a compromised host has been calling home repeatedly, suggesting established persistent access. Two instances of the same scan might be incidental. Always check the count before deciding how to prioritize.
Reading an Alert in EveBox
Let's walk through a specific alert from the Operation Wire Tap lab scenario to practice the skill of extracting actionable intelligence from an EveBox entry.
The Alert
Signature: CYBERBLUE C2 - HTTP Beacon to Known C2 Server 203.0.113.66
Source: 10.0.0.50:49821
Destination: 203.0.113.66:80
Protocol: HTTP
Category: trojan-activity (Priority 1)
Count: 14
Breaking It Down
Signature name: The "CYBERBLUE" prefix tells you this is a custom rule (not an ET community rule). "C2" categorizes the threat. "HTTP Beacon" describes the behavior — the compromised host is periodically checking in with the C2 server over HTTP. The rule author embedded the destination IP in the message for quick identification.
Source: 10.0.0.50 is an internal host (RFC 1918 address space). This is a workstation or server inside your network that is communicating outbound to a known-bad IP. The ephemeral source port (49821) confirms this is a client-initiated connection.
Destination: 203.0.113.66 on port 80 — an external IP address that the rule author has identified as C2 infrastructure. Port 80 is standard HTTP, which is a common choice for C2 traffic because it blends in with normal web browsing.
Category and Priority: trojan-activity is priority 1 — this is critical. The classification system is telling you that this signature indicates confirmed malicious activity, not just suspicious behavior.
Count: 14 instances. The compromised host beaconed 14 times during the capture window. Regular, repeated communication to a C2 server indicates the attacker has reliable remote access and the implant is actively checking in for commands.
What This Tells the Analyst
This single alert gives you an entire narrative: an internal host (10.0.0.50) has been compromised and is communicating with attacker-controlled infrastructure (203.0.113.66) over HTTP. The beacon is periodic (14 times), indicating an active implant. Your next steps:
- Isolate
10.0.0.50from the network to prevent further C2 communication - Check EveBox for other signatures involving
10.0.0.50— look for lateral movement, data exfiltration, or additional tool downloads - Query
203.0.113.66in your threat intel platform (MISP) for related infrastructure - Pivot to endpoint investigation (Velociraptor in later modules) to identify the malware process
Never ignore C2 alerts — even a single confirmed C2 beacon means the attacker has remote access to your network. Unlike a failed exploit or a blocked scan, C2 communication indicates a successful compromise where the attacker can issue commands, exfiltrate data, and move laterally at will. A C2 alert is not "something to look at later" — it demands immediate investigation and containment.
Putting It All Together: From Rule to Alert to Action
The workflow you'll follow in every network detection lab is:
- Suricata processes traffic — packets are inspected against thousands of rules
- Matching rules fire alerts — written to
eve.jsonwith full metadata - EveBox ingests the alerts — groups them by signature, displays severity
- You triage in EveBox — sort by priority, read alert details, assess context
- You investigate — pivot to packet captures, threat intel, or endpoint tools
- You take action — escalate, document, or archive based on your assessment
This is the same workflow that network security analysts follow in production SOCs worldwide. The tools may have different names at different organizations, but the process — rule match, alert triage, investigation, action — is universal.
Key Takeaways
- Every Suricata rule has two parts: the header (protocol, addresses, ports, direction) and the options (detection logic and metadata inside parentheses)
- The four actions are alert (log it), pass (whitelist it), drop (block silently), and reject (block and notify sender)
- Key options keywords: msg (alert text), content (pattern match), flow (direction/state), sid (unique ID), classtype (severity category)
- ET Community rules provide 40,000+ free signatures updated daily; custom rules fill organization-specific gaps (CYBERBLUE rules use SID 9000xxx)
- Severity runs from Priority 1 (critical — trojan-activity, exploits) down to Priority 4 (low — informational, protocol decode)
- EveBox groups alerts by signature, shows counts and details, and supports escalate/archive workflow actions
- Always assess alert count and context alongside raw severity — the same signature firing 200 times tells a different story than firing twice
What's Next
You can now read any Suricata rule and understand exactly what it detects, and you know how to navigate EveBox to find, prioritize, and manage alerts. In the next lesson — Protocol Analysis — you'll go deeper into the actual traffic data. You'll learn to analyze HTTP headers, TLS fingerprints, DNS queries, and SMB commands to distinguish normal protocol behavior from malicious abuse. Where this lesson taught you to understand the rules, the next teaches you to understand the traffic itself.
Knowledge Check: Suricata Rules & EveBox
10 questions · 70% to pass
In a Suricata rule, what are the two major structural sections?
What does the "flow:to_server,established" keyword mean in a Suricata rule?
What is the purpose of the "classtype" keyword in a Suricata rule?
What is the difference between the Suricata actions 'drop' and 'reject'?
What are sticky buffers in Suricata rules, and why are they important?
Which severity priority level does the classtype 'trojan-activity' map to?
In EveBox, what does it mean when alerts are 'grouped by signature'?
In the Operation Wire Tap lab scenario, the SQL injection rule (sid:9000010) matches the string "sqlmap" using the http_user_agent sticky buffer. Why does the rule use http_user_agent instead of a generic content match against the full payload?
In EveBox during the Operation Wire Tap scenario, you see the alert "CYBERBLUE C2 - HTTP Beacon to Known C2 Server 203.0.113.66" with 14 instances from source 10.0.0.50. What does this alert pattern indicate, and what should be your first response?
In the Operation Wire Tap lab, you encounter both ET community rules (e.g., "ET SCAN Sqlmap SQL Injection Scan") and custom CYBERBLUE rules (sid 9000xxx) firing on the same traffic. What does this dual coverage demonstrate about rule management in production environments?
0/10 answered