BookStack icon indicating copy to clipboard operation
BookStack copied to clipboard

Fail2ban Filter

Open wforumw opened this issue 3 years ago • 4 comments

Attempted Debugging

  • [X] I have read the debugging page

Searched GitHub Issues

  • [X] I have searched GitHub for the issue.

Describe the Scenario

I have followed the guidance on Failed Access Logging. And add LOG_FAILED_LOGIN_MESSAGE="Failed login for %u" into .env

I tried several regex but nothing worked. Anyone can help with setting up the required regex/config to get it working.

Many thanks Kind Regards

Exact BookStack Version

v23.08

Log Content

[Fri Sep 01 12:33:04.054291 2023] [php:notice] [pid 445356] [client x.x.x.x:58222] Failed login for [email protected], referer: https://bookstack.domain.com/login [Fri Sep 01 12:33:29.970870 2023] [php:notice] [pid 445358] [client x.x.x.x:60366] Failed login for [email protected], referer: https://boockstack.domain.com/login

PHP Version

8.1.22

Hosting Environment

Debian Bullseye

wforumw avatar Sep 01 '23 11:09 wforumw

Hi @wforumw, might be worth reading through #2440.

ssddanbrown avatar Sep 01 '23 11:09 ssddanbrown

Hi @wforumw, might be worth reading through #2440.

Txs, I did but it did not work for me, because the log sequence is different and I could not find a working solution

wforumw avatar Sep 01 '23 11:09 wforumw

@wforumw Can you post the fail2ban config files you've got so far? So I can try to see what might not be working.

ssddanbrown avatar Sep 01 '23 11:09 ssddanbrown

@ssddanbrown Txs for your reply

I did some more configs and the one who worked now is

datepattern = {^LN-BEG}(?:DAY )?MON Day %%k:Minute:Second(?:\.Microseconds)?(?: ExYear)?
failregex = .*client <HOST>.*Failed login from .*? 

I will close it Many thanks!!

wforumw avatar Sep 01 '23 13:09 wforumw