Re:Brute.Fail Watch brute force attacks in real time
by wkat4242 on Friday June 02, 2023 @08:47PM
(#36172619)
If an attacker manages a succesful login you've already lost. Better to catch them in the act while they're scoping you out.
[ Parent
| on HN ]
Re:Brute.Fail Watch brute force attacks in real time
by jrockway on Friday June 02, 2023 @08:59PM
(#36172665)
If your SSH key leaks you're not going to have a warning. All you'll see is a login from yourself that you don't remember.
I am pretty sure we turned off password authentication like 10 posts up this thread.
Re:Brute.Fail Watch brute force attacks in real time
by elesiuta on Friday June 02, 2023 @11:26PM
(#36173407)
This is why I require both a private key and a password.
I have fail2ban configured to block IPs with invalid private keys after a couple attempts, and if the key is valid to email me and rate limit invalid password attempts.
This gives a more than sufficient warning if my key leaks which is already very unlikely, and this just makes it much more unlikely for both to be compromised, and only took an extra 5 minutes to configure.
Re:Brute.Fail Watch brute force attacks in real time
by phanimahesh on Saturday June 03, 2023 @04:34AM
(#36174821)
How do you configure emails on successful logins? Can you share your config, sufficiently anonymized?
Re:Brute.Fail Watch brute force attacks in real time
by elesiuta on Saturday June 03, 2023 @02:07PM
(#36178998)
I created a jail for fail2ban with
logpath = /var/log/auth.log
and for the filter I use failregex = .*Connection closed by authenticating user [a-z_]([a-z0-9_-]{0,31}|[a-z0-9_-]{0,30}\$) <HOST> port [0-9]* \[preauth\]
and the emails are just cron with a python script that checks /var/log/fail2ban.log for any new Found|Ban|Unban IPs and sends them using smtplibIf you like I can share the full config files but the rest isn't too interesting nor different from what is here https://www.fail2ban.org/wiki/index.php/MANUAL_0_8#Jails