Originally posted by: Crusty
Originally posted by: n0cmonkey
Originally posted by: Crusty
My rules automatically add IPs that it detects trying to brute force through ssh(which rarely happens on non-standard ports), but there are various other scripts that help automate IP blocking like CSF or BFD. Not like it matters anyways now with a VPN to the private networks in the datacenters, no more public facing SSH ftw
I personally use a series txt file list of IP/network addresses to block and my iptables startup script just loops the IPs and adds a rule for each item. While you can't use wildcards you can certainly use network addresses to block whole subnets.
And that seems dirty. It has got to make troubleshooting difficult if you have thousands of block rules in there. I've got 20 rules in my (admittedly open) ruleset. Seems nicer some how.
I don't automatically block SSH at home because I make too many mistakes. I hate locking myself out.
For the most part my rules are pretty clean, I'll only load the mass blockings if we're having particular trouble with a server. Usually that includes a blanket block of China, Korea, and Taiwan plus a few others

. I've found that if you present a small footprint to the outside world people generally leave you alone because their scripts are too stupid to try ssh on a port other then 22 or their port scanner can't figure out what ports I've actually got open.
For a generic web/ftp/mail server I've got no more then 15 rules per chain, in fact I just checked one production box and it's got 0 IPs listed as flat out blocked atm but that could change