Home

Suricata: high-performance network IDS/IPS

Security
Difficulty: Advanced
4 min read

Tutorial to install and configure Suricata, a modern, multi-threaded network intrusion detection and prevention engine (IDS/IPS).

Back to tutorials

Key takeaways

  • Suricata installs cleanly on Ubuntu from the official OISF PPA: sudo add-apt-repository ppa:oisf/suricata-stable then sudo apt-get install -y suricata, which avoids the frozen versions shipped in distro repos.
  • The critical part of /etc/suricata/suricata.yaml is two sections: vars to declare HOME_NET (your internal ranges) and EXTERNAL_NET: "!$HOME_NET", and af-packet for the monitoring interface (threads: auto, cluster-type: cluster_flow, use-mmap: yes). It is YAML: bad indentation breaks everything.
  • Rules are managed with sudo suricata-update, which pulls the ET Open ruleset by default; suricata-update list-sources lists the other sources you can enable. Schedule it in cron, followed by systemctl reload suricata.
  • Always validate before starting with sudo suricata -T -c /etc/suricata/suricata.yaml -v: the -T flag checks the config and the rules. Then test for real: curl -A "BlackSun" http://SURICATA_IP fires the "ET MALWARE BlackSun" rule that is enabled by default.
  • IPS mode (active blocking) requires putting Suricata inline via NFQUEUE: sudo iptables -I FORWARD -j NFQUEUE then suricata -c /etc/suricata/suricata.yaml -q 0. Get it wrong and you cut all network traffic — and the real work is still tuning rules to kill false positives.
What is Suricata?
Suricata is an open-source, high-performance and mature network threat detection engine. It can act as an Intrusion Detection System (IDS), an Intrusion Prevention System (IPS), and a Network Security Monitoring (NSM) tool. It was designed to be multi-threaded, which allows it to take full advantage of modern multi-core processors.

Why use Suricata?

  • High Performance: Designed for multi-threading, it can inspect network traffic at very high bandwidth.
  • Advanced Detection: It can not only use signature-based rules (like Snort), but also analyze protocols and extract files for deeper analysis.
  • Modern Ecosystem: Logs are output in EVE JSON format, a structured format that is easy to integrate with tools like an ELK stack (Elasticsearch, Logstash, Kibana) or Splunk.
  • Simple rule management: It includes a tool, `suricata-update`, to make updating rule sets easier.

Prerequisites

  • A Linux server (Ubuntu/Debian is used in this guide).
  • Root access or sudo privileges.
  • A network interface dedicated to listening to traffic (monitoring).

Premium Content

This advanced tutorial is reserved for premium members.

9,90€ / month
  • All advanced tutorials
  • New content every week
  • Progress tracking
  • Cancel anytime
MR

Written by

Morgann Riu

Cybersecurity and Linux administration expert. I share my knowledge through free tutorials and training to help system administrators and developers secure their infrastructures.

Frequently asked questions

What is the difference between an IDS and an IPS?
An IDS (Intrusion Detection System) monitors network traffic and raises alerts when suspicious activity is detected, without blocking the traffic. An IPS (Intrusion Prevention System) goes further by actively blocking malicious traffic. Suricata can operate in both modes depending on the configuration.
Is Suricata better than Snort?
Suricata offers native multi-threading, which makes it more performant on high-bandwidth networks. It natively supports the EVE JSON format for logs, making integration with SIEMs easier. It is compatible with Snort rules while adding its own features. Snort remains a reference with an older, larger community.
How do I update Suricata rules?
Use the built-in suricata-update tool: sudo suricata-update. It automatically downloads and installs the latest rules from the configured sources (ET Open by default). Schedule this command via cron for automatic updates. Reload Suricata after the update with sudo systemctl reload suricata.
How do I integrate Suricata with a SIEM such as ELK?
Suricata generates logs in EVE JSON format in /var/log/suricata/eve.json. Configure Filebeat to read this file and send it to Elasticsearch. Kibana provides pre-configured dashboards for Suricata. This stack lets you visualize alerts, analyze traffic and correlate security events.

Share this tutorial

Did you enjoy this article?

Was this article helpful?

Thanks for your feedback!

Comments

Recommended for you

In-depth article on the topic

Checklist Sécurité Linux

30 points essentiels pour sécuriser un serveur Linux. Recevez aussi les nouveaux tutoriels par email.

Pas de spam. Désabonnement en 1 clic.

↑