Web login fail2ban jail - working

Fabiano Gastaldi2 years ago

Hi, i create the working jail and filter for fail2ban and traccar web login using debian 11/iptables/traccar 5.3
steps:

1 - Add new lines in /etc/fail2ban/jail.local:

[traccar-web-login]
port	 = 8082
enabled	 = true
filter   = traccar-web-login
logpath  = /opt/traccar/logs/tracker-server.log
maxretry = 10

2 - Create filter file: "/etc/fail2ban/filter.d/traccar-web-login.conf"

# Fail2Ban traccar filter
[Definition]
failregex   = INFO: login failed.* <HOST>
ignoreregex = 

# Author: Fabiano Gastaldi - ® BetaSete Tecnologia

3 - Restart fail2ban service:

sudo service fail2ban restart
dagobar2 years ago

First thanks for the info, it's useful for me.

Also:

  1. You have to enable logging level info.
  2. The amount of log data for info level sent to the log file is huge !
    Be prepared related to storage space, IO speed, CPU, e.t.c.

Is there an other (better) way ?

To the development team:
Maybe a new setting for login/logout for logging to a different log file to enable/disable it could be useful to protect Traccar with Fail2ban.