Page 1 of 1

Fail2Ban and CMSMS

Posted: Sat Jul 23, 2022 10:45 am
by jackstringer
Anyone willing to share the jail and filter settings for Fail2Ban and CMSMS?

Have just updated my VPS and would like to add a jail etc to protect the login for CMSMS. I have done this before but I failed to keep my notes on it and REGEX just makes my brain bleed at times.

Re: Fail2Ban and CMSMS

Posted: Sun Sep 04, 2022 4:19 pm
by velden
In our #cms channel in Slack I once posted a simple UDT to get the failed logins logged in the error_log.
The needed regex for Fail2Ban hasn't been shared unfortunately that time.
...
But you can create a udt to do so and attach it to the LoginFailed event

Code: Select all

error_log('CMSMSLOGINFAILED ' . \cms_utils::get_real_ip());
Result in the error log:

Code: Select all

[02-Nov-2020 21:22:21 Europe/Amsterdam] CMSMSLOGINFAILED xx.xx.7.112

Re: Fail2Ban and CMSMS

Posted: Sun Sep 04, 2022 7:13 pm
by jackstringer
I haven't tested it much yet but a filter of CMSMSLOGINFAILED might be enough.