Security – Is iptables enough security, if port 80 is the only unblocked port and apache is setup correctly

firewallSecurity

We are using PHP,MySQL,SVN, and Apache. I want to know if I assume the local subnet trusted, and allow all ports on our subnet using iptables, then allow only port 80 as open to "anyone". If it is "good security" taking that the subnet is trusted as a premise. This is also assuming good PHP code etc, and that apache is configured correctly.

This is using CentOS 5.

Best Answer

No defiantly not. In fact port 80 is probably the most dangerous port you can open on a modern system. Also not having https:// (tcp 443) means all of your session id's are being leaked. Not using https is a clear violation of A3: "Broken authentication and session management" in the OWASP top 10 for 2010.

A good thing you can do to protect your self is to run a Web Application Firewall(WAF) like Mod_Secuirty. A WAF is is a very different from a "packet filter firewall" like iptables.

I also recommend running a vulnerability scan against your system such as Acunetix or wapiti. Make sure your system is regularly updated: yum upgrade. Run PhpSecInfo and configure your php.ini such that no RED appears. PHP's default config is horribly insecure, it has gotten better (disabling remote file includes and register_globals by default) but its still really bad.