Ask HN: Best Server Hardening Guide?

30 points by Kinnard ↗ HN
What are the best server hardening guides?

10 comments

[ 3.0 ms ] story [ 28.0 ms ] thread
(1) sudo netstat -tanp | grep LISTEN

(2) For anything not listening to 127.0.0.1: what is it and do you need it?

(3) If answer to #2 is "dunno" or "no," turn it off.

:)

Surprised HN doesn't have more advice on this.
stay away from ufw and stick with iptables. I had some ufw stuff fail on me and I discovered when I logged in that everything was open again.
One quick note - You probably shouldn't be performing your server hardening manually on each server. It's easy to miss things.

I'd suggest using an ansible/chef/puppet/whatever script, that you customize to meet the needs of your particular application.

Some simple ones you could start with are available at http://tinyurl.com/AnsibleFirst5 and/or http://hardening.io/

Expand to add additional configuration and hardening for your particular infrastructure.