![]() |
Hardening the system without breaking ISPConfig
First of all, I'll list what I want to do and proceed with the issues I've encountered.
Needs: - Prevent users from reading eachothers directories and subdirectories. <- Is this solvable without implementing ssh chroot? - Diskquotas reportable by "quota" Tests: chmod 711 /var/www/web* <- will prevent people from listing the initial subdirectories however it will not prevent people to pry into subdirectories with lax chmod like 755 etc. chmod 700 /var/www/web* <- will do some extra work but will prevent apache from displaying the sites. Setting either of these chmod's will break ispconfig's ability to see disk statistics for the users. Even if the sudo option for du is activated in ispconfig's configuration-file. Also if quota is activated on the system it doesnt seem to use diskquotas for the users? how so? |
Quote:
su admispconfig sudo du -h --max-depth=1 /home/www/web1 Quote:
|
Hardening ISPConfig
Hi Till and Falko,
We're very happy with ISPConfig, and would like to thank you guys for making it available to us! At this point, we are keen to "harden" our servers running ISPConfig and would like to do, as Norman suggests, a chmod 750 on /home/www/* to prevent other clients (and their users) from accessing any other client directory... As Norman points out, however, this breaks access for Apache (running as user www-data on our Ubuntu system). We notice that any new web?? group automatically includes the admispconfig user - how could we also automatically include the user www-data? We've grepped the ISPConfig code looking for hints, but haven't found the right place... Any suggestions would be greatly appreciated. Kind regards, Dave |
The admispconfig user is added to the group of the web in line 1101 in the file /root/ispconfig/scripts/config.lib.php
|
anyone tried using bastille for hardening?
|
Bastille hardening
Hi Tenaka,
Yesterday we installed Bastille on our Ubuntu server (via APT) in addition to the Bastille firewall provided by ISPConfig. We configured it for everything but the firewall - but as yet, we haven't applied stricter permissions (via the umask) on the user directories yet as doing so would block the webserver from serving up user web accounts... Fixing that requires a minor hack on ISPConfig to ensure that the Apache user (in our case www-data) is included in each customer group. We're working on that. Cheers, Dave |
Right - applied a minor hack to ISPConfig (version 2.2.2) see below for diff - to add the Webserver user (in our case on Ubuntu Dapper Linux it's "www-data") to each web?? customer's default group, and also to create new users in our web directory (in our case /home/www) with permissions 750 rather than the default 755 (which allows users of any customer to look into any other customer's web directories and read email, database passwords, etc. - NOT GOOD).
To apply this fix retroactively, go into your web root directory and run the following (note - DON'T use the -R flag, as that will screw things up big time) - assuming you're using web? or web?? to designate your web customers: Code:
chmod 750 web?? web?Code:
/etc/init.d/apache2 restartAt this stage, I'm not aware of any problems with this solution - seems to work well - but it might have implications on quota management or other ISPConfig maintenance task - not sure. Here's the diff for /root/ispconfig/scripts/lib/config.lib.php that makes it all happen. Code:
Index: config.lib.phpKind regards, Dave |
Quote:
|
admispconfig
thanks for this Dave.
One thing that might be of interest is that at least here /home/admispconfig is (was) world readable. |
Quote:
|
| All times are GMT +2. The time now is 08:15. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.