The problem with your proposed solution is that I don't trust someone else's IP blacklist that I can't independently verify somehow.
Let's say a system exists where you can report to a common database servers that are running scripts trying to break into ssh with common usernames/passwords.
System admins submit parts of logs like /var/log/auth.log
:
Feb 4 09:15:04 quarkonia sshd[12414]: Invalid user webadmin from 129.2.145.XXX
Feb 4 09:15:04 quarkonia sshd[12414]: pam_unix(sshd:auth): check pass; user unknown
Feb 4 09:15:04 quarkonia sshd[12414]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=XXX.student.umd.edu
Feb 4 09:15:07 quarkonia sshd[12414]: Failed password for invalid user webadmin from 129.2.145.XXX port 39505 ssh2
and then the IP address 129.2.145.XXX gets added to the common blacklist. But it would be pretty trivial to submit fake logs with IP addresses of users you are trying to DoS; preventing legitimate users from logging using ssh to servers that subscribe to this blacklist.
This is slightly different than say reporting to doing a whois
on 129.2.145.XXX
OrgAbuseHandle: UARA-ARIN
OrgAbuseName: UMD Abuse Role Account
OrgAbusePhone: +1-301-405-8787
OrgAbuseEmail: [email protected]
OrgAbuseRef: http://whois.arin.net/rest/poc/UARA-ARIN
to find the abuse contact and say the IP address 129.2.145.XXX appears to run scripts that attempt to break into machines through ssh.
A system administrator can then look into the issue, possibly (a) finding a compromised system under the control of a remote hacker (and then remove the malware; e.g., reinstall the OS), (b) a script kiddie who doesn't know what they are doing trying to break into random sites (and threaten legal action to stop the kid) or (c) nothing after a quick investigation and ignore the false alarm.
There are blacklists of the IP address blocks assigned to countries where this stuff is more rampant (China, Russia, Nigeria, Eastern Europe) and that may never need to login to your server. Personally I'd run whois on all of them to double check, if you were to do this method; and make sure that its ok for your website/ssh server to block all traffic from those countries; and don't worry about the rare event of IP blocks getting reassigned to a different region.
But I just tend lock down number of AllowedUsers in ssh to one, change the ssh port (yes, security by obscurity) to something else under 1023 (so only root could control the port), prevent port scanning with a psad
, mitigated automated attacks with fail2ban
and using a complicated passphrase (normally through ssh key).