I plan on buying a server soon. I'd like the server to be as secure as possible, only having POP3, SMTP, SSH and HTTP open. I know how to write an iptables script to only allow those connections and drop everything else, but I have no clue how to prevent attacks.
Is there any example scripts out there that cater for as many different attacks as possible (block and optionally log)? A script that will stop DDoS attacks (SYN floods, ICMP floods, etc), port scans, brute force attacks, etc. Everything (or as close to it as we can get)