-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add log line for failed authentication attempts #1187
Conversation
Even if you just put the fail2ban configuration in here, that will be useful to someone. |
Small tutorial, first installs fail2ban. Edit Fail2Ban jail.local to:
Now we need to create the postal-smtp filter in /etc/fail2ban/filter.d, name is postal-smtp.conf:
To have a persist Ban, create a file called recidive.conf in /etc/fail2ban/jail.d:
|
I followed this and got applied no problem, but I was tailing the log and wasn't seeing any IPs being banned: [smtp.1:2224] [2020-09-20T12:35:12.825] DEBUG -- : [TOUFKG] Connection opened from ::ffff:212.70.149.20 |
@sergioloera the configuration is to ban after 5 failed attempts in one day so someone will need to reach that amount of failed attempts before you see any banning |
its work for me, thanks
|
Any idea how to use this with the new containerized setup of v2.0? |
Hi, I made a small tutorial on how to achieve this with Ubuntu Server 22.04.1 and Postal v2.11.2. |
This PR fixes #1182. In short, programs such as fail2ban rely on logs with events and IP addresses. This extra log entry makes it much easier to implement a regex for fail2ban.
I'm now working on a proper fail2ban jail configuration, I can commit that too if desired.