angolo40 / mikrocata2selks

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

Fresh Install mikrocata.py crashing on event #12

Closed mk31999 closed 1 month ago

mk31999 commented 2 months ago

Hi,

I have been running this perfectly in prod for last few months. Had an issue within my vm ESXI which meant I needed to rebuild from scratch. (Backups were also affected)

Been running for around a week to get my rules back in order, connected today to my Mikrotik and noticed in Mikrotik logs the API user was disconnecting / reconnecting

Traced it back to microcata.py service crashing when it is trying to log firewall rule

Logs during the crash below

[Mikrocata] Connected to Mikrotik Traceback (most recent call last): File "/usr/local/bin/mikrocataTZSP0.py", line 414, in <module> main() File "/usr/local/bin/mikrocataTZSP0.py", line 398, in main notifier.loop() File "/usr/lib/python3/dist-packages/pyinotify.py", line 1376, in loop self.process_events() File "/usr/lib/python3/dist-packages/pyinotify.py", line 1275, in process_events self._default_proc_fun(revent) File "/usr/lib/python3/dist-packages/pyinotify.py", line 910, in __call__ return _ProcessEvent.__call__(self, event) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/pyinotify.py", line 630, in __call__ return meth(event) ^^^^^^^^^^^ File "/usr/local/bin/mikrocataTZSP0.py", line 78, in process_IN_MODIFY add_to_tik(read_json(FILEPATH)) File "/usr/local/bin/mikrocataTZSP0.py", line 159, in add_to_tik if event["src_ip"].startswith(WHITELIST_IPS): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: tuple for startswith must only contain str, not tuple

mk31999 commented 1 month ago

I solved my issue. Was a misplaced comma in my configuration

Cheers