This repository is designed to simplify the installation process for the IDS/IPS Suricata for packet analysis from Mikrotik devices. The script is compatible with latest SELKS 10.
Minimum Requirements:
apt install git
.git clone https://github.com/angolo40/mikrocata2selks.git
.easyinstall.sh
with the path where to install SELKS and the number of Mikrotik devices to handle../easyinstall.sh
./usr/local/bin/mikrocataTZSP0.py
with your Mikrotik and Telegram parameters, then reload the service with systemctl restart mikrocataTZSP0.service
./tool/sniffer/set filter-stream=yes streaming-enabled=yes streaming-server=[YOURDEBIANIP]:37008
/tool/sniffer/start
/ip/firewall/raw/add action=drop chain=prerouting comment="IPS-drop_in_bad_traffic" src-address-list=Suricata
/ip/firewall/raw/add action=drop chain=prerouting comment="IPS-drop_out_bad_traffic" dst-address-list=Suricata
/ipv6/firewall/raw/add action=drop chain=prerouting comment="IPS-drop_in_bad_traffic" src-address-list=Suricata
/ipv6/firewall/raw/add action=drop chain=prerouting comment="IPS-drop_out_bad_traffic" dst-address-list=Suricata
/ip/service/set api-ssl address=[DEBIANIP] enabled=yes
/user/add name=mikrocata2selks password=xxxxxxxxxxxxx group=full (change password)
By configuring the easyinstall.sh
file to manage more than one Mikrotik device, the setup script will automatically create dedicated dummy interfaces and corresponding Mikrocata services for each device on the Debian machine.
tzsp0
interface on port 37008
and the script /usr/local/bin/mikrocataTZSP0.py
.tzsp1
interface on port 37009
and the script /usr/local/bin/mikrocataTZSP1.py
.tzsp2
interface on port 37010
and the script /usr/local/bin/mikrocataTZSP2.py
.You will need to edit each script with the specific Mikrotik values and enable the sniffer on each Mikrotik device to send data to the corresponding port.
mikrocata.py
script crash during Suricata logrotate.read_json
function (thanks to bekhzad-khamidullaev).tcpdump -i tzsp0
systemctl status mikrocataTZSP0.service
systemctl status TZSPreplay37008@tzsp0.service
docker logs -f suricata
https://[YOURDEBIANIP]
selks-user
selks-user
Giuseppe Trifilio
Inspired by zzbe/mikrocata.
Contributions, issues, and feature requests are welcome! Check the issues page.
Give a ⭐️ if this project helped you!
87LLkcvwm7JUZAVjusKsnwNRPfhegxe73X7X3mWXDPMnTBCb6JDFnspbN8qdKZA6StHXqnJxMp3VgRK7DcS2sgnW3wH7Xhw