For a couple of months, we've noticed brute force attack attempts at our website.
The attacker launches several login attempts from a wide range of IPs (maybe from a botnet) and multiple usernames and passwords. Some of the usernames does not exist in our database, some other yes. So my guess is that they are trying with known pwned email accounts.
We need to prevent those attacks, due to our database server rises the CPU usage. So, our options (after reading other answers) are:
- Blocking accounts after X number of failed login attempts
- Adding a captcha after X number of failed login attempts
- Blocking IPs
However, I think that these options won't fix the issue, due to they try with multiple usernames and IPs.
Our stack is a Debian server with Apache and PHP.
Is there any effective way to avoid this?