Ok this has been an issue that has been bugging me for a LONG time now. It's discussed here atomicorp.com • View topic - mod_security + mod_rewrite with strange behavior
Basically, if you're using modsec with a cpanel box and you have an account which has wordpress (with the default .htaccess incl. mod_rewrite rules in it) - mod_sec will not filter traffic for that account.
Why ? Because it appears that due to some weird way that cpanel loads apache modules .. mod_rewrite appears to take precedence and so cancels out mod_sec in some circumstances eg. default wordpress .htaccess mod_rewrite rules..
I've edited my httpd.conf and put the line Include "/usr/local/apache/conf/modsec2.conf" at the very top, hoping that this would fix it (by means of making modsec load FIRST before anything else) but it doesn't. So for some strange reason, if you have any accounts using mod_rewrite such as Wordpress, which is a FREQUENT hacking access point, you're in trouble even if you have modsec + good modsec rules installed.
Any help would be appreciated. I am certain that this is a cpanel specific issue (to do with apache module ordering/loading/config) because vanilla centos + apache + modsec does not have this issue at all..



LinkBack URL
About LinkBacks
Reply With Quote





