KONFIGURASI
Update shared libraries
sudo ldconfig
Symblic link ke file Snort
sudo ln -s /usr/local/bin/snort /usr/sbin/snort
Membuat Username
sudo groupadd snort
Masukkan user ke dalam grup
sudo useradd snort -r -s /sbin/nologin -c SNORT_IDS -g snort
Buat folder untuk konfigurasi Snort
sudo mkdir -p /etc/snort/rules /var/log/snort /usr/local/lib/snort_dynamicrules
Mengatur permission Snort 1
sudo chmod -R 5775 /etc/snort /var/log/snort /usr/local/lib/snort_dynamicrules
Mengatur permission Snort 2
sudo chown -R snort:snort /etc/snort /var/log/snort /usr/local/lib/snort_dynamicrules
Membuat file untuk menampung black list dan white list
sudo touch /etc/snort/rules/white_list.rules /etc/snort/rules/black_list.rules /etc/snort/rules/local.rules
Meng-copy konfigurasi ke lokasi Snort
sudo cp ~/snort_src/snort-2.9.9.0/etc/*.conf* /etc/snort ~/snort_src/snort-2.9.9.0/etc/*.map /etc/snort
Mendownload rules untuk community
wget https://www.snort.org/rules/community -O ~/community.tar.gz
Ekstrak rules untuk community
sudo tar -xvf ~/community.tar.gz -C ~/
Copy rules ke folder Snort
sudo cp ~/community-rules/* /etc/snort/rules
Menghilangkan rules yang tidak dibutuhkan saat konfigurasi
sudo sed -i 's/include \$RULE\_PATH/#include \$RULE\_PATH/' /etc/snort/snort.conf
Edit file konfigurasi
sudo gedit /etc/snort/snort.conf
# Setup the network addresses you are protecting
ipvar HOME_NET <server public IP>/32
# Set up the external network addresses. Leave as "any" in most situations
ipvar EXTERNAL_NET !$HOME_NET
# Path to your rules files (this can be a relative path)
var RULE_PATH /etc/snort/rules
var SO_RULE_PATH /etc/snort/so_rules
var PREPROC_RULE_PATH /etc/snort/preproc_rules
# Set the absolute path appropriately
var WHITE_LIST_PATH /etc/snort/rules
var BLACK_LIST_PATH /etc/snort/rules
# unified2
# Recommended for most installs
output unified2: filename snort.log, limit 128
include $RULE_PATH/community.rules
Validasi konfigurasi yang telah diubah
sudo snort -T -c /etc/snort/snort.conf
Buka file local.rules
sudo nano /etc/snort/rules/local.rules
Tambahkan satu baris
alert icmp any any -> $HOME_NET any (msg:"ICMP test"; sid:10000001; rev:001;)
Cek tipe koneksi
ip addr
Jika tipe koneksi
enp0s3
, maka masukkan konfigurasisudo snort -A console -i enp0s3 -u snort -g snort -c /etc/snort/snort.conf