Topic: Fail2Ban 'X-Forwarded-For' doesn't block?
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.6.6
- Deployed with iRedMail downloadable installer
- Linux/BSD distribution name and version: ubuntu 22.04.1
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Hi,
can find this logged (without timestamps):
/var/log/mail.log
...
mail roundcube: <qvbo6vad> Failed login for user from 10.200.0.2 (X-Forwarded-For: 77.91.85.107) in session qvbo6vadvjbd34mg (error: 0)
mail roundcube: <qvbo6vad> IMAP Error: Login failed for user@mydomain.com against 127.0.0.1 from 10.200.0.2 (X-Forwarded-For: 77.91.85.107). AUTHENTICATE LOGIN: A0002 NO [AUTHENTICATIONFAILED] Authentication failed. in /opt/www/roundcubemail-1.6.3/program/lib/Roundcube/rcube_imap.php on line 211 (POST /mail/?_task=login&_action=login)
...
/var/log/fail2ban.log
...
mail fail2ban.filter[291178]: INFO [dovecot] Ignore 127.0.0.1 by ignoreself rule
mail fail2ban.filter[291178]: INFO [roundcube] Found 77.91.85.107 - 2023-10-23 22:50:00
mail fail2ban.filter[291178]: INFO [dovecot] Ignore 127.0.0.1 by ignoreself rule
mail fail2ban.filter[291178]: INFO [roundcube] Found 77.91.85.107 - 2023-10-23 22:50:12
mail fail2ban.actions[291178]: NOTICE [roundcube] Ban 77.91.85.107
mail fail2ban.filter[291178]: INFO [dovecot] Ignore 127.0.0.1 by ignoreself rule
mail fail2ban.filter[291178]: INFO [roundcube] Found 77.91.85.107 - 2023-10-23 22:50:25
...
mail fail2ban.filter[291178]: INFO [dovecot] Ignore 127.0.0.1 by ignoreself rule
mail fail2ban.filter[291178]: INFO [roundcube] Found 77.91.85.107 - 2023-10-23 22:52:09
mail fail2ban.actions[291178]: WARNING [roundcube] 77.91.85.107 already banned
mail fail2ban.filter[291178]: INFO [dovecot] Ignore 127.0.0.1 by ignoreself rule
mail fail2ban.filter[291178]: INFO [roundcube] Found 77.91.85.107 - 2023-10-23 22:52:24
...
Rule is in place:
# nft list ruleset
...
set addr-set-roundcube {
type ipv4_addr
elements = { 77.91.85.107 }
...
But Roundcube is still accessible...
Any hints for me here?
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.