[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EGFNJ6D7E2Z4TCTK2QTV1T":3,"skill-same:01M7EGFNJ6D7E2Z4TCTK2QTV1T":77},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":48,"repositoryHtmlUrl":49,"repositoryHomepageUrl":6,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M7EGFNJ6D7E2Z4TCTK2QTV1T","configuring-suricata-for-network-monitoring",null,"Deploys and configures Suricata IDS\u002FIPS with Emerging Threats rulesets, EVE JSON logging, and custom rules for high-throughput, protocol-aware traffic inspection (HTTP, TLS, DNS, SMB) and SIEM integration. Use when running Suricata in IDS or inline IPS mode to detect or block malicious traffic, or when combining signature-based and protocol anomaly detection with file extraction.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fconfiguring-suricata-for-network-monitoring\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: configuring-suricata-for-network-monitoring\ndescription: 'Deploys and configures Suricata IDS\u002FIPS with Emerging Threats rulesets,\n  EVE JSON logging, and custom rules for high-throughput, protocol-aware traffic\n  inspection (HTTP, TLS, DNS, SMB) and SIEM integration. Use when running Suricata\n  in IDS or inline IPS mode to detect or block malicious traffic, or when combining\n  signature-based and protocol anomaly detection with file extraction.\n\n  '\ndomain: cybersecurity\nsubdomain: network-security\ntags:\n- network-security\n- suricata\n- ids\n- ips\n- network-monitoring\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- PR.IR-01\n- DE.CM-01\n- ID.AM-03\n- PR.DS-02\nmitre_attack:\n- T1046\n- T1071.001\n- T1572\n- T1048\n- T1573.001\n---\n# Configuring Suricata for Network Monitoring\n\n## When to Use\n\n- Deploying a high-performance IDS\u002FIPS capable of multi-threaded packet processing for 10+ Gbps network links\n- Monitoring network traffic with protocol-aware inspection for HTTP, TLS, DNS, SMB, and other protocols\n- Generating structured EVE JSON logs for direct SIEM ingestion without custom parsers\n- Running in inline (IPS) mode to actively block malicious traffic at network choke points\n- Combining signature-based detection with protocol anomaly detection and file extraction\n\n**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\u002Fmemory for the expected traffic volume.\n\n## Prerequisites\n\n- Suricata 7.0+ installed from PPA or source (`suricata --build-info`)\n- Network interface on a span port, tap, or inline bridge for traffic capture\n- AF_PACKET or DPDK support for high-performance packet capture\n- Emerging Threats Open or Pro ruleset subscription (or Snort Talos rules via oinkcode)\n- suricata-update tool for automated rule management\n- Elasticsearch\u002FKibana or Splunk for log analysis and visualization\n\n## Workflow\n\n### Step 1: Install Suricata and Dependencies\n\n```bash\n# Install from PPA (Ubuntu\u002FDebian)\nsudo add-apt-repository ppa:oisf\u002Fsuricata-stable\nsudo apt update\nsudo apt install -y suricata suricata-update jq\n\n# Verify installation\nsuricata --build-info | grep -E \"Version|AF_PACKET|NFQueue\"\n\n# Or install from source for latest features\nsudo apt install -y libpcre2-dev build-essential autoconf automake libtool \\\n  libpcap-dev libnet1-dev libyaml-dev libjansson-dev libcap-ng-dev \\\n  libmagic-dev libnetfilter-queue-dev libhiredis-dev rustc cargo cbindgen\ngit clone https:\u002F\u002Fgithub.com\u002FOISF\u002Fsuricata.git\ncd suricata && git clone https:\u002F\u002Fgithub.com\u002FOISF\u002Flibhtp.git -b 0.5.x\n.\u002Fautogen.sh && .\u002Fconfigure --prefix=\u002Fusr --sysconfdir=\u002Fetc --localstatedir=\u002Fvar \\\n  --enable-nfqueue --enable-af-packet\nmake -j$(nproc) && sudo make install install-conf\n```\n\n### Step 2: Configure Network Interfaces\n\n```bash\n# Disable NIC offloading features\nsudo ethtool -K eth1 gro off lro off tso off gso off rx off tx off sg off\n\n# Set interface to promiscuous mode\nsudo ip link set eth1 promisc on\n\n# For high-performance deployments, configure AF_PACKET with multiple threads\n# Edit \u002Fetc\u002Fsuricata\u002Fsuricata.yaml\n```\n\n### Step 3: Configure suricata.yaml\n\n```yaml\n# \u002Fetc\u002Fsuricata\u002Fsuricata.yaml (key sections)\n\n# Network variables\nvars:\n  address-groups:\n    HOME_NET: \"[10.0.0.0\u002F8, 172.16.0.0\u002F12, 192.168.0.0\u002F16]\"\n    EXTERNAL_NET: \"!$HOME_NET\"\n    HTTP_SERVERS: \"$HOME_NET\"\n    DNS_SERVERS: \"$HOME_NET\"\n    SMTP_SERVERS: \"$HOME_NET\"\n\n# Default rule path\ndefault-rule-path: \u002Fvar\u002Flib\u002Fsuricata\u002Frules\nrule-files:\n  - suricata.rules\n\n# AF_PACKET configuration for high performance\naf-packet:\n  - interface: eth1\n    threads: auto\n    cluster-id: 99\n    cluster-type: cluster_flow\n    defrag: yes\n    use-mmap: yes\n    ring-size: 200000\n    buffer-size: 262144\n\n# EVE JSON logging (primary output format)\noutputs:\n  - eve-log:\n      enabled: yes\n      filetype: regular\n      filename: eve.json\n      pcap-file: false\n      community-id: true\n      types:\n        - alert:\n            tagged-packets: yes\n            payload: yes\n            payload-printable: yes\n            http-body: yes\n            http-body-printable: yes\n        - http:\n            extended: yes\n        - dns:\n            query: yes\n            answer: yes\n        - tls:\n            extended: yes\n        - files:\n            force-magic: yes\n            force-hash: [md5, sha256]\n        - smtp:\n            extended: yes\n        - flow\n        - netflow\n        - anomaly:\n            enabled: yes\n        - stats:\n            totals: yes\n            threads: yes\n\n  # PCAP logging for captured packets that trigger alerts\n  - pcap-log:\n      enabled: yes\n      filename: alert-%n.pcap\n      limit: 100mb\n      max-files: 50\n      mode: normal\n      use-stream-depth: no\n      honor-pass-rules: no\n\n# Stream engine settings\nstream:\n  memcap: 512mb\n  checksum-validation: no\n  reassembly:\n    memcap: 1gb\n    depth: 1mb\n    toserver-chunk-size: 2560\n    toclient-chunk-size: 2560\n\n# Detection engine\ndetect:\n  profile: high\n  custom-values:\n    toclient-groups: 200\n    toserver-groups: 200\n  sgh-mpm-context: auto\n  inspection-recursion-limit: 3000\n\n# Protocol detection and parsing\napp-layer:\n  protocols:\n    http:\n      enabled: yes\n      memcap: 64mb\n    tls:\n      enabled: yes\n      detection-ports:\n        dp: 443, 8443\n      ja3-fingerprints: yes\n    dns:\n      enabled: yes\n      tcp:\n        enabled: yes\n      udp:\n        enabled: yes\n    smb:\n      enabled: yes\n      detection-ports:\n        dp: 139, 445\n    ssh:\n      enabled: yes\n      hassh: yes\n```\n\n### Step 4: Download and Manage Rulesets\n\n```bash\n# Update Suricata rules using suricata-update\nsudo suricata-update\n\n# Enable additional rule sources\nsudo suricata-update list-sources\nsudo suricata-update enable-source et\u002Fopen\nsudo suricata-update enable-source oisf\u002Ftrafficid\nsudo suricata-update enable-source ptresearch\u002Fattackdetection\n\n# Update with all enabled sources\nsudo suricata-update\n\n# Check rule statistics\nsudo suricata-update list-sources --enabled\nwc -l \u002Fvar\u002Flib\u002Fsuricata\u002Frules\u002Fsuricata.rules\n\n# Disable noisy rules\nsudo tee \u002Fetc\u002Fsuricata\u002Fdisable.conf \u003C\u003C 'EOF'\n# Disable overly broad rules\n2100498\n2013028\n2210000-2210050\ngroup:emerging-policy.rules\nEOF\n\n# Create custom local rules\nsudo tee \u002Fetc\u002Fsuricata\u002Frules\u002Flocal.rules \u003C\u003C 'EOF'\n# Detect reverse shell connections\nalert 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;)\n\n# Detect DNS tunneling by query length\nalert 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;)\n\n# Detect TLS to suspicious JA3 hash (Cobalt Strike default)\nalert 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;)\n\n# Detect SSH brute force\nalert 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;)\n\n# Detect data exfiltration via HTTP POST (large uploads)\nalert 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;)\nEOF\n\n# Add local rules to configuration\necho \"  - local.rules\" | sudo tee -a \u002Fetc\u002Fsuricata\u002Fsuricata.yaml\n```\n\n### Step 5: Deploy and Validate\n\n```bash\n# Validate configuration\nsudo suricata -T -c \u002Fetc\u002Fsuricata\u002Fsuricata.yaml -v\n\n# Run Suricata in IDS mode\nsudo suricata -c \u002Fetc\u002Fsuricata\u002Fsuricata.yaml --af-packet=eth1 -D\n\n# Or run in IPS mode (inline with NFQueue)\n# First configure iptables to send traffic to NFQueue\n# sudo iptables -I FORWARD -j NFQUEUE --queue-num 0\n# sudo suricata -c \u002Fetc\u002Fsuricata\u002Fsuricata.yaml -q 0 -D\n\n# Create systemd service\nsudo tee \u002Fetc\u002Fsystemd\u002Fsystem\u002Fsuricata.service \u003C\u003C 'EOF'\n[Unit]\nDescription=Suricata IDS\u002FIPS\nAfter=network.target\nRequires=network.target\n\n[Service]\nType=simple\nExecStartPre=\u002Fusr\u002Fbin\u002Fsuricata -T -c \u002Fetc\u002Fsuricata\u002Fsuricata.yaml\nExecStart=\u002Fusr\u002Fbin\u002Fsuricata -c \u002Fetc\u002Fsuricata\u002Fsuricata.yaml --af-packet=eth1 --pidfile \u002Fvar\u002Frun\u002Fsuricata.pid\nExecReload=\u002Fbin\u002Fkill -USR2 $MAINPID\nRestart=on-failure\n\n[Install]\nWantedBy=multi-user.target\nEOF\n\nsudo systemctl enable --now suricata\n\n# Test with a known signature\ncurl http:\u002F\u002Ftestmynids.org\u002Fuid\u002Findex.html\n# Should trigger ET GPL rule for uid.\n\n# Verify alerts are generated\nsudo tail -f \u002Fvar\u002Flog\u002Fsuricata\u002Feve.json | jq 'select(.event_type==\"alert\")'\n```\n\n### Step 6: Integrate with SIEM and Monitor\n\n```bash\n# Parse EVE JSON with jq for quick analysis\n# Top 10 alerts\ncat \u002Fvar\u002Flog\u002Fsuricata\u002Feve.json | jq -r 'select(.event_type==\"alert\") | .alert.signature' | sort | uniq -c | sort -rn | head -10\n\n# Extract IOCs from alerts\ncat \u002Fvar\u002Flog\u002Fsuricata\u002Feve.json | jq -r 'select(.event_type==\"alert\") | [.timestamp, .src_ip, .dest_ip, .alert.signature, .alert.severity] | @csv' > alert_summary.csv\n\n# JA3 fingerprint analysis\ncat \u002Fvar\u002Flog\u002Fsuricata\u002Feve.json | jq -r 'select(.event_type==\"tls\") | [.src_ip, .tls.ja3.hash, .tls.sni] | @csv' | sort | uniq -c | sort -rn\n\n# DNS query analysis\ncat \u002Fvar\u002Flog\u002Fsuricata\u002Feve.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\n\n# Configure Filebeat for Elastic integration\nsudo tee \u002Fetc\u002Ffilebeat\u002Fmodules.d\u002Fsuricata.yml \u003C\u003C 'EOF'\n- module: suricata\n  eve:\n    enabled: true\n    var.paths: [\"\u002Fvar\u002Flog\u002Fsuricata\u002Feve.json\"]\nEOF\n\nsudo filebeat modules enable suricata\nsudo systemctl restart filebeat\n\n# Monitor Suricata performance\ncat \u002Fvar\u002Flog\u002Fsuricata\u002Feve.json | jq 'select(.event_type==\"stats\") | .stats.capture' | tail -1\n# Check for packet drops: kernel_drops should be 0\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **EVE JSON** | Suricata's primary logging format producing structured JSON events for alerts, protocol metadata, flow records, and statistics |\n| **AF_PACKET** | Linux kernel packet capture mechanism used by Suricata for high-performance traffic capture with kernel-bypass capabilities |\n| **JA3\u002FJA3S** | TLS fingerprinting method that creates hash values from TLS Client Hello and Server Hello parameters for identifying applications and malware |\n| **HASSH** | SSH fingerprinting method similar to JA3 that creates hashes from SSH key exchange parameters to identify SSH client and server implementations |\n| **Community ID** | Standardized flow identifier hash that enables correlation of the same network flow across different monitoring tools (Suricata, Zeek, Wireshark) |\n| **suricata-update** | Official rule management tool that downloads, merges, and manages multiple rulesets with enable\u002Fdisable controls |\n\n## Tools & Systems\n\n- **Suricata 7.0+**: Open-source multi-threaded IDS\u002FIPS\u002FNSM engine with protocol detection, file extraction, and JA3\u002FHASSH fingerprinting\n- **suricata-update**: Ruleset management tool supporting ET Open, ET Pro, Snort rules, and custom rule sources\n- **Elastic Stack (ELK)**: Log aggregation and visualization platform with native Suricata module in Filebeat for dashboards and alerting\n- **Scirius**: Web-based Suricata rule management interface for editing, enabling\u002Fdisabling, and monitoring rule performance\n- **Evebox**: Lightweight event viewer for Suricata EVE JSON logs with alert management and escalation capabilities\n\n## Common Scenarios\n\n### Scenario: Deploying Suricata IDS on a 10 Gbps Enterprise Network Perimeter\n\n**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.\n\n**Approach**:\n1. Deploy Suricata on a server with 16 CPU cores, 64 GB RAM, and dual 10G NICs using AF_PACKET with 14 worker threads\n2. Enable ET Open and ptresearch\u002Fattackdetection rulesets via suricata-update, totaling approximately 35,000 active rules\n3. Configure EVE JSON logging with community-id, extended HTTP\u002FTLS\u002FDNS metadata, and file hashing (MD5 + SHA256)\n4. Enable JA3 and HASSH fingerprinting for TLS and SSH traffic profiling\n5. Write custom rules for organization-specific threats: known bad JA3 hashes, DNS queries to DGA domains, large data uploads to uncommon destinations\n6. Integrate with Elastic via Filebeat's Suricata module, deploying pre-built Kibana dashboards for real-time visibility\n7. Tune rules over a 2-week baseline period, disabling false-positive generators and adjusting thresholds\n\n**Pitfalls**:\n- Not allocating sufficient CPU threads, causing packet drops at peak traffic volumes\n- Enabling all available rules without tuning, overwhelming analysts with false positives\n- Forgetting to disable NIC offloading, resulting in incorrect checksums and missed detections\n- Not enabling community-id, making it difficult to correlate Suricata events with Zeek or other tools\n\n## Output Format\n\n```\n## Suricata IDS Deployment Report\n\n**Sensor**: suricata-gw-01 (10.10.1.251)\n**Interface**: eth1 (span from border router)\n**Configuration**: \u002Fetc\u002Fsuricata\u002Fsuricata.yaml\n**Worker Threads**: 14 AF_PACKET threads\n**Active Rules**: 35,247 (ET Open + Custom)\n\n### Performance Metrics (24-hour)\n\n| Metric | Value |\n|--------|-------|\n| Packets Processed | 847,293,421 |\n| Kernel Drops | 0 (0.000%) |\n| Alerts Generated | 1,247 |\n| Unique Signatures Fired | 89 |\n| JA3 Fingerprints Observed | 342 unique |\n| Files Extracted | 2,847 |\n\n### Top 10 Alert Signatures\n\n| Count | SID | Signature | Severity |\n|-------|-----|-----------|----------|\n| 312 | 2024897 | ET POLICY curl User-Agent Outbound | 3 |\n| 189 | 9000003 | LOCAL Cobalt Strike JA3 Hash | 1 |\n| 145 | 2028765 | ET SCAN Nmap SYN Scan | 2 |\n| 98 | 9000002 | LOCAL DNS Tunneling Long Query | 2 |\n\n### Critical Alerts Requiring Immediate Triage\n1. SID 9000003: Cobalt Strike JA3 from 10.10.5.12 to 203.0.113.50 (189 alerts)\n2. SID 9000002: DNS tunneling from 10.10.3.45 to suspect-domain.xyz (98 alerts)\n```\n","# Configuring Suricata for Network Monitoring\n\n## When to Use\n\n- Deploying a high-performance IDS\u002FIPS capable of multi-threaded packet processing for 10+ Gbps network links\n- Monitoring network traffic with protocol-aware inspection for HTTP, TLS, DNS, SMB, and other protocols\n- Generating structured EVE JSON logs for direct SIEM ingestion without custom parsers\n- Running in inline (IPS) mode to actively block malicious traffic at network choke points\n- Combining signature-based detection with protocol anomaly detection and file extraction\n\n**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\u002Fmemory for the expected traffic volume.\n\n## Prerequisites\n\n- Suricata 7.0+ installed from PPA or source (`suricata --build-info`)\n- Network interface on a span port, tap, or inline bridge for traffic capture\n- AF_PACKET or DPDK support for high-performance packet capture\n- Emerging Threats Open or Pro ruleset subscription (or Snort Talos rules via oinkcode)\n- suricata-update tool for automated rule management\n- Elasticsearch\u002FKibana or Splunk for log analysis and visualization\n\n## Workflow\n\n### Step 1: Install Suricata and Dependencies\n\n```bash\n# Install from PPA (Ubuntu\u002FDebian)\nsudo add-apt-repository ppa:oisf\u002Fsuricata-stable\nsudo apt update\nsudo apt install -y suricata suricata-update jq\n\n# Verify installation\nsuricata --build-info | grep -E \"Version|AF_PACKET|NFQueue\"\n\n# Or install from source for latest features\nsudo apt install -y libpcre2-dev build-essential autoconf automake libtool \\\n  libpcap-dev libnet1-dev libyaml-dev libjansson-dev libcap-ng-dev \\\n  libmagic-dev libnetfilter-queue-dev libhiredis-dev rustc cargo cbindgen\ngit clone https:\u002F\u002Fgithub.com\u002FOISF\u002Fsuricata.git\ncd suricata && git clone https:\u002F\u002Fgithub.com\u002FOISF\u002Flibhtp.git -b 0.5.x\n.\u002Fautogen.sh && .\u002Fconfigure --prefix=\u002Fusr --sysconfdir=\u002Fetc --localstatedir=\u002Fvar \\\n  --enable-nfqueue --enable-af-packet\nmake -j$(nproc) && sudo make install install-conf\n```\n\n### Step 2: Configure Network Interfaces\n\n```bash\n# Disable NIC offloading features\nsudo ethtool -K eth1 gro off lro off tso off gso off rx off tx off sg off\n\n# Set interface to promiscuous mode\nsudo ip link set eth1 promisc on\n\n# For high-performance deployments, configure AF_PACKET with multiple threads\n# Edit \u002Fetc\u002Fsuricata\u002Fsuricata.yaml\n```\n\n### Step 3: Configure suricata.yaml\n\n```yaml\n# \u002Fetc\u002Fsuricata\u002Fsuricata.yaml (key sections)\n\n# Network variables\nvars:\n  address-groups:\n    HOME_NET: \"[10.0.0.0\u002F8, 172.16.0.0\u002F12, 192.168.0.0\u002F16]\"\n    EXTERNAL_NET: \"!$HOME_NET\"\n    HTTP_SERVERS: \"$HOME_NET\"\n    DNS_SERVERS: \"$HOME_NET\"\n    SMTP_SERVERS: \"$HOME_NET\"\n\n# Default rule path\ndefault-rule-path: \u002Fvar\u002Flib\u002Fsuricata\u002Frules\nrule-files:\n  - suricata.rules\n\n# AF_PACKET configuration for high performance\naf-packet:\n  - interface: eth1\n    threads: auto\n    cluster-id: 99\n    cluster-type: cluster_flow\n    defrag: yes\n    use-mmap: yes\n    ring-size: 200000\n    buffer-size: 262144\n\n# EVE JSON logging (primary output format)\noutputs:\n  - eve-log:\n      enabled: yes\n      filetype: regular\n      filename: eve.json\n      pcap-file: false\n      community-id: true\n      types:\n        - alert:\n            tagged-packets: yes\n            payload: yes\n            payload-printable: yes\n            http-body: yes\n            http-body-printable: yes\n        - http:\n            extended: yes\n        - dns:\n            query: yes\n            answer: yes\n        - tls:\n            extended: yes\n        - files:\n            force-magic: yes\n            force-hash: [md5, sha256]\n        - smtp:\n            extended: yes\n        - flow\n        - netflow\n        - anomaly:\n            enabled: yes\n        - stats:\n            totals: yes\n            threads: yes\n\n  # PCAP logging for captured packets that trigger alerts\n  - pcap-log:\n      enabled: yes\n      filename: alert-%n.pcap\n      limit: 100mb\n      max-files: 50\n      mode: normal\n      use-stream-depth: no\n      honor-pass-rules: no\n\n# Stream engine settings\nstream:\n  memcap: 512mb\n  checksum-validation: no\n  reassembly:\n    memcap: 1gb\n    depth: 1mb\n    toserver-chunk-size: 2560\n    toclient-chunk-size: 2560\n\n# Detection engine\ndetect:\n  profile: high\n  custom-values:\n    toclient-groups: 200\n    toserver-groups: 200\n  sgh-mpm-context: auto\n  inspection-recursion-limit: 3000\n\n# Protocol detection and parsing\napp-layer:\n  protocols:\n    http:\n      enabled: yes\n      memcap: 64mb\n    tls:\n      enabled: yes\n      detection-ports:\n        dp: 443, 8443\n      ja3-fingerprints: yes\n    dns:\n      enabled: yes\n      tcp:\n        enabled: yes\n      udp:\n        enabled: yes\n    smb:\n      enabled: yes\n      detection-ports:\n        dp: 139, 445\n    ssh:\n      enabled: yes\n      hassh: yes\n```\n\n### Step 4: Download and Manage Rulesets\n\n```bash\n# Update Suricata rules using suricata-update\nsudo suricata-update\n\n# Enable additional rule sources\nsudo suricata-update list-sources\nsudo suricata-update enable-source et\u002Fopen\nsudo suricata-update enable-source oisf\u002Ftrafficid\nsudo suricata-update enable-source ptresearch\u002Fattackdetection\n\n# Update with all enabled sources\nsudo suricata-update\n\n# Check rule statistics\nsudo suricata-update list-sources --enabled\nwc -l \u002Fvar\u002Flib\u002Fsuricata\u002Frules\u002Fsuricata.rules\n\n# Disable noisy rules\nsudo tee \u002Fetc\u002Fsuricata\u002Fdisable.conf \u003C\u003C 'EOF'\n# Disable overly broad rules\n2100498\n2013028\n2210000-2210050\ngroup:emerging-policy.rules\nEOF\n\n# Create custom local rules\nsudo tee \u002Fetc\u002Fsuricata\u002Frules\u002Flocal.rules \u003C\u003C 'EOF'\n# Detect reverse shell connections\nalert 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;)\n\n# Detect DNS tunneling by query length\nalert 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;)\n\n# Detect TLS to suspicious JA3 hash (Cobalt Strike default)\nalert 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;)\n\n# Detect SSH brute force\nalert 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;)\n\n# Detect data exfiltration via HTTP POST (large uploads)\nalert 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;)\nEOF\n\n# Add local rules to configuration\necho \"  - local.rules\" | sudo tee -a \u002Fetc\u002Fsuricata\u002Fsuricata.yaml\n```\n\n### Step 5: Deploy and Validate\n\n```bash\n# Validate configuration\nsudo suricata -T -c \u002Fetc\u002Fsuricata\u002Fsuricata.yaml -v\n\n# Run Suricata in IDS mode\nsudo suricata -c \u002Fetc\u002Fsuricata\u002Fsuricata.yaml --af-packet=eth1 -D\n\n# Or run in IPS mode (inline with NFQueue)\n# First configure iptables to send traffic to NFQueue\n# sudo iptables -I FORWARD -j NFQUEUE --queue-num 0\n# sudo suricata -c \u002Fetc\u002Fsuricata\u002Fsuricata.yaml -q 0 -D\n\n# Create systemd service\nsudo tee \u002Fetc\u002Fsystemd\u002Fsystem\u002Fsuricata.service \u003C\u003C 'EOF'\n[Unit]\nDescription=Suricata IDS\u002FIPS\nAfter=network.target\nRequires=network.target\n\n[Service]\nType=simple\nExecStartPre=\u002Fusr\u002Fbin\u002Fsuricata -T -c \u002Fetc\u002Fsuricata\u002Fsuricata.yaml\nExecStart=\u002Fusr\u002Fbin\u002Fsuricata -c \u002Fetc\u002Fsuricata\u002Fsuricata.yaml --af-packet=eth1 --pidfile \u002Fvar\u002Frun\u002Fsuricata.pid\nExecReload=\u002Fbin\u002Fkill -USR2 $MAINPID\nRestart=on-failure\n\n[Install]\nWantedBy=multi-user.target\nEOF\n\nsudo systemctl enable --now suricata\n\n# Test with a known signature\ncurl http:\u002F\u002Ftestmynids.org\u002Fuid\u002Findex.html\n# Should trigger ET GPL rule for uid.\n\n# Verify alerts are generated\nsudo tail -f \u002Fvar\u002Flog\u002Fsuricata\u002Feve.json | jq 'select(.event_type==\"alert\")'\n```\n\n### Step 6: Integrate with SIEM and Monitor\n\n```bash\n# Parse EVE JSON with jq for quick analysis\n# Top 10 alerts\ncat \u002Fvar\u002Flog\u002Fsuricata\u002Feve.json | jq -r 'select(.event_type==\"alert\") | .alert.signature' | sort | uniq -c | sort -rn | head -10\n\n# Extract IOCs from alerts\ncat \u002Fvar\u002Flog\u002Fsuricata\u002Feve.json | jq -r 'select(.event_type==\"alert\") | [.timestamp, .src_ip, .dest_ip, .alert.signature, .alert.severity] | @csv' > alert_summary.csv\n\n# JA3 fingerprint analysis\ncat \u002Fvar\u002Flog\u002Fsuricata\u002Feve.json | jq -r 'select(.event_type==\"tls\") | [.src_ip, .tls.ja3.hash, .tls.sni] | @csv' | sort | uniq -c | sort -rn\n\n# DNS query analysis\ncat \u002Fvar\u002Flog\u002Fsuricata\u002Feve.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\n\n# Configure Filebeat for Elastic integration\nsudo tee \u002Fetc\u002Ffilebeat\u002Fmodules.d\u002Fsuricata.yml \u003C\u003C 'EOF'\n- module: suricata\n  eve:\n    enabled: true\n    var.paths: [\"\u002Fvar\u002Flog\u002Fsuricata\u002Feve.json\"]\nEOF\n\nsudo filebeat modules enable suricata\nsudo systemctl restart filebeat\n\n# Monitor Suricata performance\ncat \u002Fvar\u002Flog\u002Fsuricata\u002Feve.json | jq 'select(.event_type==\"stats\") | .stats.capture' | tail -1\n# Check for packet drops: kernel_drops should be 0\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **EVE JSON** | Suricata's primary logging format producing structured JSON events for alerts, protocol metadata, flow records, and statistics |\n| **AF_PACKET** | Linux kernel packet capture mechanism used by Suricata for high-performance traffic capture with kernel-bypass capabilities |\n| **JA3\u002FJA3S** | TLS fingerprinting method that creates hash values from TLS Client Hello and Server Hello parameters for identifying applications and malware |\n| **HASSH** | SSH fingerprinting method similar to JA3 that creates hashes from SSH key exchange parameters to identify SSH client and server implementations |\n| **Community ID** | Standardized flow identifier hash that enables correlation of the same network flow across different monitoring tools (Suricata, Zeek, Wireshark) |\n| **suricata-update** | Official rule management tool that downloads, merges, and manages multiple rulesets with enable\u002Fdisable controls |\n\n## Tools & Systems\n\n- **Suricata 7.0+**: Open-source multi-threaded IDS\u002FIPS\u002FNSM engine with protocol detection, file extraction, and JA3\u002FHASSH fingerprinting\n- **suricata-update**: Ruleset management tool supporting ET Open, ET Pro, Snort rules, and custom rule sources\n- **Elastic Stack (ELK)**: Log aggregation and visualization platform with native Suricata module in Filebeat for dashboards and alerting\n- **Scirius**: Web-based Suricata rule management interface for editing, enabling\u002Fdisabling, and monitoring rule performance\n- **Evebox**: Lightweight event viewer for Suricata EVE JSON logs with alert management and escalation capabilities\n\n## Common Scenarios\n\n### Scenario: Deploying Suricata IDS on a 10 Gbps Enterprise Network Perimeter\n\n**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.\n\n**Approach**:\n1. Deploy Suricata on a server with 16 CPU cores, 64 GB RAM, and dual 10G NICs using AF_PACKET with 14 worker threads\n2. Enable ET Open and ptresearch\u002Fattackdetection rulesets via suricata-update, totaling approximately 35,000 active rules\n3. Configure EVE JSON logging with community-id, extended HTTP\u002FTLS\u002FDNS metadata, and file hashing (MD5 + SHA256)\n4. Enable JA3 and HASSH fingerprinting for TLS and SSH traffic profiling\n5. Write custom rules for organization-specific threats: known bad JA3 hashes, DNS queries to DGA domains, large data uploads to uncommon destinations\n6. Integrate with Elastic via Filebeat's Suricata module, deploying pre-built Kibana dashboards for real-time visibility\n7. Tune rules over a 2-week baseline period, disabling false-positive generators and adjusting thresholds\n\n**Pitfalls**:\n- Not allocating sufficient CPU threads, causing packet drops at peak traffic volumes\n- Enabling all available rules without tuning, overwhelming analysts with false positives\n- Forgetting to disable NIC offloading, resulting in incorrect checksums and missed detections\n- Not enabling community-id, making it difficult to correlate Suricata events with Zeek or other tools\n\n## Output Format\n\n```\n## Suricata IDS Deployment Report\n\n**Sensor**: suricata-gw-01 (10.10.1.251)\n**Interface**: eth1 (span from border router)\n**Configuration**: \u002Fetc\u002Fsuricata\u002Fsuricata.yaml\n**Worker Threads**: 14 AF_PACKET threads\n**Active Rules**: 35,247 (ET Open + Custom)\n\n### Performance Metrics (24-hour)\n\n| Metric | Value |\n|--------|-------|\n| Packets Processed | 847,293,421 |\n| Kernel Drops | 0 (0.000%) |\n| Alerts Generated | 1,247 |\n| Unique Signatures Fired | 89 |\n| JA3 Fingerprints Observed | 342 unique |\n| Files Extracted | 2,847 |\n\n### Top 10 Alert Signatures\n\n| Count | SID | Signature | Severity |\n|-------|-----|-----------|----------|\n| 312 | 2024897 | ET POLICY curl User-Agent Outbound | 3 |\n| 189 | 9000003 | LOCAL Cobalt Strike JA3 Hash | 1 |\n| 145 | 2028765 | ET SCAN Nmap SYN Scan | 2 |\n| 98 | 9000002 | LOCAL DNS Tunneling Long Query | 2 |\n\n### Critical Alerts Requiring Immediate Triage\n1. SID 9000003: Cobalt Strike JA3 from 10.10.5.12 to 203.0.113.50 (189 alerts)\n2. SID 9000002: DNS tunneling from 10.10.3.45 to suspect-domain.xyz (98 alerts)\n```\n",{"name":5,"tags":24,"author":30,"domain":31,"license":15,"version":32,"nist_csf":33,"subdomain":25,"description":38,"mitre_attack":39},[25,26,27,28,29],"network-security","suricata","ids","ips","network-monitoring","mahipal","cybersecurity","1.0",[34,35,36,37],"PR.IR-01","DE.CM-01","ID.AM-03","PR.DS-02","Deploys and configures Suricata IDS\u002FIPS with Emerging Threats rulesets, EVE JSON logging, and custom rules for high-throughput, protocol-aware traffic inspection (HTTP, TLS, DNS, SMB) and SIEM integration. Use when running Suricata in IDS or inline IPS mode to detect or block malicious traffic, or when combining signature-based and protocol anomaly detection with file extraction.\n",[40,41,42,43,44],"T1046","T1071.001","T1572","T1048","T1573.001","main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","04-安全渗透\u002Fconfiguring-suricata-for-network-monitoring",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill configuring-suricata-for-network-monitoring",{"tool":59,"command":60},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill configuring-suricata-for-network-monitoring",{"tool":62,"command":63},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill configuring-suricata-for-network-monitoring","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fconfiguring-suricata-for-network-monitoring\u002FSKILL.md",true,[67,73],{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"references\u002Fapi-reference.md","REFERENCE","参考文档",2627,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fconfiguring-suricata-for-network-monitoring\u002Freferences\u002Fapi-reference.md",{"path":74,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":75,"sourceHtmlUrl":76},"SKILL.es.md",1214,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fconfiguring-suricata-for-network-monitoring\u002FSKILL.es.md",[78,87,92,99,106,113],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":86},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":88,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":86},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":86},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":86},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":86},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":86},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]