LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   [apache] Chroot or mod_security? (https://www.linuxquestions.org/questions/linux-security-4/%5Bapache%5D-chroot-or-mod_security-504888/)

JockVSJock 11-25-2006 09:29 PM

[apache] Chroot or mod_security?
 
Doing more learning on security for Apache, and have been reading up securing a box that is running Apache for a web server.

There seems to be two ways to secure it: Chroot and mod_security

I've noticed that Chroot is alot of steps but there is plenty of documentation, via Google.

While researching Chroot, I found an Apache module called mod_security and of course web documentation:

http://www.modsecurity.org/
http://www.onlamp.com/pub/a/apache/2..._security.html

What are most people doing to secure their Apache web server?

What are the pros/cons of Chroot Vs mod_security?

thanks

hob 11-26-2006 03:49 AM

I hadn't looked at mod_security before, but it appears to do something totally different to chroot. With chroot you construct a restricted environment to run the chosen software in, and the rest of the system is "invisible" to the application.

This is time-consuming to setup, and the restricted application can escape the chroot if it gets root privileges. It's probably better to use SELinux, which is the default for current releases of Fedora Core and RHEL. On an SELinux system every secured service is effectively under chroot, because the SELinux policy absolutely prevents them from accessing other parts of the system. People complain about SELinux because it is *too* effective at restricting unsafe behavior out-of-the-box :).

My personal Web server runs an older distro, and I opted for a low-maintenance approach: it runs the AIDE intrusion detection system so that I can see if a change occurs which I didn't make myself, and I set the security options in PHP to restrict the one remaining PHP application that I use. Long-term I'll migrate from that application to a Rails equivalent, turn off PHP altogether, and switch from Apache to lighttpd. One of the advertised features of lighttpd is that it chroots well.


All times are GMT -5. The time now is 01:03 PM.