#Monitoring Network Traffic with Suricata and Zeek

Introduction

Monitoring network traffic is crucial for detecting threats and ensuring system security. Suricata and Zeek are powerful open-source tools that provide deep network inspection, intrusion detection, and logging capabilities. This guide will walk you through setting up Suricata and Zeek for network monitoring.


Step 1: Install Suricata

  1. Update your package list and install Suricata:

    sudo apt update && sudo apt install suricata -y

  2. Enable and start the Suricata service:

    sudo systemctl enable suricata

    sudo systemctl start suricata

  3. Verify that Suricata is running:

    sudo systemctl status suricata


Step 2: Configure Suricata

  1. Edit the Suricata configuration file: sudo nano /etc/suricata/suricata.yaml

  2. Modify the interface settings to match your network:

    af-packet:

    interface: eth0

    cluster-id: 99

    cluster-type: cluster_flow

  3. Save and close the file.

  4. Restart Suricata to apply changes:

    sudo systemctl restart suricata


Step 3: Install Zeek

  1. Install required dependencies:

    sudo apt install cmake make gcc g++ flex bison libpcap-dev libssl-dev python3 python3-dev swig zlib1g-dev

  2. Download and install Zeek:

    cd /usr/local/src

    sudo git clone --recursive https://github.com/zeek/zeek.git

    cd zeek

    sudo ./configure

    sudo make && sudo make install


Step 4: Configure Zeek

  1. Initialize Zeek:

    sudo /usr/local/zeek/bin/zeekctl deploy

  2. Verify that Zeek is running:

    sudo /usr/local/zeek/bin/zeekctl status

  3. Enable Zeek logs for detailed network analysis:

    sudo nano /usr/local/zeek/etc/node.cfg

  4. Ensure the interface matches your network:

    [zeek]

    type=standalone

    host=localhost

    interface=eth0

  5. Save and restart Zeek:

    sudo /usr/local/zeek/bin/zeekctl restart


Step 5: Analyze Network Traffic

  1. View Suricata alerts:

    sudo cat /var/log/suricata/fast.log

  2. View Zeek logs:

    sudo ls /usr/local/zeek/logs/current

  3. To inspect a specific Zeek log file:

    sudo cat /usr/local/zeek/logs/current/conn.log


Conclusion

By setting up Suricata and Zeek, you gain powerful network monitoring and threat detection capabilities. Regularly reviewing logs and refining configurations will help you maintain a secure network.