Недавно обнаружил, что на двух почтовых серверах Kerio Connect в логах Security присутствуют многочисленные попытки подбора паролей. Сервера работают по Ubuntu, так почему бы не прикрутить fail2ban. Как оказалось, все довольно просто, fail2ban умеет работать с логами Kerio.
nano /etc/fail2ban/jail.conf
[kerio]
enabled = true
filter = kerio
port = imap,smtp,imaps,465,587
logpath = /opt/kerio/mailserver/store/logs/security.log
bantime = 14400
findtime = 20m
maxretry = 5
protocol = tcp
В результате, если кто-то в течении 20 минут (findtime = 20m) вводит неверный пароль 5 раз (maxretry = 5), он получает бан на 4 часа (bantime = 14400).

Если видите, что атака идет из какого-то странного места (Иран, например), заблокируйте всю подсеть в iptables и спите спокойно.
iptables -t filter -A INPUT -s 45.142.120.0/24 -j DROP
Настройка fail2ban для Kerio Connect
Здравствуйте!
Пишу вам по поводу вашего сайта admin812.ru.
Хотел бы предложить сотрудничество или размещение тематического материала. Если вам это интересно, просто ответьте на это письмо — обсудим детали.
Если сообщение неактуально, прошу прощения за беспокойство.
С уважением,
Joanne Fredrickson alextrone83@gmail.com
We built Vantovo around one idea: traffic should already be interested before it ever hits your site. Our AI scans, matches, and routes visitors from a massive partner network, and every outcome trains it to do it even better tomorrow. Try it free for a week.
Get more information here:https://da.gd/Fo5X7h
Tired of traffic sources that feel random or outdated? Switch to an AI system that matches visitors to your keywords and locations in real time and improves daily. Try it free for 7 days. Cancel anytime. No contracts.
https://spoo.me/fUMM34H