TNS
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Linux / Security

Ubuntu Linux: Install the Suricata Intrusion Detection System

Suricata is a high-performance, open source network analysis and threat detection software that includes features like alerts, automated protocol detention, Lua scripting, and industry-standard outputs.
Oct 12th, 2024 9:00am by
Featued image for: Ubuntu Linux: Install the Suricata Intrusion Detection System

An Intrusion Detection System (IDS) is essential for monitoring network traffic and checking for malicious activity. If your servers are of the Linux type, you have plenty of options, one of which is Suricata.

Suricata is a high-performance, open source network analysis and threat detection software that is used by numerous private and public organizations and includes features like alerts, automated protocol detention, Lua scripting, and industry-standard outputs. It offers six modes of operation:

  • Intrusion Detection System (the default)
  • Intrusion Prevention System
  • Network Security Monitoring System
  • Full Packet Capture
  • Condition PCAP capture
  • Firewall

Most users will go with the default mode, which is a combination of IDS and network security monitoring, which ensures alerts include information about protocol, flow, file transaction/extraction, anomaly, and flow logs. You can read more about Suricata from the official site.

Suricata is free to install and use.

What I want to do is walk you through the process of installing this IDS on Ubuntu Server 22.04.

What You’ll Need

To get Suricata up and running, you’ll need a running instance of Ubuntu Server 22.04 and a user with sudo privileges. That’s it… let’s get to work.

Install the Necessary Requirements

The first thing to be done is the installation of the necessary requirements. Log into your Ubuntu server and install those packages with the command:


When the above command completes, you’re ready to move on.

Download and Unpack the Source

Next, we can download the Suricata source and unpack it. Download the compressed archive file with the command:


You might want to visit the Suricata download page to ensure you’re grabbing the most current version.

Unpack the file with the command:


The above command will create a new folder, called suricata-7.0.6.

Build and Install the Package

We can now build the package. Change into the newly-created directory with:


In that directory, run the configure script with:


The above command will take a minute or so to complete.

Finally, install the package with the command:


The installation will take between 5-10 minutes, depending on the speed of your hardware.

Another method of installing Surcicata is via a PPA repository. Add the repository with the command:


Update apt with:


Install Suricata with:


Do note: I prefer installing with the PPA method because it adds a systemd startup file for easy service control.

Start the Service

With the installation complete, it’s time to start the service with the command:

Configure Suricata

It’s time to configure Suricata. Open the configuration file with:


I’m going to assume you’ll be using Suricata on a LAN. For that, look for the line that starts with HOME_NET. In that line, you’ll need to configure your subnet (such as 192.168.1.0/16).

Next, look for the af-packet line. Below that you’ll see -interface: eth0. You need to change eth0 to the name of your networking interface (which can be found with the ip a command).

Once that’s taken care of, you’ll need to add the following to enable live rule reloading. The following can be added to the bottom of the configuration file:

detect-engine:
– rule-reload: true

Save and close the file.

Update the Suricata Rules

With the configuration taken care of, you’ll then want to update the Suricata rule sets with the command:

Running Suricata

It’s time to take Suricata for a test run. After the rules have updated, we’re going to test the rules with the following command:


You shouldn’t receive any error message, and the test will end with the following:

Notice: suricata: Configuration provided was successfully loaded. Exiting.

Restart the service with:

Test Suricata

Let’s run a quick test. Below is a command used to trigger a false alert. Do this:

Log into the server from a second terminal (or tab). From the first window, issue the command:


From the second terminal, issue the command:


In the first window, you should see output like this:

09/04/2024-17:44:43.767928  [**] [1:2100498:7] GPL ATTACK_RESPONSE id check returned root [**] [Classification: Potentially Bad Traffic] [Priority: 2] {TCP} 2600:9000:24d7:6c00:0018:30b3:e400:93a1:80 -> 2600:1700:6d90:f6b0:0000:0000:0000:001c:35524

Suricata caught the false alert.

Now that you have Suricata up and running (and successfully tested) check out the official documentation for Suricata rules that can help you get the most out of this free, open-source intrusion detection system. Suricata is a fairly complex system to use, so I would recommend you go through the official documentation to better understand how it works.

If you’d prefer to manage Suricata with a GUI, I’d recommend checking out IDS Tower.

Group Created with Sketch.
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.