dump APF and BFD - these are outdated scripts.
Download CSF from
www.configserver.com. You can ratelimit the number of connections allowed etc. We stand by this script on hundreds of our servers.
We set our limits at 5 seccessive login failures, and it then temporarily blocks the IP number for 15 minutes (long enough for most Bruteforce attempts to move to a new server). If they get temporary blocked 4 times in a row, it permanently blocks the IP from further accesses to the server in question.