fail2ban/domoticz

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
miralant
Posts: 5
Joined: Tuesday 04 June 2019 17:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

fail2ban/domoticz

Post by miralant »

Hi,

I use on PIs and servers fail2ban to prevent brut force attack on SSH port. I've try to setup a jail to secure domoticz accordind to this tutorial : https://www.domoticz.com/wiki/Setup_fail2ban

After restart, it works (after 3 mistakes to logion page, the IP is push to iptables) but after several hours, the jail looks not fired :(

If I try regex (fail2ban-regex /tmp/domoticz.txt /etc/fail2ban/filter.d/domoticz.conf), it works. If I look to Top fail2ban is currently running.

I've try to restart f2b with systemctl restart fail2ban but the issue still present. If I reboot the Pi, it restarts working correctly. Strange :'

Thanks for your help.

raspbian : 10 buster
domoticz : 2020.2

Mira
User avatar
erem
Posts: 230
Joined: Tuesday 27 March 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Amsterdam/netherlands
Contact:

Re: fail2ban/domoticz

Post by erem »

what do you mean when you write

>>the jail looks not fired.

i have a hard time understanding your issue.
Regards,

Rob
miralant
Posts: 5
Joined: Tuesday 04 June 2019 17:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: fail2ban/domoticz

Post by miralant »

Sorry, i'll try to be more clear. #poorenglish

In fact, the domoticz jail works but after several hours it stops working. The jail is not triggered.

I need to fully restart Pi to fix the issue. (Systemctl restart won't fix...)
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: fail2ban/domoticz

Post by Egregius »

If it's truly the jail that stops, isn't this something to take up with fail2ban instead of domoticz then?
miralant
Posts: 5
Joined: Tuesday 04 June 2019 17:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: fail2ban/domoticz

Post by miralant »

For sure :D That's fail2ban issue not domoticz.
User avatar
jvdz
Posts: 2336
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: fail2ban/domoticz

Post by jvdz »

..or it is an iptables issue as that is what is being used by fail2ban. Did you check the status of iptables?

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
miralant
Posts: 5
Joined: Tuesday 04 June 2019 17:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: fail2ban/domoticz

Post by miralant »

Iptables is kernel function. How check if it runs ? (Currently nothing in top)
User avatar
jvdz
Posts: 2336
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: fail2ban/domoticz

Post by jvdz »

You can show the current active jails:
sudo iptables -L -n

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
miralant
Posts: 5
Joined: Tuesday 04 June 2019 17:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: fail2ban/domoticz

Post by miralant »

Nothing on my jails...what should I have ?

root@raspberrypi:/home/ced# sudo iptables -L -n
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

I have the same return on Ubuntu server and SFTP jaiks is triggered.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest