News for hackers. Stuff that matters.
Re:Brute.Fail Watch brute force attacks in real time by tredre3 on Friday June 02, 2023 @07:07PM (#36171980)
> This. I really do not understand why people use fail2ban when the threat is somewhere else.

Fail2ban keeps my log short enough that I can review them daily, I don't have to sift through thousands of login attempt.

> It won't stop a ddos but will certainly, at some point, prevent you from logging in.

Yup, losing my key and having no password access will do that.

Re:Brute.Fail Watch brute force attacks in real time by jrockway on Friday June 02, 2023 @07:42PM (#36172221)
I'm not sure manual log scanning is all that interesting. You probably want to produce a list of successful logins and review that regularly.
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.
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 smtplib

If 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

Re:Brute.Fail Watch brute force attacks in real time by BrandoElFollito on Saturday June 03, 2023 @05:28AM (#36175074)
I move my port to an uninteresting place and it considerably reduces the amount of logs. If this was a nuisance I would filter out the messages

> Yup, losing my key and having no password access will do that.

You can also lose your password. Or forget it if you know it by heart. But in any case you can use a password instead of a key - it just needs to be good enough (= long and not in cracking dictionaries)