This is how to use fail2ban to protect playSMS from invalid logins. Invalid logins can come from bots specifically programmed to guess playSMS passwords. Correctly configured fail2ban will ban/block/reject IP of users/attackers when playSMS got too many invalid logins in short period of time.
Please note that the actual ban is done by iptables, or whatever action command used by fail2ban.
Configure fail2ban correctly. There are several articles showing you how to do it. Usually the example is to protect SSH service from fail logins.
Visit this article for fail2ban installation:
Create new filter for fail2ban.
# Fail2Ban filter for playSMS # Detecting failed login attempts [Definition] failregex = auth_validate_login # invalid login .* ip:<HOST>$ ignoreregex = # End of filter
Enable the filter to get fail2ban watch over playSMS log files.
[playsms] enabled = true port = http,https filer = playsms logpath = /home/komodo/log/playsms/playsms.log /home/komodo/log/playsms.log /var/log/playsms/playsms.log /var/log/playsms.log
Monitor fail2ban log file:
tail -f /var/log/fail2ban.log
fail2ban log showing an IP banned:
2020-03-07 05:26:44,121 fail2ban.filter : INFO [playsms] Found 192.168.0.86 - 2020-03-07 05:26:43 2020-03-07 05:27:02,151 fail2ban.filter : INFO [playsms] Found 192.168.0.86 - 2020-03-07 05:27:02 2020-03-07 05:27:04,757 fail2ban.filter : INFO [playsms] Found 192.168.0.86 - 2020-03-07 05:27:04 2020-03-07 05:27:07,964 fail2ban.filter : INFO [playsms] Found 192.168.0.86 - 2020-03-07 05:27:07 2020-03-07 05:27:09,969 fail2ban.filter : INFO [playsms] Found 192.168.0.86 - 2020-03-07 05:27:09 2020-03-07 05:27:10,666 fail2ban.actions : NOTICE [playsms] Ban 192.168.0.86
Discuss this on playSMS Forum: https://forum.playsms.org/t/fail2ban-for-playsms/2746
Pingback: Install playSMS 1.4.3 on VirtualBox
Pingback: Install playSMS 1.4.3 on Ubuntu 18.04
Pingback: Install playSMS 1.4.3 on CentOS 7
Pingback: playSMS 1.4.3 on VirtualBox | My notebook
great project, I did installation as per your instructions, but getting “DB Error: not found” although DB created successfully but could not find solution in forums, can you share contact and help me solve the issue ?
I suggest you post question in forum, so I can respond with better answer. here is very limited
Pingback: playSMS 1.4.3 on Ubuntu 18.04 | My notebook
Pingback: playSMS 1.4.3 on CentOS 7 | My notebook