This blog provides a comprehensive step-by-step guide to installing and configuring Suricata, an open-source network threat detection engine, on Ubuntu 20.04. Suricata is capable of real-time intrusion detection, intrusion prevention, and network security monitoring. By following this guide, you will be able to set up Suricata on your Ubuntu system and start monitoring network traffic effectively.
Step 1: Update Your System
Before installing any new software, it’s always a good practice to update your system packages. Open your terminal and run the following commands:
sudo apt update
sudo apt upgrade -y
Step 2: Install Required Dependencies
Suricata requires certain dependencies to function properly. Install them using the following command:
sudo apt install -y software-properties-common
Step 3: Add the Suricata PPA
To get the latest version of Suricata, you need to add the official Suricata PPA (Personal Package Archive). Run the following command:
sudo add-apt-repository ppa:oisf/suricata-stable
After adding the PPA, update your package list again:
sudo apt update
Step 4: Install Suricata
Now you can install Suricata using the following command:
sudo apt install -y suricata
Step 5: Configure Suricata
Once Suricata is installed, you need to configure it. The main configuration file is located at /etc/suricata/suricata.yaml
. You can edit this file using your preferred text editor. For example:
sudo nano /etc/suricata/suricata.yaml
Make any necessary changes according to your network setup. Pay special attention to the af-packet
section if you want to monitor traffic on a specific interface.
Step 6: Set Up Suricata to Run on Boot
To ensure that Suricata starts automatically on boot, run the following command:
sudo systemctl enable suricata
Step 7: Start Suricata
You can start Suricata using the following command:
sudo systemctl start suricata
To check the status of Suricata, use:
sudo systemctl status suricata
Step 8: Verify Suricata Installation
To verify that Suricata is running correctly, you can check the logs located in /var/log/suricata/
. Use the following command to view the logs:
sudo tail -f /var/log/suricata/suricata.log
Step 9: Update Rules
Suricata uses rules to detect threats. You can download the Emerging Threats ruleset by running:
sudo suricata-update
This command will fetch the latest rules and update your Suricata installation.
Step 10: Test Suricata
To test if Suricata is working properly, you can generate some traffic and check if it logs any alerts. You can use tools like hping3
or nmap
to generate traffic that matches the rules.
Conclusion
You have successfully installed and configured Suricata on your Ubuntu 20.04 system. With Suricata running, you can now monitor your network traffic for potential threats and enhance your network security posture. Regularly update your rules and keep an eye on the logs to ensure optimal performance.
Read more: