Log failed logins in Piwigo
This plugin is an adaption of the plugin Log Failed Logins by Tomas Sobek.
This plugin writes all failed login attempts into a text file, one line for each failed attempt. The intended purpose of the logfile is to be used with fail2ban. The format of the log looks like this:
2022/11/01 09:43:44 ip=192.168.254.1 username=Admin
Download the code and place it in a subfolder named piwigo_failed_logins of the Piwigo plugin directory. The plugin should now be visible in the Piwigo Admin Plugin section.
On the settings page of the plugin, add the path to the config file in the form at the botton, and save. Make sure that Piwigo has write access to the file.
In your /etc/fail2ban/jail.local:
[piwigo]
enabled = true
port = http,https
filter = piwigo
logpath = <<path to your failed login file>>
Create new filter /etc/fail2ban/filter.d/piwigo.conf with following content:
[INCLUDES]
before = common.conf
[Definition]
failregex = ip=<HOST>
ignoreregex =
If you like this plugin, you can Buy me a coffee.