Mod_Security install?

yes indeed. And not being experienced (i guess there are many others out there) and not knowing about open_basedir, the default install let’s that of course wide open.

Im wondering if this could be set somehow during an installation (at least have ${HOME} in it) or give a warning when the field in the template is left blank.
This setting can also be done afterwards through the server template "PHP configuration variables for scripts" in the Pro version.

Also enable_dl must be set to Off else a user can upload and execute any module and without open_basedir set I don’t want to think of the consequences :).

I’m just saying, if talking about security then lets presume system admins are not experienced at all. I’m guessing there must be many current resellers who upgrade themselfs to “webhosts” and as you say: a system is as safe as the admin running it.

If you edit function.les find secure_prof

Then just look how its setting the +i and you can add your own paths to set in there.

Like mine I added… for the +i

[code:1]eout "{sec.profile} chattr $ECHA $HOME/$pusr/etc/php*/php.ini"
chattr $ECHA $HOME/$pusr/etc/php*/php.ini >> /dev/null 2>&1
eout "{sec.profile} chattr $ECHA $HOME/$pusr/domains//etc/php/php.ini"
chattr $ECHA $HOME/$pusr/domains//etc/php/php.ini >> /dev/null 2>&1
[/code:1]

Then for the -i…

[code:1]
eout "{sec.profile} chattr $ECHA $HOME/$pusr/etc/php*/php.ini"
chattr $DCHA $HOME/$pusr/etc/php*/php.ini >> /dev/null 2>&1
eout "{sec.profile} chattr $ECHA $HOME/$pusr/domains//etc/php/php.ini"
chattr $DCHA $HOME/$pusr/domains//etc/php/php.ini >> /dev/null 2>&1
[/code:1]

Then when you run les --secure-prof 1 you get something like…

[code:1]
Jun 13 15:04:40 spock les(28439): {sec.profile} chmod 644 /home/totalcompsystem/.bash_profile
Jun 13 15:04:40 spock les(28439): {sec.profile} chattr +i /home/totalcompsystem/.bash_profile
Jun 13 15:04:40 spock les(28439): {sec.profile} chattr +i /home/totalcompsystem/etc/php*/php.ini
Jun 13 15:04:40 spock les(28439): {sec.profile} chattr +i /home/totalcompsystem/domains//etc/php/php.ini
Jun 13 15:04:40 spock les(28439): {sec.profile} chmod 644 /home/totalcompsystem/.bashrc
Jun 13 15:04:40 spock les(28439): {sec.profile} chattr +i /home/totalcompsystem/.bashrc
Jun 13 15:04:40 spock les(28439): {sec.profile} chattr +i /home/totalcompsystem/etc/php*/php.ini
Jun 13 15:04:40 spock les(28439): {sec.profile} chattr +i /home/totalcompsystem/domains//etc/php/php.ini
Jun 13 15:04:40 spock les(28439): {sec.profile} chmod 644 /home/totalcompsystem/.bash_logout
Jun 13 15:04:40 spock les(28439): {sec.profile} chattr +i /home/totalcompsystem/.bash_logout
Jun 13 15:04:40 spock les(28439): {sec.profile} chattr +i /home/totalcompsystem/etc/php*/php.ini
Jun 13 15:04:40 spock les(28439): {sec.profile} chattr +i /home/totalcompsystem/domains//etc/php/php.ini
[/code:1]

Then to check to make sure +i was set you do lsattr /home/totalcompsystem/*/

And you get something like…

[code:1]
----i------------- /home/totalcompsystem/cgi-bin/php5.cgi
----i------------- /home/totalcompsystem/cgi-bin/php4.cgi
----i------------- /home/totalcompsystem/etc/php.ini
----i------------- /home/totalcompsystem/fcgi-bin/php5.fcgi
[/code:1]

Aint that neat ?

Scott,

You said:

“what I did was create a new user group called ‘hosting’ and went though all the ACL’s for each module and disabled or enforced what they could do in them.”

I can see one can do this for a group in file manager settings for the group, but, can’t figure out what to put in the box that says “ONLY ALLOW ACCESS TO DIRECTORIES”. Without this box, the user can get anywhere in file manager.

2 years later, is this still the best way to install mod_security?

thanks

Howdy,

This is a long thread – what way are you looking at for installing mod_security, and on what distro? :slight_smile:

It does typically need to be manually downloaded and installed though, there aren’t packages for it in the default repositories for most distros.

-Eric

CentOS 5.4. Need to protect against automated blanket attacks and integrate with CSF to block those automated attacks.

Thanks Eric.

Yeah, CentOS definitely doesn’t have mod_security in it’s repository. Installing manually by downloading it from the mod_security site and following their instructions is a common way to do that.

I think there are third party repositories that package mod_security and make it simpler to install, but I’m not familiar with any of them… I’d certainly suggest caution in what repositories you enable, as some can cause problems of various sorts. But if you run into one you trust that provides mod_security, that may save you some time :slight_smile:

-Eric

I trust Atomic Rocket Turtle.

http://downloads.prometheus-group.com/delayed/rules/

Thanks

–Deleted–