angolo40 / mikrocata2selks

Mikrotik + Selks (Suricata) + Telegram + TZSP on Debian 12
GNU General Public License v3.0
51 stars 12 forks source link

Welcome to Mikrocata2SELKS 👋

Version License: MIT

📋 Introduction

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:

🚀 Installation

  1. Set up a fresh Debian 12 installation on a dedicated machine (server or VM).
  2. Log in as root.
  3. Install Git: apt install git.
  4. Clone this repository: git clone https://github.com/angolo40/mikrocata2selks.git.
  5. Edit easyinstall.sh with the path where to install SELKS and the number of Mikrotik devices to handle.
  6. Run ./easyinstall.sh.
  7. Wait....
  8. Once finished, edit /usr/local/bin/mikrocataTZSP0.py with your Mikrotik and Telegram parameters, then reload the service with systemctl restart mikrocataTZSP0.service.
  9. Configure your Mikrotik devices.

📡 Mikrotik Setup

  1. Enable sniffer:
    /tool/sniffer/set filter-stream=yes streaming-enabled=yes streaming-server=[YOURDEBIANIP]:37008
    /tool/sniffer/start
  2. Add firewall rules:
    /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
  3. Enable Mikrotik API:
    /ip/service/set api-ssl address=[DEBIANIP] enabled=yes
  4. Add Mikrocata user in Mikrotik:
    /user/add name=mikrocata2selks password=xxxxxxxxxxxxx group=full (change password)

🛠️ Handling Multiple Mikrotik Devices

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.

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.

💡 Features

🔄 Changelog

2.2.3

2.2.2

2.2.1

2.2

2.1

🔧 Troubleshooting

📝 Notes

👤 Author

Giuseppe Trifilio

Inspired by zzbe/mikrocata.

🤝 Contributing

Contributions, issues, and feature requests are welcome! Check the issues page.

🌟 Show Your Support

Give a ⭐️ if this project helped you!