SOC and blue team

Suricata for Beginners: Install, Rules and Alerts

Suricata is a free intrusion detection system (IDS). It watches network traffic, compares it with rules and writes alerts. If the idea is new, read firewalls, IDS and IPS explained first. This guide builds a small lab on a Debian or Ubuntu virtual machine you own.

Install and Update Rules

  • sudo apt install suricata
  • sudo suricata-update downloads the Emerging Threats Open rule set.
  • sudo suricata -T -c /etc/suricata/suricata.yaml -v tests the configuration.

Run It

  • Set the interface in /etc/suricata/suricata.yaml (the af-packet section), or pass it on the command line.
  • sudo suricata -c /etc/suricata/suricata.yaml -i eth0

Leave it running in one terminal. Use a second VM to generate traffic.

Read the Alerts

  • /var/log/suricata/fast.log has one readable line per alert.
  • /var/log/suricata/eve.json has full detail in JSON, which tools such as Splunk and Wazuh can read; see Splunk vs Wazuh.
  • tail -f /var/log/suricata/fast.log follows new alerts as they appear.

Write a Simple Rule

Add a rule to a local rule file listed under rule-files in the configuration. This one alerts when an HTTP request carries a user agent you choose:

  • alert http any any -> any any (msg:"LAB test user agent"; http.user_agent; content:"labtest"; sid:1000001; rev:1;)

Reload Suricata, then from another VM run curl -A labtest http://192.168.56.20/. The alert should appear in fast.log. Custom rule ids start at 1000000 so they do not clash with downloaded rules.

Tune and Learn

Run a scan from another VM (Nmap for beginners) and see which rules fire. Real teams spend much of their time tuning noisy rules. Network monitoring and perimeter defense are covered in the CND syllabus and the SOC analyst guide.

Sources and Further Reading

Want to build and attack a monitored lab with a trainer? Book free trial classes. Contact us or call +91 86868 92922.

Start Your Cyber Security Career

Talk to a counselor, choose the right course for your goals, and get the fee, syllabus and next batch dates in writing.

Book Free Trial Classes

By submitting, you agree that Hacking Trainer Academy may contact you about courses by phone, WhatsApp or email. See our privacy notice and refund policy.

WhatsApp