Protecting your network with the Suricata intrusion detection system
Securing Suricata
To secure Suricata, the first thing you'll want to change is the user and group that Suricata runs as (which, by default, is root). Edit suricata.yaml
with the following:
user: suricata group: suricata
Of course, you'll also need to create a user and group, make sure you set the login shell as /sbin/nologin
and specify that you won't need a home directory. You should also ensure the account is not allowed to login. Unfortunately locking Suricata down with SELinux is non-trivial, so by default, it'll run unconfined; however, if you're feeling lucky, I suggest running the system in permissive mode and using audit2allow
to examine the logfiles and create a policy to confine it. (Suricata requires relatively minimal filesystem access – just lots of network access.)
I would also strongly advise firewalling the Suricata server itself. In general, the Suricata server should have a minimum of incoming connections and outgoing connections. However, if you are using Suricata in IPS mode (where it acts as a router and traffic flows through it), a skilled attacker should be able simply to spoof outgoing connections, as from an IP address for which Suricata is routing, and Suricata by design would be able to accept incoming connections for IP addresses other than the server itself.
Suricata Rules
As mentioned before, Suricata is Snort compatible for your basic IDS/IPS rules. If you are monitoring a general network (e.g., Windows workstations, mobile devices, server), I would strongly advise using the Snort rules. As with any signature database of attacks; it is best to keep your ruleset up to date.
Two options for automatically updating your ruleset are Oinkmaster and PulledPork [3]. Oinkmaster's last release was in 2006; PulledPork is more up to date with a release in 2013; however, it does have some issues with Suricata. PulledPork is a Perl script; basically, you'll need to install some requirements, like LWP-UserAgent
, SSLeay
, Archive::TAR
, SYS::Syslog
, and so on. PulledPork can simply download the rules tarball and replace your existing rules, then you can restart Suricata. You can also drop rules (e.g., if you have no Windows machines, you can probably drop all the Windows stuff) and modify rules, both simply and in arbitrary ways (e.g., you could change path names used in HTTP-related rules). Finally you'll want to run PulledPork on a regular basis using crontab at some time when you're around, so you can deal with problems in case it breaks (which should never happen, but who knows).
IDS vs. IPS
If Suricata can serve as an IPS (to block attacks), why would you ever use it in IDS mode (just detect and log attacks)? Several issues come into play; the first is contractual and legal. Many networks have contracts with customers that allow them to monitor traffic for administrative purposes (e.g., so you can do billing by usage) but does not allow modification or blocking of the traffic. IPS systems can inadvertently block legitimate traffic, depending on the rules and configuration in use, so tuning rules and monitoring blocked traffic to ensure no legitimate traffic is blocked can require some effort. Finally, IPS systems can introduce latency (depending on how the data is examined and blocked) and introduce points of failure. I suggest either engineering your system so you can disable Suricata and allow traffic to flow normally, or having at least two Suricata systems with routers configured to failover if one fails. If you plan to use Suricata as an IPS, I suggest using it in IDS mode initially to get an idea of how much traffic will be blocked and to ensure any blocked traffic is not critical.
Using Suricata as an IDS can also provide a great deal of insight into your network. For example, which filesharing protocols are being used? NFS? CIFS? Rsync? FTP? Using Suricata with detection rules or the packet profiling will provide information you cannot easily collect using other tools.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
![Learn More](https://www.linux-magazine.com/var/linux_magazin/storage/images/media/linux-magazine-eng-us/images/misc/learn-more/834592-1-eng-US/Learn-More_medium.png)
News
-
NVIDIA Released Driver for Upcoming NVIDIA 560 GPU for Linux
Not only has NVIDIA released the driver for its upcoming CPU series, it's the first release that defaults to using open-source GPU kernel modules.
-
OpenMandriva Lx 24.07 Released
If you’re into rolling release Linux distributions, OpenMandriva ROME has a new snapshot with a new kernel.
-
Kernel 6.10 Available for General Usage
Linus Torvalds has released the 6.10 kernel and it includes significant performance increases for Intel Core hybrid systems and more.
-
TUXEDO Computers Releases InfinityBook Pro 14 Gen9 Laptop
Sporting either AMD or Intel CPUs, the TUXEDO InfinityBook Pro 14 is an extremely compact, lightweight, sturdy powerhouse.
-
Google Extends Support for Linux Kernels Used for Android
Because the LTS Linux kernel releases are so important to Android, Google has decided to extend the support period beyond that offered by the kernel development team.
-
Linux Mint 22 Stable Delayed
If you're anxious about getting your hands on the stable release of Linux Mint 22, it looks as if you're going to have to wait a bit longer.
-
Nitrux 3.5.1 Available for Install
The latest version of the immutable, systemd-free distribution includes an updated kernel and NVIDIA driver.
-
Debian 12.6 Released with Plenty of Bug Fixes and Updates
The sixth update to Debian "Bookworm" is all about security mitigations and making adjustments for some "serious problems."
-
Canonical Offers 12-Year LTS for Open Source Docker Images
Canonical is expanding its LTS offering to reach beyond the DEB packages with a new distro-less Docker image.
-
Plasma Desktop 6.1 Released with Several Enhancements
If you're a fan of Plasma Desktop, you should be excited about this new point release.