[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7B7JCYDGXRHWMS5G9NSMC7B":3,"skill-same:01M7B7JCYDGXRHWMS5G9NSMC7B":83},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":15,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":47,"commitSha":48,"skillDirectory":49,"forksCount":13,"repositoryHtmlUrl":50,"repositoryHomepageUrl":6,"ownerHtmlUrl":51,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":52,"install":53,"resources":66},"01M7B7JCYDGXRHWMS5G9NSMC7B","implementing-network-intrusion-prevention-with-suricata",null,"Deploys and configures Suricata as an inline network intrusion prevention system, covering IPS mode setup (NFQueue), custom rule writing, Emerging Threats ruleset management, performance tuning, and logging integration. Use when deploying real-time inline traffic inspection to actively block malicious traffic, or when tuning Suricata rules and performance for production IDS\u002FIPS deployment.","vikasvardhanv\u002Fjerry_skills","vikasvardhanv","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99010657?v=4","01M7B2B0VN78W7529RQX5BR6DZ","01M7B2B0WDNTXJHRK3QNPNWRP6",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fimplementing-network-intrusion-prevention-with-suricata\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fimplementing-network-intrusion-prevention-with-suricata\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: implementing-network-intrusion-prevention-with-suricata\ndescription: Deploys and configures Suricata as an inline network intrusion prevention system,\n  covering IPS mode setup (NFQueue), custom rule writing, Emerging Threats ruleset\n  management, performance tuning, and logging integration. Use when deploying real-time\n  inline traffic inspection to actively block malicious traffic, or when tuning\n  Suricata rules and performance for production IDS\u002FIPS deployment.\ndomain: cybersecurity\nsubdomain: network-security\ntags:\n- suricata\n- ips\n- ids\n- intrusion-prevention\n- network-security\n- emerging-threats\n- rule-management\n- nfqueue\n- inline-mode\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- T1040\n- T1557\n- T1071\n---\n\n# Implementing Network Intrusion Prevention with Suricata\n\n## Overview\n\nSuricata is a high-performance, open-source network threat detection engine developed by the Open Information Security Foundation (OISF). It functions as an IDS (Intrusion Detection System), IPS (Intrusion Prevention System), and network security monitoring tool. Suricata performs deep packet inspection using extensive rule sets, protocol analysis, and file extraction capabilities. In IPS mode, Suricata inspects packets inline and can actively block malicious traffic. This skill covers deploying Suricata in IPS mode, configuring rulesets, writing custom rules, performance tuning, and integration with logging infrastructure.\n\n\n## When to Use\n\n- When deploying or configuring implementing network intrusion prevention with suricata capabilities in your environment\n- When establishing security controls aligned to compliance requirements\n- When building or improving security architecture for this domain\n- When conducting security assessments that require this implementation\n\n## Prerequisites\n\n- Linux server (Ubuntu 22.04+ or CentOS 8+) with 4+ CPU cores and 8GB+ RAM\n- Suricata 7.0+ installed\n- Network position for inline deployment (bridge mode or NFQUEUE)\n- Emerging Threats Open or ET Pro ruleset subscription\n- Suricata-update tool for rule management\n- Logging infrastructure (ELK Stack, Splunk, or Wazuh)\n\n## Core Concepts\n\n### Operating Modes\n\n| Mode | Function | Network Position |\n|------|----------|-----------------|\n| IDS (AF_PACKET) | Passive monitoring, alert-only | TAP\u002FSPAN mirror |\n| IPS (NFQUEUE) | Inline blocking via netfilter | In traffic path |\n| IPS (AF_PACKET) | Inline blocking via AF_PACKET | Bridge between interfaces |\n| Offline (PCAP) | Analyze captured traffic files | N\u002FA |\n\n### Rule Anatomy\n\nSuricata rules follow a structured format:\n\n```\naction protocol src_ip src_port -> dst_ip dst_port (rule_options;)\n```\n\n- **Action**: `alert`, `pass`, `drop`, `reject`, `rejectsrc`, `rejectdst`, `rejectboth`\n- **Protocol**: `tcp`, `udp`, `icmp`, `ip`, `http`, `tls`, `dns`, `smtp`, `ftp`\n- **Direction**: `->` (unidirectional), `\u003C>` (bidirectional)\n\n### Rule Categories\n\n- **Emerging Threats Open** - Community-maintained, free ruleset with broad coverage\n- **ET Pro** - Commercial ruleset from Proofpoint with enhanced coverage\n- **Suricata Traffic ID** - Application identification rules\n- **Custom Rules** - Organization-specific detections\n\n## Workflow\n\n### Step 1: Install Suricata\n\n```bash\n# Add Suricata PPA (Ubuntu)\nsudo add-apt-repository ppa:oisf\u002Fsuricata-stable\nsudo apt-get update\nsudo apt-get install -y suricata suricata-update\n\n# Verify installation\nsuricata --build-info\nsuricata -V\n```\n\n### Step 2: Configure Suricata for IPS Mode\n\nEdit `\u002Fetc\u002Fsuricata\u002Fsuricata.yaml`:\n\n```yaml\n%YAML 1.1\n---\n\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: \"[10.0.1.10\u002F32,10.0.1.11\u002F32]\"\n    SMTP_SERVERS: \"$HOME_NET\"\n\n  port-groups:\n    HTTP_PORTS: \"80\"\n    SHELLCODE_PORTS: \"!80\"\n    SSH_PORTS: \"22\"\n    DNS_PORTS: \"53\"\n\n# IPS mode with NFQUEUE\nnfq:\n  mode: accept\n  repeat-mark: 1\n  repeat-mask: 1\n  route-queue: 2\n  fail-open: yes\n\n# Threading configuration\nthreading:\n  set-cpu-affinity: yes\n  cpu-affinity:\n    - management-cpu-set:\n        cpu: [0]\n    - receive-cpu-set:\n        cpu: [1,2]\n    - worker-cpu-set:\n        cpu: [3,4,5,6,7]\n        mode: exclusive\n\n# Detection engine\ndetect-engine:\n  - profile: high\n  - custom-values:\n      toclient-groups: 50\n      toserver-groups: 50\n  - sgh-mpm-context: auto\n  - inspection-recursion-limit: 3000\n\n# Stream engine\nstream:\n  memcap: 512mb\n  checksum-validation: yes\n  inline: auto\n  reassembly:\n    memcap: 1gb\n    depth: 1mb\n    toserver-chunk-size: 2560\n    toclient-chunk-size: 2560\n\n# Logging configuration\noutputs:\n  - eve-log:\n      enabled: yes\n      filetype: regular\n      filename: \u002Fvar\u002Flog\u002Fsuricata\u002Feve.json\n      types:\n        - alert:\n            payload: yes\n            payload-buffer-size: 4kb\n            payload-printable: yes\n            packet: yes\n            metadata: yes\n            tagged-packets: 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        - flow\n        - netflow\n        - stats:\n            totals: yes\n            threads: no\n            deltas: yes\n\n  - fast:\n      enabled: yes\n      filename: \u002Fvar\u002Flog\u002Fsuricata\u002Ffast.log\n\n  - stats:\n      enabled: yes\n      filename: \u002Fvar\u002Flog\u002Fsuricata\u002Fstats.log\n      interval: 30\n\n# Rule files\ndefault-rule-path: \u002Fvar\u002Flib\u002Fsuricata\u002Frules\nrule-files:\n  - suricata.rules\n```\n\n### Step 3: Configure NFQUEUE for Inline IPS\n\nSet up iptables to redirect traffic through Suricata:\n\n```bash\n# Enable IP forwarding\necho 1 > \u002Fproc\u002Fsys\u002Fnet\u002Fipv4\u002Fip_forward\n\n# Redirect FORWARD chain to NFQUEUE\nsudo iptables -I FORWARD -j NFQUEUE --queue-num 0 --queue-bypass\n\n# For multi-queue (better performance)\nsudo iptables -I FORWARD -j NFQUEUE --queue-balance 0:3 --queue-bypass\n\n# Save iptables rules\nsudo iptables-save > \u002Fetc\u002Fiptables\u002Frules.v4\n```\n\nAlternative: AF_PACKET inline mode between two interfaces:\n\n```yaml\n# In suricata.yaml\naf-packet:\n  - interface: eth0\n    cluster-id: 98\n    cluster-type: cluster_flow\n    defrag: yes\n    use-mmap: yes\n    copy-mode: ips\n    copy-iface: eth1\n  - interface: eth1\n    cluster-id: 97\n    cluster-type: cluster_flow\n    defrag: yes\n    use-mmap: yes\n    copy-mode: ips\n    copy-iface: eth0\n```\n\n### Step 4: Manage Rules with Suricata-Update\n\n```bash\n# Update rules from default sources (ET Open)\nsudo suricata-update\n\n# List available rule sources\nsudo suricata-update list-sources\n\n# Enable ET Pro (requires license key)\nsudo suricata-update enable-source et\u002Fpro secret-code=YOUR_OINKCODE\n\n# Enable additional sources\nsudo suricata-update enable-source oisf\u002Ftrafficid\nsudo suricata-update enable-source ptresearch\u002Fattackdetection\nsudo suricata-update enable-source sslbl\u002Fssl-fp-blacklist\n\n# Disable specific rules that generate false positives\necho \"2100498\" >> \u002Fetc\u002Fsuricata\u002Fdisable.conf\necho \"group:emerging-policy.rules\" >> \u002Fetc\u002Fsuricata\u002Fdisable.conf\n\n# Modify rule actions (change alert to drop)\necho 're:ET MALWARE' >> \u002Fetc\u002Fsuricata\u002Fmodify.conf\n\n# Apply updates\nsudo suricata-update --reload-command=\"suricatasc -c reload-rules\"\n```\n\n### Step 5: Write Custom Rules\n\nCreate `\u002Fvar\u002Flib\u002Fsuricata\u002Frules\u002Flocal.rules`:\n\n```\n# Detect potential reverse shell over TCP\ndrop tcp $HOME_NET any -> $EXTERNAL_NET any (msg:\"LOCAL Potential Reverse Shell - \u002Fbin\u002Fbash in payload\"; flow:to_server,established; content:\"\u002Fbin\u002Fbash\"; content:\"-i\"; within:20; classtype:trojan-activity; sid:1000001; rev:1;)\n\n# Block known malicious user agent\ndrop http $HOME_NET any -> $EXTERNAL_NET any (msg:\"LOCAL Malicious User-Agent - Cobalt Strike\"; http.user_agent; content:\"Mozilla\u002F5.0 (compatible|3b| MSIE 9.0|3b| Windows NT 6.1|3b| WOW64|3b| Trident\u002F5.0)\"; classtype:trojan-activity; sid:1000002; rev:1;)\n\n# Detect DNS query for known DGA domain pattern\nalert dns $HOME_NET any -> any 53 (msg:\"LOCAL Suspicious DGA Domain Query\"; dns.query; content:\".top\"; pcre:\"\u002F^[a-z0-9]{12,30}\\.(top|xyz|club|online|site)$\u002F\"; classtype:bad-unknown; sid:1000003; rev:1;)\n\n# Detect large DNS TXT response (potential C2)\nalert dns any 53 -> $HOME_NET any (msg:\"LOCAL Large DNS TXT Response - Potential C2\"; dns.opcode:0; content:\"|00 10|\"; byte_test:2,>,500,0,relative; classtype:bad-unknown; sid:1000004; rev:1;)\n\n# Block outbound traffic to Tor exit nodes\ndrop tcp $HOME_NET any -> [100.2.18.10,104.244.76.13,109.70.100.1] any (msg:\"LOCAL Outbound Connection to Known Tor Exit Node\"; classtype:policy-violation; sid:1000005; rev:1;)\n\n# Detect SMB lateral movement attempts\nalert tcp $HOME_NET any -> $HOME_NET 445 (msg:\"LOCAL Internal SMB Connection - Possible Lateral Movement\"; flow:to_server,established; content:\"|ff|SMB\"; offset:4; depth:4; threshold:type both,track by_src,count 5,seconds 60; classtype:attempted-admin; sid:1000006; rev:1;)\n\n# Detect PowerShell download cradle\ndrop http $HOME_NET any -> $EXTERNAL_NET any (msg:\"LOCAL PowerShell Download Cradle Detected\"; http.user_agent; content:\"PowerShell\"; nocase; http.method; content:\"GET\"; classtype:trojan-activity; sid:1000007; rev:1;)\n\n# Detect ICMP tunneling (large ICMP packets)\nalert icmp $HOME_NET any -> $EXTERNAL_NET any (msg:\"LOCAL Oversized ICMP Packet - Possible Tunneling\"; dsize:>800; threshold:type both,track by_src,count 10,seconds 60; classtype:bad-unknown; sid:1000008; rev:1;)\n```\n\n### Step 6: Start Suricata in IPS Mode\n\n```bash\n# Test configuration\nsudo suricata -T -c \u002Fetc\u002Fsuricata\u002Fsuricata.yaml\n\n# Start in NFQUEUE IPS mode\nsudo suricata -c \u002Fetc\u002Fsuricata\u002Fsuricata.yaml -q 0\n\n# Start with AF_PACKET inline mode\nsudo suricata -c \u002Fetc\u002Fsuricata\u002Fsuricata.yaml --af-packet\n\n# Start as systemd service\nsudo systemctl enable suricata\nsudo systemctl start suricata\n\n# Monitor performance stats\ntail -f \u002Fvar\u002Flog\u002Fsuricata\u002Fstats.log\n\n# Reload rules without restart\nsudo suricatasc -c reload-rules\n```\n\n## Monitoring and Tuning\n\n### Performance Metrics\n\n```bash\n# Check kernel drops\nsudo suricatasc -c dump-counters | grep -E \"capture.kernel_drops|decoder.pkts\"\n\n# Monitor EVE JSON alerts\ntail -f \u002Fvar\u002Flog\u002Fsuricata\u002Feve.json | jq 'select(.event_type==\"alert\")'\n\n# Check rule loading\ngrep -c \"rules loaded\" \u002Fvar\u002Flog\u002Fsuricata\u002Fsuricata.log\n\n# Memory usage\nsudo suricatasc -c dump-counters | grep memuse\n```\n\n### Tuning for False Positives\n\n```bash\n# Identify noisy rules\ncat \u002Fvar\u002Flog\u002Fsuricata\u002Feve.json | jq -r 'select(.event_type==\"alert\") | .alert.signature_id' | sort | uniq -c | sort -rn | head -20\n\n# Suppress specific rules per source\necho \"suppress gen_id 1, sig_id 2100498, track by_src, ip 10.0.5.0\u002F24\" >> \u002Fetc\u002Fsuricata\u002Fthreshold.config\n\n# Rate-limit alerts\necho \"rate_filter gen_id 1, sig_id 2100366, track by_src, count 10, seconds 60, new_action alert, timeout 300\" >> \u002Fetc\u002Fsuricata\u002Fthreshold.config\n```\n\n## Best Practices\n\n- **Start in IDS Mode** - Deploy in IDS (alert-only) mode first, tune for 2-4 weeks, then switch to IPS\n- **Fail-Open** - Configure fail-open mode so network traffic continues if Suricata crashes\n- **Rule Tuning** - Use threshold and suppress directives to reduce false positives before enabling drop actions\n- **CPU Affinity** - Pin Suricata worker threads to dedicated CPU cores for consistent performance\n- **Bypass for Trusted Traffic** - Use `pass` rules for known-good traffic to reduce processing load\n- **Regular Updates** - Run `suricata-update` daily via cron to keep signatures current\n- **Monitor Drops** - Track kernel packet drops and increase ring buffer size if needed\n\n## References\n\n- [Suricata Documentation](https:\u002F\u002Fdocs.suricata.io\u002Fen\u002Flatest\u002F)\n- [Suricata Rules Format](https:\u002F\u002Fdocs.suricata.io\u002Fen\u002Flatest\u002Frules\u002Findex.html)\n- [Emerging Threats Rulesets](https:\u002F\u002Frules.emergingthreats.net\u002F)\n- [OISF Suricata GitHub](https:\u002F\u002Fgithub.com\u002FOISF\u002Fsuricata)\n- [Suricata-Update Documentation](https:\u002F\u002Fsuricata-update.readthedocs.io\u002F)\n","# Implementing Network Intrusion Prevention with Suricata\n\n## Overview\n\nSuricata is a high-performance, open-source network threat detection engine developed by the Open Information Security Foundation (OISF). It functions as an IDS (Intrusion Detection System), IPS (Intrusion Prevention System), and network security monitoring tool. Suricata performs deep packet inspection using extensive rule sets, protocol analysis, and file extraction capabilities. In IPS mode, Suricata inspects packets inline and can actively block malicious traffic. This skill covers deploying Suricata in IPS mode, configuring rulesets, writing custom rules, performance tuning, and integration with logging infrastructure.\n\n\n## When to Use\n\n- When deploying or configuring implementing network intrusion prevention with suricata capabilities in your environment\n- When establishing security controls aligned to compliance requirements\n- When building or improving security architecture for this domain\n- When conducting security assessments that require this implementation\n\n## Prerequisites\n\n- Linux server (Ubuntu 22.04+ or CentOS 8+) with 4+ CPU cores and 8GB+ RAM\n- Suricata 7.0+ installed\n- Network position for inline deployment (bridge mode or NFQUEUE)\n- Emerging Threats Open or ET Pro ruleset subscription\n- Suricata-update tool for rule management\n- Logging infrastructure (ELK Stack, Splunk, or Wazuh)\n\n## Core Concepts\n\n### Operating Modes\n\n| Mode | Function | Network Position |\n|------|----------|-----------------|\n| IDS (AF_PACKET) | Passive monitoring, alert-only | TAP\u002FSPAN mirror |\n| IPS (NFQUEUE) | Inline blocking via netfilter | In traffic path |\n| IPS (AF_PACKET) | Inline blocking via AF_PACKET | Bridge between interfaces |\n| Offline (PCAP) | Analyze captured traffic files | N\u002FA |\n\n### Rule Anatomy\n\nSuricata rules follow a structured format:\n\n```\naction protocol src_ip src_port -> dst_ip dst_port (rule_options;)\n```\n\n- **Action**: `alert`, `pass`, `drop`, `reject`, `rejectsrc`, `rejectdst`, `rejectboth`\n- **Protocol**: `tcp`, `udp`, `icmp`, `ip`, `http`, `tls`, `dns`, `smtp`, `ftp`\n- **Direction**: `->` (unidirectional), `\u003C>` (bidirectional)\n\n### Rule Categories\n\n- **Emerging Threats Open** - Community-maintained, free ruleset with broad coverage\n- **ET Pro** - Commercial ruleset from Proofpoint with enhanced coverage\n- **Suricata Traffic ID** - Application identification rules\n- **Custom Rules** - Organization-specific detections\n\n## Workflow\n\n### Step 1: Install Suricata\n\n```bash\n# Add Suricata PPA (Ubuntu)\nsudo add-apt-repository ppa:oisf\u002Fsuricata-stable\nsudo apt-get update\nsudo apt-get install -y suricata suricata-update\n\n# Verify installation\nsuricata --build-info\nsuricata -V\n```\n\n### Step 2: Configure Suricata for IPS Mode\n\nEdit `\u002Fetc\u002Fsuricata\u002Fsuricata.yaml`:\n\n```yaml\n%YAML 1.1\n---\n\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: \"[10.0.1.10\u002F32,10.0.1.11\u002F32]\"\n    SMTP_SERVERS: \"$HOME_NET\"\n\n  port-groups:\n    HTTP_PORTS: \"80\"\n    SHELLCODE_PORTS: \"!80\"\n    SSH_PORTS: \"22\"\n    DNS_PORTS: \"53\"\n\n# IPS mode with NFQUEUE\nnfq:\n  mode: accept\n  repeat-mark: 1\n  repeat-mask: 1\n  route-queue: 2\n  fail-open: yes\n\n# Threading configuration\nthreading:\n  set-cpu-affinity: yes\n  cpu-affinity:\n    - management-cpu-set:\n        cpu: [0]\n    - receive-cpu-set:\n        cpu: [1,2]\n    - worker-cpu-set:\n        cpu: [3,4,5,6,7]\n        mode: exclusive\n\n# Detection engine\ndetect-engine:\n  - profile: high\n  - custom-values:\n      toclient-groups: 50\n      toserver-groups: 50\n  - sgh-mpm-context: auto\n  - inspection-recursion-limit: 3000\n\n# Stream engine\nstream:\n  memcap: 512mb\n  checksum-validation: yes\n  inline: auto\n  reassembly:\n    memcap: 1gb\n    depth: 1mb\n    toserver-chunk-size: 2560\n    toclient-chunk-size: 2560\n\n# Logging configuration\noutputs:\n  - eve-log:\n      enabled: yes\n      filetype: regular\n      filename: \u002Fvar\u002Flog\u002Fsuricata\u002Feve.json\n      types:\n        - alert:\n            payload: yes\n            payload-buffer-size: 4kb\n            payload-printable: yes\n            packet: yes\n            metadata: yes\n            tagged-packets: 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        - flow\n        - netflow\n        - stats:\n            totals: yes\n            threads: no\n            deltas: yes\n\n  - fast:\n      enabled: yes\n      filename: \u002Fvar\u002Flog\u002Fsuricata\u002Ffast.log\n\n  - stats:\n      enabled: yes\n      filename: \u002Fvar\u002Flog\u002Fsuricata\u002Fstats.log\n      interval: 30\n\n# Rule files\ndefault-rule-path: \u002Fvar\u002Flib\u002Fsuricata\u002Frules\nrule-files:\n  - suricata.rules\n```\n\n### Step 3: Configure NFQUEUE for Inline IPS\n\nSet up iptables to redirect traffic through Suricata:\n\n```bash\n# Enable IP forwarding\necho 1 > \u002Fproc\u002Fsys\u002Fnet\u002Fipv4\u002Fip_forward\n\n# Redirect FORWARD chain to NFQUEUE\nsudo iptables -I FORWARD -j NFQUEUE --queue-num 0 --queue-bypass\n\n# For multi-queue (better performance)\nsudo iptables -I FORWARD -j NFQUEUE --queue-balance 0:3 --queue-bypass\n\n# Save iptables rules\nsudo iptables-save > \u002Fetc\u002Fiptables\u002Frules.v4\n```\n\nAlternative: AF_PACKET inline mode between two interfaces:\n\n```yaml\n# In suricata.yaml\naf-packet:\n  - interface: eth0\n    cluster-id: 98\n    cluster-type: cluster_flow\n    defrag: yes\n    use-mmap: yes\n    copy-mode: ips\n    copy-iface: eth1\n  - interface: eth1\n    cluster-id: 97\n    cluster-type: cluster_flow\n    defrag: yes\n    use-mmap: yes\n    copy-mode: ips\n    copy-iface: eth0\n```\n\n### Step 4: Manage Rules with Suricata-Update\n\n```bash\n# Update rules from default sources (ET Open)\nsudo suricata-update\n\n# List available rule sources\nsudo suricata-update list-sources\n\n# Enable ET Pro (requires license key)\nsudo suricata-update enable-source et\u002Fpro secret-code=YOUR_OINKCODE\n\n# Enable additional sources\nsudo suricata-update enable-source oisf\u002Ftrafficid\nsudo suricata-update enable-source ptresearch\u002Fattackdetection\nsudo suricata-update enable-source sslbl\u002Fssl-fp-blacklist\n\n# Disable specific rules that generate false positives\necho \"2100498\" >> \u002Fetc\u002Fsuricata\u002Fdisable.conf\necho \"group:emerging-policy.rules\" >> \u002Fetc\u002Fsuricata\u002Fdisable.conf\n\n# Modify rule actions (change alert to drop)\necho 're:ET MALWARE' >> \u002Fetc\u002Fsuricata\u002Fmodify.conf\n\n# Apply updates\nsudo suricata-update --reload-command=\"suricatasc -c reload-rules\"\n```\n\n### Step 5: Write Custom Rules\n\nCreate `\u002Fvar\u002Flib\u002Fsuricata\u002Frules\u002Flocal.rules`:\n\n```\n# Detect potential reverse shell over TCP\ndrop tcp $HOME_NET any -> $EXTERNAL_NET any (msg:\"LOCAL Potential Reverse Shell - \u002Fbin\u002Fbash in payload\"; flow:to_server,established; content:\"\u002Fbin\u002Fbash\"; content:\"-i\"; within:20; classtype:trojan-activity; sid:1000001; rev:1;)\n\n# Block known malicious user agent\ndrop http $HOME_NET any -> $EXTERNAL_NET any (msg:\"LOCAL Malicious User-Agent - Cobalt Strike\"; http.user_agent; content:\"Mozilla\u002F5.0 (compatible|3b| MSIE 9.0|3b| Windows NT 6.1|3b| WOW64|3b| Trident\u002F5.0)\"; classtype:trojan-activity; sid:1000002; rev:1;)\n\n# Detect DNS query for known DGA domain pattern\nalert dns $HOME_NET any -> any 53 (msg:\"LOCAL Suspicious DGA Domain Query\"; dns.query; content:\".top\"; pcre:\"\u002F^[a-z0-9]{12,30}\\.(top|xyz|club|online|site)$\u002F\"; classtype:bad-unknown; sid:1000003; rev:1;)\n\n# Detect large DNS TXT response (potential C2)\nalert dns any 53 -> $HOME_NET any (msg:\"LOCAL Large DNS TXT Response - Potential C2\"; dns.opcode:0; content:\"|00 10|\"; byte_test:2,>,500,0,relative; classtype:bad-unknown; sid:1000004; rev:1;)\n\n# Block outbound traffic to Tor exit nodes\ndrop tcp $HOME_NET any -> [100.2.18.10,104.244.76.13,109.70.100.1] any (msg:\"LOCAL Outbound Connection to Known Tor Exit Node\"; classtype:policy-violation; sid:1000005; rev:1;)\n\n# Detect SMB lateral movement attempts\nalert tcp $HOME_NET any -> $HOME_NET 445 (msg:\"LOCAL Internal SMB Connection - Possible Lateral Movement\"; flow:to_server,established; content:\"|ff|SMB\"; offset:4; depth:4; threshold:type both,track by_src,count 5,seconds 60; classtype:attempted-admin; sid:1000006; rev:1;)\n\n# Detect PowerShell download cradle\ndrop http $HOME_NET any -> $EXTERNAL_NET any (msg:\"LOCAL PowerShell Download Cradle Detected\"; http.user_agent; content:\"PowerShell\"; nocase; http.method; content:\"GET\"; classtype:trojan-activity; sid:1000007; rev:1;)\n\n# Detect ICMP tunneling (large ICMP packets)\nalert icmp $HOME_NET any -> $EXTERNAL_NET any (msg:\"LOCAL Oversized ICMP Packet - Possible Tunneling\"; dsize:>800; threshold:type both,track by_src,count 10,seconds 60; classtype:bad-unknown; sid:1000008; rev:1;)\n```\n\n### Step 6: Start Suricata in IPS Mode\n\n```bash\n# Test configuration\nsudo suricata -T -c \u002Fetc\u002Fsuricata\u002Fsuricata.yaml\n\n# Start in NFQUEUE IPS mode\nsudo suricata -c \u002Fetc\u002Fsuricata\u002Fsuricata.yaml -q 0\n\n# Start with AF_PACKET inline mode\nsudo suricata -c \u002Fetc\u002Fsuricata\u002Fsuricata.yaml --af-packet\n\n# Start as systemd service\nsudo systemctl enable suricata\nsudo systemctl start suricata\n\n# Monitor performance stats\ntail -f \u002Fvar\u002Flog\u002Fsuricata\u002Fstats.log\n\n# Reload rules without restart\nsudo suricatasc -c reload-rules\n```\n\n## Monitoring and Tuning\n\n### Performance Metrics\n\n```bash\n# Check kernel drops\nsudo suricatasc -c dump-counters | grep -E \"capture.kernel_drops|decoder.pkts\"\n\n# Monitor EVE JSON alerts\ntail -f \u002Fvar\u002Flog\u002Fsuricata\u002Feve.json | jq 'select(.event_type==\"alert\")'\n\n# Check rule loading\ngrep -c \"rules loaded\" \u002Fvar\u002Flog\u002Fsuricata\u002Fsuricata.log\n\n# Memory usage\nsudo suricatasc -c dump-counters | grep memuse\n```\n\n### Tuning for False Positives\n\n```bash\n# Identify noisy rules\ncat \u002Fvar\u002Flog\u002Fsuricata\u002Feve.json | jq -r 'select(.event_type==\"alert\") | .alert.signature_id' | sort | uniq -c | sort -rn | head -20\n\n# Suppress specific rules per source\necho \"suppress gen_id 1, sig_id 2100498, track by_src, ip 10.0.5.0\u002F24\" >> \u002Fetc\u002Fsuricata\u002Fthreshold.config\n\n# Rate-limit alerts\necho \"rate_filter gen_id 1, sig_id 2100366, track by_src, count 10, seconds 60, new_action alert, timeout 300\" >> \u002Fetc\u002Fsuricata\u002Fthreshold.config\n```\n\n## Best Practices\n\n- **Start in IDS Mode** - Deploy in IDS (alert-only) mode first, tune for 2-4 weeks, then switch to IPS\n- **Fail-Open** - Configure fail-open mode so network traffic continues if Suricata crashes\n- **Rule Tuning** - Use threshold and suppress directives to reduce false positives before enabling drop actions\n- **CPU Affinity** - Pin Suricata worker threads to dedicated CPU cores for consistent performance\n- **Bypass for Trusted Traffic** - Use `pass` rules for known-good traffic to reduce processing load\n- **Regular Updates** - Run `suricata-update` daily via cron to keep signatures current\n- **Monitor Drops** - Track kernel packet drops and increase ring buffer size if needed\n\n## References\n\n- [Suricata Documentation](https:\u002F\u002Fdocs.suricata.io\u002Fen\u002Flatest\u002F)\n- [Suricata Rules Format](https:\u002F\u002Fdocs.suricata.io\u002Fen\u002Flatest\u002Frules\u002Findex.html)\n- [Emerging Threats Rulesets](https:\u002F\u002Frules.emergingthreats.net\u002F)\n- [OISF Suricata GitHub](https:\u002F\u002Fgithub.com\u002FOISF\u002Fsuricata)\n- [Suricata-Update Documentation](https:\u002F\u002Fsuricata-update.readthedocs.io\u002F)\n",{"name":5,"tags":24,"author":34,"domain":35,"license":14,"version":36,"nist_csf":37,"subdomain":29,"description":7,"mitre_attack":42},[25,26,27,28,29,30,31,32,33],"suricata","ips","ids","intrusion-prevention","network-security","emerging-threats","rule-management","nfqueue","inline-mode","mahipal","cybersecurity","1.0",[38,39,40,41],"PR.IR-01","DE.CM-01","ID.AM-03","PR.DS-02",[43,44,45,46],"T1046","T1040","T1557","T1071","main","1eb986d0b0ecc180291597e08eb5a58288843536","skills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fimplementing-network-intrusion-prevention-with-suricata","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv","2026-08-25 13:16:33",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add vikasvardhanv\u002Fjerry_skills --skill implementing-network-intrusion-prevention-with-suricata",{"tool":59,"command":60},"bunx","bunx skills add vikasvardhanv\u002Fjerry_skills --skill implementing-network-intrusion-prevention-with-suricata",{"tool":62,"command":63},"pnpm","pnpm dlx skills add vikasvardhanv\u002Fjerry_skills --skill implementing-network-intrusion-prevention-with-suricata","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fimplementing-network-intrusion-prevention-with-suricata\u002FSKILL.md",true,[67,71,77],{"path":68,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":15},"LICENSE","许可证",11255,{"path":72,"resourceType":73,"resourceTypeDesc":74,"sizeBytes":75,"sourceHtmlUrl":76},"references\u002Fapi-reference.md","REFERENCE","参考文档",2971,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fimplementing-network-intrusion-prevention-with-suricata\u002Freferences\u002Fapi-reference.md",{"path":78,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":81,"sourceHtmlUrl":82},"scripts\u002Fagent.py","SCRIPT","脚本",6533,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Fimplementing-network-intrusion-prevention-with-suricata\u002Fscripts\u002Fagent.py",[84,92,99,106,113,120],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":88,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7BESR1CJ3H5SP9XM8KYJZ9W","syllabus","Generates a curated supplementary reading list from any course syllabus using Consensus academic search. Grill-me intake (syllabus input format + course audience + year range) plus a grouping forcing-options checkpoint before any search runs — so the reading list matches the course's level and recency need. Parses the syllabus to extract topics and learning outcomes, searches Consensus for recent peer-reviewed papers per topic, and produces a professionally formatted .docx with clickable Consensus links, plain-language summaries calibrated to audience level, and Bloom-higher-order discussion questions tied to course learning goals. Use when the user uploads a syllabus, course outline, or curriculum document and wants supplementary readings (e.g., 'create a reading list from this syllabus', 'find recent papers for my course') — even casual mentions with a syllabus attached should trigger this skill.","MIT","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fsyllabus\u002Fskills\u002Fsyllabus\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":88,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M7BES1YA6R97W7QPMFFM1PED","pulse","Multi-source recency research skill that takes the pulse of any topic across Reddit, Hacker News, the open web, and optionally X\u002FTwitter within a configurable recent window (default 30 days). Forcing intake clarifies topic specificity, angle (trend\u002Fsentiment\u002Fproblems\u002Fopportunities\u002Fcomparison), time window, and platform scope before searching. Returns a synthesized briefing with citations, engagement metrics, and cross-platform pattern analysis. Use when the user requests multi-source recency intelligence on a topic (e.g., 'pulse on [topic]', 'what's happening with [topic]', 'what are people saying about [topic]', 'current conversation about [topic]', 'take the pulse of [topic]', 'trending: [topic]', 'find me info on [topic]'), and for competitor research, trend discovery, tool comparisons, and audience sentiment analysis.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpulse\u002Fskills\u002Fpulse\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":88,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":19},"01M7BERNHYGY035AR00VRT03KE","patent","Patent prior-art and landscape intelligence skill — not generic patent help. Commits to one of five sub-use-cases via forcing intake (novelty search \u002F freedom-to-operate \u002F competitive landscape \u002F acquisition diligence \u002F litigation prior-art) before any search runs. Searches Google Patents, Espacenet, USPTO, and optionally Lens.org for citation-graph signals. Output is an editable Word document (.docx) with verdict, ranked closest art (claim-text extracted), CPC-class-aware landscape, family-resolved hits, geographic coverage, FTO flags where applicable, strategy recommendations, and full audit log. Use when the user asks for patent searching or analysis (e.g., 'prior art search for [invention]', 'freedom to operate analysis for [product]'). Produces search signal, not legal advice — always recommends consulting a patent attorney before filing or licensing decisions. Trademark, copyright, and trade-secret questions are out of scope.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpatent\u002Fskills\u002Fpatent\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":88,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":19},"01M7BERCK1EAKTWW7R436WAR0J","notebooklm","Browser automation skill for controlling Google's NotebookLM. Use when the user wants anything done in NotebookLM (e.g., 'open NotebookLM', 'check my [name] notebook', 'ask my notebook about X', 'add [source] to NotebookLM', 'generate a Video Overview from my notebook', 'use NotebookLM Studio'). Handles reading and querying notebooks, adding sources (URLs, text, files, YouTube links, synthesized content), generating Studio outputs (Audio\u002FVideo Overviews, Mind Maps, Reports incl. Briefing Doc\u002FStudy Guide\u002FFAQ, Flashcards, Quiz, slide decks, infographics — discover the exact set from the live Studio panel; the UI evolves fast), and creating new notebooks. Requires browser automation environment — fails gracefully when unavailable.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fnotebooklm\u002Fskills\u002Fnotebooklm\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":88,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":19},"01M7BEQZAZAQRTXFJRY7RHV3TY","litreview","Academic literature orientation skill that searches papers via free keyless APIs (PubMed E-utilities + OpenAlex) by default — with the Consensus MCP as an optional enhancement lane when connected — builds a strategic search plan using PICO (default) or SPIDER \u002F Decomposition \u002F hybrid as fallbacks, and synthesizes findings into a formatted Word (.docx) research guide. Grill-me intake (research question specificity + framework hint + tentative depth) before the recon search; a second forcing checkpoint after Phase 2 confirms framework + sub-areas + depth before searches consume budget. Configurable depth (5\u002F10\u002F20 queries) controls coverage vs. speed. Output is a 'launching pad' — an orientation guide that lets a researcher dive in confidently, not a finished review. Use when the user starts literature-oriented research (e.g., 'litreview on [topic]', 'literature review on [topic]', 'I'm starting a literature review on X', 'I'm writing a paper on X', 'help me research X', 'I'm doing research on X', 'can you help me research X'). Do NOT use for single one-off paper searches wanting a quick list — that's a plain PubMed\u002FOpenAlex (or Consensus) query.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Flitreview\u002Fskills\u002Flitreview\u002FSKILL.md",[],[],{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":88,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":19},"01M7BEQKJ45K31QK5VRAQSVJCJ","grants","NIH grant research skill for clinical researchers. Grill-me intake (research idea + career stage + preliminary data + environment + submission posture + known institute targets) locks down the funding strategy before any search runs. Runs a 5-facet Consensus positioning analysis (with draft Significance\u002FInnovation language), maps the research to the right NIH institutes and study sections via RePORTER, finds NOSIs and funded overlap, and produces an editable Word document (.docx) with budget\u002Fscope-aware mechanism recommendations, submission timelines, and a mandatory program officer recommendation. Use when the user asks about research funding or makes any grant-related request (e.g., 'grants for [topic]', 'find grants for my research idea', 'what grants match my research', 'help me find NIH funding', 'grant opportunities for my research'). NIH-only scope — non-NIH funders (PCORI, DOD CDMRP, VA, foundations) are out of scope and flagged at intake.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fgrants\u002Fskills\u002Fgrants\u002FSKILL.md",[],[]]