Configuring Suricata for Network Monitoring
When to Use
- Deploying a high-performance IDS/IPS capable of multi-threaded packet processing for 10+ Gbps network links
- Monitoring network traffic with protocol-aware inspection for HTTP, TLS, DNS, SMB, and other protocols
- Generating structured EVE JSON logs for direct SIEM ingestion without custom parsers
- Running in inline (IPS) mode to actively block malicious traffic at network choke points
- Combining signature-based detection with protocol anomaly detection and file extraction
Do not use as a standalone security solution without complementary controls, for encrypted traffic inspection without TLS decryption capabilities, or on systems with insufficient CPU/memory for the expected traffic volume.
Prerequisites
- Suricata 7.0+ installed from PPA or source (
suricata --build-info)
- Network interface on a span port, tap, or inline bridge for traffic capture
- AF_PACKET or DPDK support for high-performance packet capture
- Emerging Threats Open or Pro ruleset subscription (or Snort Talos rules via oinkcode)
- suricata-update tool for automated rule management
- Elasticsearch/Kibana or Splunk for log analysis and visualization
Workflow
Step 1: Install Suricata and Dependencies
# Install from PPA (Ubuntu/Debian)
sudo add-apt-repository ppa:oisf/suricata-stable
sudo apt update
sudo apt install -y suricata suricata-update jq
# Verify installation
suricata --build-info | grep -E "Version|AF_PACKET|NFQueue"
# Or install from source for latest features
sudo apt install -y libpcre2-dev build-essential autoconf automake libtool \
libpcap-dev libnet1-dev libyaml-dev libjansson-dev libcap-ng-dev \
libmagic-dev libnetfilter-queue-dev libhiredis-dev rustc cargo cbindgen
git clone https://github.com/OISF/suricata.git
cd suricata && git clone https://github.com/OISF/libhtp.git -b 0.5.x
./autogen.sh && ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
--enable-nfqueue --enable-af-packet
make -j$(nproc) && sudo make install install-conf
Step 2: Configure Network Interfaces
# Disable NIC offloading features
sudo ethtool -K eth1 gro off lro off tso off gso off rx off tx off sg off
# Set interface to promiscuous mode
sudo ip link set eth1 promisc on
# For high-performance deployments, configure AF_PACKET with multiple threads
# Edit /etc/suricata/suricata.yaml
Step 3: Configure suricata.yaml
# /etc/suricata/suricata.yaml (key sections)
# Network variables
vars:
address-groups:
HOME_NET: "[10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16]"
EXTERNAL_NET: "!$HOME_NET"
HTTP_SERVERS: "$HOME_NET"
DNS_SERVERS: "$HOME_NET"
SMTP_SERVERS: "$HOME_NET"
# Default rule path
default-rule-path: /var/lib/suricata/rules
rule-files:
- suricata.rules
# AF_PACKET configuration for high performance
af-packet:
- interface: eth1
threads: auto
cluster-id: 99
cluster-type: cluster_flow
defrag: yes
use-mmap: yes
ring-size: 200000
buffer-size: 262144
# EVE JSON logging (primary output format)
outputs:
- eve-log:
enabled: yes
filetype: regular
filename: eve.json
pcap-file: false
community-id: true
types:
- alert:
tagged-packets: yes
payload: yes
payload-printable: yes
http-body: yes
http-body-printable: yes
- http:
extended: yes
- dns:
query: yes
answer: yes
- tls:
extended: yes
- files:
force-magic: yes
force-hash: [md5, sha256]
- smtp:
extended: yes
- flow
- netflow
- anomaly:
enabled: yes
- stats:
totals: yes
threads: yes
# PCAP logging for captured packets that trigger alerts
- pcap-log:
enabled: yes
filename: alert-%n.pcap
limit: 100mb
max-files: 50
mode: normal
use-stream-depth: no
honor-pass-rules: no
# Stream engine settings
stream:
memcap: 512mb
checksum-validation: no
reassembly:
memcap: 1gb
depth: 1mb
toserver-chunk-size: 2560
toclient-chunk-size: 2560
# Detection engine
detect:
profile: high
custom-values:
toclient-groups: 200
toserver-groups: 200
sgh-mpm-context: auto
inspection-recursion-limit: 3000
# Protocol detection and parsing
app-layer:
protocols:
http:
enabled: yes
memcap: 64mb
tls:
enabled: yes
detection-ports:
dp: 443, 8443
ja3-fingerprints: yes
dns:
enabled: yes
tcp:
enabled: yes
udp:
enabled: yes
smb:
enabled: yes
detection-ports:
dp: 139, 445
ssh:
enabled: yes
hassh: yes
Step 4: Download and Manage Rulesets
# Update Suricata rules using suricata-update
sudo suricata-update
# Enable additional rule sources
sudo suricata-update list-sources
sudo suricata-update enable-source et/open
sudo suricata-update enable-source oisf/trafficid
sudo suricata-update enable-source ptresearch/attackdetection
# Update with all enabled sources
sudo suricata-update
# Check rule statistics
sudo suricata-update list-sources --enabled
wc -l /var/lib/suricata/rules/suricata.rules
# Disable noisy rules
sudo tee /etc/suricata/disable.conf << 'EOF'
# Disable overly broad rules
2100498
2013028
2210000-2210050
group:emerging-policy.rules
EOF
# Create custom local rules
sudo tee /etc/suricata/rules/local.rules << 'EOF'
# Detect reverse shell connections
alert tcp $HOME_NET any -> $EXTERNAL_NET 4444 (msg:"LOCAL Reverse Shell Port 4444"; flow:established,to_server; content:"|2f 62 69 6e 2f|"; sid:9000001; rev:1; classtype:trojan-activity; priority:1;)
# Detect DNS tunneling by query length
alert dns $HOME_NET any -> any any (msg:"LOCAL DNS Tunneling Long Query"; dns.query; content:"."; offset:50; sid:9000002; rev:1; classtype:policy-violation; priority:2;)
# Detect TLS to suspicious JA3 hash (Cobalt Strike default)
alert tls $HOME_NET any -> $EXTERNAL_NET any (msg:"LOCAL Cobalt Strike JA3 Hash"; ja3.hash; content:"72a589da586844d7f0818ce684948eea"; sid:9000003; rev:1; classtype:trojan-activity; priority:1;)
# Detect SSH brute force
alert ssh $EXTERNAL_NET any -> $HOME_NET 22 (msg:"LOCAL SSH Brute Force Attempt"; flow:to_server; threshold:type both, track by_src, count 10, seconds 60; sid:9000004; rev:1; classtype:attempted-admin; priority:2;)
# Detect data exfiltration via HTTP POST (large uploads)
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"LOCAL Large HTTP POST Upload"; flow:to_server,established; http.method; content:"POST"; http.content_len; content:">"; byte_test:8,>,10000000,0,string; sid:9000005; rev:1; classtype:policy-violation; priority:2;)
EOF
# Add local rules to configuration
echo " - local.rules" | sudo tee -a /etc/suricata/suricata.yaml
Step 5: Deploy and Validate
# Validate configuration
sudo suricata -T -c /etc/suricata/suricata.yaml -v
# Run Suricata in IDS mode
sudo suricata -c /etc/suricata/suricata.yaml --af-packet=eth1 -D
# Or run in IPS mode (inline with NFQueue)
# First configure iptables to send traffic to NFQueue
# sudo iptables -I FORWARD -j NFQUEUE --queue-num 0
# sudo suricata -c /etc/suricata/suricata.yaml -q 0 -D
# Create systemd service
sudo tee /etc/systemd/system/suricata.service << 'EOF'
[Unit]
Description=Suricata IDS/IPS
After=network.target
Requires=network.target
[Service]
Type=simple
ExecStartPre=/usr/bin/suricata -T -c /etc/suricata/suricata.yaml
ExecStart=/usr/bin/suricata -c /etc/suricata/suricata.yaml --af-packet=eth1 --pidfile /var/run/suricata.pid
ExecReload=/bin/kill -USR2 $MAINPID
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl enable --now suricata
# Test with a known signature
curl http://testmynids.org/uid/index.html
# Should trigger ET GPL rule for uid.
# Verify alerts are generated
sudo tail -f /var/log/suricata/eve.json | jq 'select(.event_type=="alert")'
Step 6: Integrate with SIEM and Monitor
# Parse EVE JSON with jq for quick analysis
# Top 10 alerts
cat /var/log/suricata/eve.json | jq -r 'select(.event_type=="alert") | .alert.signature' | sort | uniq -c | sort -rn | head -10
# Extract IOCs from alerts
cat /var/log/suricata/eve.json | jq -r 'select(.event_type=="alert") | [.timestamp, .src_ip, .dest_ip, .alert.signature, .alert.severity] | @csv' > alert_summary.csv
# JA3 fingerprint analysis
cat /var/log/suricata/eve.json | jq -r 'select(.event_type=="tls") | [.src_ip, .tls.ja3.hash, .tls.sni] | @csv' | sort | uniq -c | sort -rn
# DNS query analysis
cat /var/log/suricata/eve.json | jq -r 'select(.event_type=="dns" and .dns.type=="query") | [.src_ip, .dns.rrname, .dns.rrtype] | @csv' | sort | uniq -c | sort -rn | head -20
# Configure Filebeat for Elastic integration
sudo tee /etc/filebeat/modules.d/suricata.yml << 'EOF'
- module: suricata
eve:
enabled: true
var.paths: ["/var/log/suricata/eve.json"]
EOF
sudo filebeat modules enable suricata
sudo systemctl restart filebeat
# Monitor Suricata performance
cat /var/log/suricata/eve.json | jq 'select(.event_type=="stats") | .stats.capture' | tail -1
# Check for packet drops: kernel_drops should be 0
Key Concepts
| Term |
Definition |
| EVE JSON |
Suricata's primary logging format producing structured JSON events for alerts, protocol metadata, flow records, and statistics |
| AF_PACKET |
Linux kernel packet capture mechanism used by Suricata for high-performance traffic capture with kernel-bypass capabilities |
| JA3/JA3S |
TLS fingerprinting method that creates hash values from TLS Client Hello and Server Hello parameters for identifying applications and malware |
| HASSH |
SSH fingerprinting method similar to JA3 that creates hashes from SSH key exchange parameters to identify SSH client and server implementations |
| Community ID |
Standardized flow identifier hash that enables correlation of the same network flow across different monitoring tools (Suricata, Zeek, Wireshark) |
| suricata-update |
Official rule management tool that downloads, merges, and manages multiple rulesets with enable/disable controls |
Tools & Systems
- Suricata 7.0+: Open-source multi-threaded IDS/IPS/NSM engine with protocol detection, file extraction, and JA3/HASSH fingerprinting
- suricata-update: Ruleset management tool supporting ET Open, ET Pro, Snort rules, and custom rule sources
- Elastic Stack (ELK): Log aggregation and visualization platform with native Suricata module in Filebeat for dashboards and alerting
- Scirius: Web-based Suricata rule management interface for editing, enabling/disabling, and monitoring rule performance
- Evebox: Lightweight event viewer for Suricata EVE JSON logs with alert management and escalation capabilities
Common Scenarios
Scenario: Deploying Suricata IDS on a 10 Gbps Enterprise Network Perimeter
Context: A technology company needs to deploy IDS at their internet egress point handling 10 Gbps of traffic. They require protocol-level metadata logging for threat hunting, signature-based alerting for known threats, and JA3 fingerprinting for detecting malware C2 communications. Alerts must feed into their Elastic SIEM.
Approach:
- Deploy Suricata on a server with 16 CPU cores, 64 GB RAM, and dual 10G NICs using AF_PACKET with 14 worker threads
- Enable ET Open and ptresearch/attackdetection rulesets via suricata-update, totaling approximately 35,000 active rules
- Configure EVE JSON logging with community-id, extended HTTP/TLS/DNS metadata, and file hashing (MD5 + SHA256)
- Enable JA3 and HASSH fingerprinting for TLS and SSH traffic profiling
- Write custom rules for organization-specific threats: known bad JA3 hashes, DNS queries to DGA domains, large data uploads to uncommon destinations
- Integrate with Elastic via Filebeat's Suricata module, deploying pre-built Kibana dashboards for real-time visibility
- Tune rules over a 2-week baseline period, disabling false-positive generators and adjusting thresholds
Pitfalls:
- Not allocating sufficient CPU threads, causing packet drops at peak traffic volumes
- Enabling all available rules without tuning, overwhelming analysts with false positives
- Forgetting to disable NIC offloading, resulting in incorrect checksums and missed detections
- Not enabling community-id, making it difficult to correlate Suricata events with Zeek or other tools
Output Format
## Suricata IDS Deployment Report
**Sensor**: suricata-gw-01 (10.10.1.251)
**Interface**: eth1 (span from border router)
**Configuration**: /etc/suricata/suricata.yaml
**Worker Threads**: 14 AF_PACKET threads
**Active Rules**: 35,247 (ET Open + Custom)
### Performance Metrics (24-hour)
| Metric | Value |
|--------|-------|
| Packets Processed | 847,293,421 |
| Kernel Drops | 0 (0.000%) |
| Alerts Generated | 1,247 |
| Unique Signatures Fired | 89 |
| JA3 Fingerprints Observed | 342 unique |
| Files Extracted | 2,847 |
### Top 10 Alert Signatures
| Count | SID | Signature | Severity |
|-------|-----|-----------|----------|
| 312 | 2024897 | ET POLICY curl User-Agent Outbound | 3 |
| 189 | 9000003 | LOCAL Cobalt Strike JA3 Hash | 1 |
| 145 | 2028765 | ET SCAN Nmap SYN Scan | 2 |
| 98 | 9000002 | LOCAL DNS Tunneling Long Query | 2 |
### Critical Alerts Requiring Immediate Triage
1. SID 9000003: Cobalt Strike JA3 from 10.10.5.12 to 203.0.113.50 (189 alerts)
2. SID 9000002: DNS tunneling from 10.10.3.45 to suspect-domain.xyz (98 alerts)
1---
2name: configuring-suricata-for-network-monitoring
3description: 'Deploys and configures Suricata IDS/IPS with Emerging Threats rulesets,
4 EVE JSON logging, and custom rules for real-time network traffic inspection, threat
5 detection, and integration with SIEM platforms for centralized security monitoring.
6
7 '
8domain: cybersecurity
9subdomain: network-security
10tags:
11- network-security
12- suricata
13- ids
14- ips
15- network-monitoring
16version: '1.0'
17author: mahipal
18license: Apache-2.0
19nist_csf:
20- PR.IR-01
21- DE.CM-01
22- ID.AM-03
23- PR.DS-02
24mitre_attack:
25- T1046
26- T1071.001
27- T1572
28- T1048
29- T1573.001
30source: https://github.com/mukul975/Anthropic-Cybersecurity-Skills
31source_commit: 04450304b12645cb2b974ab96d28c0664758a88d
32note: "Vendored verbatim from an external Apache-2.0 security-skill library, pinned by commit. Exceeds the internal 300-line skill guideline (agent-code-constraints.md) -- kept as-is because this is vendored reference material (forensics/threat-intel procedure), not Yana AI-authored content, and trimming would damage technical accuracy."
33metadata:
34 source: https://skillmd.com/skills/yanacuti1121/configuring-suricata-for-network-monitoring
35---
36
37# Configuring Suricata for Network Monitoring
38
39## When to Use
40
41- Deploying a high-performance IDS/IPS capable of multi-threaded packet processing for 10+ Gbps network links
42- Monitoring network traffic with protocol-aware inspection for HTTP, TLS, DNS, SMB, and other protocols
43- Generating structured EVE JSON logs for direct SIEM ingestion without custom parsers
44- Running in inline (IPS) mode to actively block malicious traffic at network choke points
45- Combining signature-based detection with protocol anomaly detection and file extraction
46
47**Do not use** as a standalone security solution without complementary controls, for encrypted traffic inspection without TLS decryption capabilities, or on systems with insufficient CPU/memory for the expected traffic volume.
48
49## Prerequisites
50
51- Suricata 7.0+ installed from PPA or source (`suricata --build-info`)
52- Network interface on a span port, tap, or inline bridge for traffic capture
53- AF_PACKET or DPDK support for high-performance packet capture
54- Emerging Threats Open or Pro ruleset subscription (or Snort Talos rules via oinkcode)
55- suricata-update tool for automated rule management
56- Elasticsearch/Kibana or Splunk for log analysis and visualization
57
58## Workflow
59
60### Step 1: Install Suricata and Dependencies
61
62```bash
63# Install from PPA (Ubuntu/Debian)
64sudo add-apt-repository ppa:oisf/suricata-stable
65sudo apt update
66sudo apt install -y suricata suricata-update jq
67
68# Verify installation
69suricata --build-info | grep -E "Version|AF_PACKET|NFQueue"
70
71# Or install from source for latest features
72sudo apt install -y libpcre2-dev build-essential autoconf automake libtool \
73 libpcap-dev libnet1-dev libyaml-dev libjansson-dev libcap-ng-dev \
74 libmagic-dev libnetfilter-queue-dev libhiredis-dev rustc cargo cbindgen
75git clone https://github.com/OISF/suricata.git
76cd suricata && git clone https://github.com/OISF/libhtp.git -b 0.5.x
77./autogen.sh && ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
78 --enable-nfqueue --enable-af-packet
79make -j$(nproc) && sudo make install install-conf
80```
81
82### Step 2: Configure Network Interfaces
83
84```bash
85# Disable NIC offloading features
86sudo ethtool -K eth1 gro off lro off tso off gso off rx off tx off sg off
87
88# Set interface to promiscuous mode
89sudo ip link set eth1 promisc on
90
91# For high-performance deployments, configure AF_PACKET with multiple threads
92# Edit /etc/suricata/suricata.yaml
93```
94
95### Step 3: Configure suricata.yaml
96
97```yaml
98# /etc/suricata/suricata.yaml (key sections)
99
100# Network variables
101vars:
102 address-groups:
103 HOME_NET: "[10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16]"
104 EXTERNAL_NET: "!$HOME_NET"
105 HTTP_SERVERS: "$HOME_NET"
106 DNS_SERVERS: "$HOME_NET"
107 SMTP_SERVERS: "$HOME_NET"
108
109# Default rule path
110default-rule-path: /var/lib/suricata/rules
111rule-files:
112 - suricata.rules
113
114# AF_PACKET configuration for high performance
115af-packet:
116 - interface: eth1
117 threads: auto
118 cluster-id: 99
119 cluster-type: cluster_flow
120 defrag: yes
121 use-mmap: yes
122 ring-size: 200000
123 buffer-size: 262144
124
125# EVE JSON logging (primary output format)
126outputs:
127 - eve-log:
128 enabled: yes
129 filetype: regular
130 filename: eve.json
131 pcap-file: false
132 community-id: true
133 types:
134 - alert:
135 tagged-packets: yes
136 payload: yes
137 payload-printable: yes
138 http-body: yes
139 http-body-printable: yes
140 - http:
141 extended: yes
142 - dns:
143 query: yes
144 answer: yes
145 - tls:
146 extended: yes
147 - files:
148 force-magic: yes
149 force-hash: [md5, sha256]
150 - smtp:
151 extended: yes
152 - flow
153 - netflow
154 - anomaly:
155 enabled: yes
156 - stats:
157 totals: yes
158 threads: yes
159
160 # PCAP logging for captured packets that trigger alerts
161 - pcap-log:
162 enabled: yes
163 filename: alert-%n.pcap
164 limit: 100mb
165 max-files: 50
166 mode: normal
167 use-stream-depth: no
168 honor-pass-rules: no
169
170# Stream engine settings
171stream:
172 memcap: 512mb
173 checksum-validation: no
174 reassembly:
175 memcap: 1gb
176 depth: 1mb
177 toserver-chunk-size: 2560
178 toclient-chunk-size: 2560
179
180# Detection engine
181detect:
182 profile: high
183 custom-values:
184 toclient-groups: 200
185 toserver-groups: 200
186 sgh-mpm-context: auto
187 inspection-recursion-limit: 3000
188
189# Protocol detection and parsing
190app-layer:
191 protocols:
192 http:
193 enabled: yes
194 memcap: 64mb
195 tls:
196 enabled: yes
197 detection-ports:
198 dp: 443, 8443
199 ja3-fingerprints: yes
200 dns:
201 enabled: yes
202 tcp:
203 enabled: yes
204 udp:
205 enabled: yes
206 smb:
207 enabled: yes
208 detection-ports:
209 dp: 139, 445
210 ssh:
211 enabled: yes
212 hassh: yes
213```
214
215### Step 4: Download and Manage Rulesets
216
217```bash
218# Update Suricata rules using suricata-update
219sudo suricata-update
220
221# Enable additional rule sources
222sudo suricata-update list-sources
223sudo suricata-update enable-source et/open
224sudo suricata-update enable-source oisf/trafficid
225sudo suricata-update enable-source ptresearch/attackdetection
226
227# Update with all enabled sources
228sudo suricata-update
229
230# Check rule statistics
231sudo suricata-update list-sources --enabled
232wc -l /var/lib/suricata/rules/suricata.rules
233
234# Disable noisy rules
235sudo tee /etc/suricata/disable.conf << 'EOF'
236# Disable overly broad rules
2372100498
2382013028
2392210000-2210050
240group:emerging-policy.rules
241EOF
242
243# Create custom local rules
244sudo tee /etc/suricata/rules/local.rules << 'EOF'
245# Detect reverse shell connections
246alert tcp $HOME_NET any -> $EXTERNAL_NET 4444 (msg:"LOCAL Reverse Shell Port 4444"; flow:established,to_server; content:"|2f 62 69 6e 2f|"; sid:9000001; rev:1; classtype:trojan-activity; priority:1;)
247
248# Detect DNS tunneling by query length
249alert dns $HOME_NET any -> any any (msg:"LOCAL DNS Tunneling Long Query"; dns.query; content:"."; offset:50; sid:9000002; rev:1; classtype:policy-violation; priority:2;)
250
251# Detect TLS to suspicious JA3 hash (Cobalt Strike default)
252alert tls $HOME_NET any -> $EXTERNAL_NET any (msg:"LOCAL Cobalt Strike JA3 Hash"; ja3.hash; content:"72a589da586844d7f0818ce684948eea"; sid:9000003; rev:1; classtype:trojan-activity; priority:1;)
253
254# Detect SSH brute force
255alert ssh $EXTERNAL_NET any -> $HOME_NET 22 (msg:"LOCAL SSH Brute Force Attempt"; flow:to_server; threshold:type both, track by_src, count 10, seconds 60; sid:9000004; rev:1; classtype:attempted-admin; priority:2;)
256
257# Detect data exfiltration via HTTP POST (large uploads)
258alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"LOCAL Large HTTP POST Upload"; flow:to_server,established; http.method; content:"POST"; http.content_len; content:">"; byte_test:8,>,10000000,0,string; sid:9000005; rev:1; classtype:policy-violation; priority:2;)
259EOF
260
261# Add local rules to configuration
262echo " - local.rules" | sudo tee -a /etc/suricata/suricata.yaml
263```
264
265### Step 5: Deploy and Validate
266
267```bash
268# Validate configuration
269sudo suricata -T -c /etc/suricata/suricata.yaml -v
270
271# Run Suricata in IDS mode
272sudo suricata -c /etc/suricata/suricata.yaml --af-packet=eth1 -D
273
274# Or run in IPS mode (inline with NFQueue)
275# First configure iptables to send traffic to NFQueue
276# sudo iptables -I FORWARD -j NFQUEUE --queue-num 0
277# sudo suricata -c /etc/suricata/suricata.yaml -q 0 -D
278
279# Create systemd service
280sudo tee /etc/systemd/system/suricata.service << 'EOF'
281[Unit]
282Description=Suricata IDS/IPS
283After=network.target
284Requires=network.target
285
286[Service]
287Type=simple
288ExecStartPre=/usr/bin/suricata -T -c /etc/suricata/suricata.yaml
289ExecStart=/usr/bin/suricata -c /etc/suricata/suricata.yaml --af-packet=eth1 --pidfile /var/run/suricata.pid
290ExecReload=/bin/kill -USR2 $MAINPID
291Restart=on-failure
292
293[Install]
294WantedBy=multi-user.target
295EOF
296
297sudo systemctl enable --now suricata
298
299# Test with a known signature
300curl http://testmynids.org/uid/index.html
301# Should trigger ET GPL rule for uid.
302
303# Verify alerts are generated
304sudo tail -f /var/log/suricata/eve.json | jq 'select(.event_type=="alert")'
305```
306
307### Step 6: Integrate with SIEM and Monitor
308
309```bash
310# Parse EVE JSON with jq for quick analysis
311# Top 10 alerts
312cat /var/log/suricata/eve.json | jq -r 'select(.event_type=="alert") | .alert.signature' | sort | uniq -c | sort -rn | head -10
313
314# Extract IOCs from alerts
315cat /var/log/suricata/eve.json | jq -r 'select(.event_type=="alert") | [.timestamp, .src_ip, .dest_ip, .alert.signature, .alert.severity] | @csv' > alert_summary.csv
316
317# JA3 fingerprint analysis
318cat /var/log/suricata/eve.json | jq -r 'select(.event_type=="tls") | [.src_ip, .tls.ja3.hash, .tls.sni] | @csv' | sort | uniq -c | sort -rn
319
320# DNS query analysis
321cat /var/log/suricata/eve.json | jq -r 'select(.event_type=="dns" and .dns.type=="query") | [.src_ip, .dns.rrname, .dns.rrtype] | @csv' | sort | uniq -c | sort -rn | head -20
322
323# Configure Filebeat for Elastic integration
324sudo tee /etc/filebeat/modules.d/suricata.yml << 'EOF'
325- module: suricata
326 eve:
327 enabled: true
328 var.paths: ["/var/log/suricata/eve.json"]
329EOF
330
331sudo filebeat modules enable suricata
332sudo systemctl restart filebeat
333
334# Monitor Suricata performance
335cat /var/log/suricata/eve.json | jq 'select(.event_type=="stats") | .stats.capture' | tail -1
336# Check for packet drops: kernel_drops should be 0
337```
338
339## Key Concepts
340
341| Term | Definition |
342|------|------------|
343| **EVE JSON** | Suricata's primary logging format producing structured JSON events for alerts, protocol metadata, flow records, and statistics |
344| **AF_PACKET** | Linux kernel packet capture mechanism used by Suricata for high-performance traffic capture with kernel-bypass capabilities |
345| **JA3/JA3S** | TLS fingerprinting method that creates hash values from TLS Client Hello and Server Hello parameters for identifying applications and malware |
346| **HASSH** | SSH fingerprinting method similar to JA3 that creates hashes from SSH key exchange parameters to identify SSH client and server implementations |
347| **Community ID** | Standardized flow identifier hash that enables correlation of the same network flow across different monitoring tools (Suricata, Zeek, Wireshark) |
348| **suricata-update** | Official rule management tool that downloads, merges, and manages multiple rulesets with enable/disable controls |
349
350## Tools & Systems
351
352- **Suricata 7.0+**: Open-source multi-threaded IDS/IPS/NSM engine with protocol detection, file extraction, and JA3/HASSH fingerprinting
353- **suricata-update**: Ruleset management tool supporting ET Open, ET Pro, Snort rules, and custom rule sources
354- **Elastic Stack (ELK)**: Log aggregation and visualization platform with native Suricata module in Filebeat for dashboards and alerting
355- **Scirius**: Web-based Suricata rule management interface for editing, enabling/disabling, and monitoring rule performance
356- **Evebox**: Lightweight event viewer for Suricata EVE JSON logs with alert management and escalation capabilities
357
358## Common Scenarios
359
360### Scenario: Deploying Suricata IDS on a 10 Gbps Enterprise Network Perimeter
361
362**Context**: A technology company needs to deploy IDS at their internet egress point handling 10 Gbps of traffic. They require protocol-level metadata logging for threat hunting, signature-based alerting for known threats, and JA3 fingerprinting for detecting malware C2 communications. Alerts must feed into their Elastic SIEM.
363
364**Approach**:
3651. Deploy Suricata on a server with 16 CPU cores, 64 GB RAM, and dual 10G NICs using AF_PACKET with 14 worker threads
3662. Enable ET Open and ptresearch/attackdetection rulesets via suricata-update, totaling approximately 35,000 active rules
3673. Configure EVE JSON logging with community-id, extended HTTP/TLS/DNS metadata, and file hashing (MD5 + SHA256)
3684. Enable JA3 and HASSH fingerprinting for TLS and SSH traffic profiling
3695. Write custom rules for organization-specific threats: known bad JA3 hashes, DNS queries to DGA domains, large data uploads to uncommon destinations
3706. Integrate with Elastic via Filebeat's Suricata module, deploying pre-built Kibana dashboards for real-time visibility
3717. Tune rules over a 2-week baseline period, disabling false-positive generators and adjusting thresholds
372
373**Pitfalls**:
374- Not allocating sufficient CPU threads, causing packet drops at peak traffic volumes
375- Enabling all available rules without tuning, overwhelming analysts with false positives
376- Forgetting to disable NIC offloading, resulting in incorrect checksums and missed detections
377- Not enabling community-id, making it difficult to correlate Suricata events with Zeek or other tools
378
379## Output Format
380
381```
382## Suricata IDS Deployment Report
383
384**Sensor**: suricata-gw-01 (10.10.1.251)
385**Interface**: eth1 (span from border router)
386**Configuration**: /etc/suricata/suricata.yaml
387**Worker Threads**: 14 AF_PACKET threads
388**Active Rules**: 35,247 (ET Open + Custom)
389
390### Performance Metrics (24-hour)
391
392| Metric | Value |
393|--------|-------|
394| Packets Processed | 847,293,421 |
395| Kernel Drops | 0 (0.000%) |
396| Alerts Generated | 1,247 |
397| Unique Signatures Fired | 89 |
398| JA3 Fingerprints Observed | 342 unique |
399| Files Extracted | 2,847 |
400
401### Top 10 Alert Signatures
402
403| Count | SID | Signature | Severity |
404|-------|-----|-----------|----------|
405| 312 | 2024897 | ET POLICY curl User-Agent Outbound | 3 |
406| 189 | 9000003 | LOCAL Cobalt Strike JA3 Hash | 1 |
407| 145 | 2028765 | ET SCAN Nmap SYN Scan | 2 |
408| 98 | 9000002 | LOCAL DNS Tunneling Long Query | 2 |
409
410### Critical Alerts Requiring Immediate Triage
4111. SID 9000003: Cobalt Strike JA3 from 10.10.5.12 to 203.0.113.50 (189 alerts)
4122. SID 9000002: DNS tunneling from 10.10.3.45 to suspect-domain.xyz (98 alerts)
413```