fail2ban Setup — Brute Force Protection
7 reviewsfail2ban configured and — crucially — verified to actually ban: SSH, admin login, scanner bursts, whitelists and a deliberate test. From 800 UAH.
Service
fail2ban setup — brute force protection
Any server with SSH exposed receives hundreds of login attempts a day — that is the background noise of the internet. The same applies to site admin panels. Fail2ban reads the logs and temporarily blocks addresses producing failed attempts.
What I configure
- SSH protection — the baseline and most important scenario;
- protection of the site admin against password guessing;
- a response to error bursts from a single address: path scanning, exploitation attempts;
- ban parameters: how many attempts, over what window, for how long;
- a whitelist — so you do not lock yourself or required services out;
- verification that the rules genuinely fire rather than merely existing in the configuration.
The most common problem
Fail2ban is installed but does nothing. The causes are predictable: the service reads the wrong log file, the entry format does not match the pattern, or the rules are created but never applied because of a conflict with another firewall. Everything looks healthy from outside, and no bans happen.
So configuration ends with a test: we deliberately make a few failed attempts and confirm the address was actually banned.
What to keep in mind
Fail2ban protects against brute force, but not against an attack from a thousand addresses at once, and not against a vulnerability in the code. It is one layer of defence, not a substitute for updates and decent passwords.
Before and after
- SSH and the site admin get hundreds of password-guessing attempts every day
- Path scanning and exploitation attempts from a single address go unchecked
- An installed fail2ban bans nothing: it reads the wrong log or its rules never apply
- SSH and the site admin protected; a response set up for error bursts from a single address
- Attempt count, time window and ban length set; your addresses and required services whitelisted
- Tested in practice: after a few failed attempts the address really does get banned
Reviews (7)
4.0«Налаштування fail2ban — захист від брутфорсу» — саме те, що шукав. Боти перебирали пароль до SSH. Все протестували перед тим як віддати. Результатом повністю задоволений.
Користувався послугою «Налаштування fail2ban — захист від брутфорсу»: брутфорсили адмінку магазину. Окремо порадували акуратністю в коді. Звернусь ще раз із наступними задачами.
Брав «Налаштування fail2ban — захист від брутфорсу» для свого проєкту. Хотів автоматичний бан порушників. Ціна відповідала обсягу, прихованих доплат не було. Магазин нарешті працює як треба.
Робили нам «Налаштування fail2ban — захист від брутфорсу» — хотів автоматичний бан порушників. Окремо порадували акуратністю в коді. Усе зробили в обумовлені строки, без зайвих питань. Тепер сплю спокійно за свій сайт.
Замовляв «Налаштування fail2ban — захист від брутфорсу» — боявся випадково забанити себе. Роботу здали з документацією і поясненнями. Усе зробили в обумовлені строки, без зайвих питань. Звернусь ще раз із наступними задачами.