CMSMS suitable for shared host environments?

General project discussion. NOT for help questions.
Post Reply
gearloss

CMSMS suitable for shared host environments?

Post by gearloss »

What is the CMSMS design philosophy regarding security and file permissions on a *nix file system?
And does that take into consideration whats required when using CMSMS in a shared host environment?

Let me explain what I mean by shared host environments:

Something like the type of account you get at Pair Networks (www.pair.com). A typical FreeBSD account on a machine you share with some 50-100 other users (who you don't know and can't trust).

In this kind of environment you want the following file permissions:

755 (user: rwx, group: r-x, other: r-x) for directories.
644 (user: rw-, group: r--, other: r--) for most files.
600 (user: rw-, group: ---, other: ---) for files with "secrets" like passwords and such.

User - the 'user' group consists only of the owner of the file (your account, in most cases)
Group - the 'group' group consists of the other users on the server
Other - the 'other' group consists of everyone else -- most importantly, the web server falls into the 'other' category.

This means you need to trick the webserver in a way that it will access files as 'user'. Since you can't fiddle with these things on a shared host (you are not root), there has to be another way to do it (let's assume all shared host environments handle that issue somehow, or they wouldn't be very useful). At Pair Networks the trick is to use a system CGI called "php-cgiwrap". See explanation here if you want the details:

  http://www.pair.com/support/knowledge_b ... iwrap.html

This requires a change to the .htacess file, to insert a few lines like this:
Note the exact mechanism varries with the host used, but this is how it would work at Pair Networks.

  Action application/x-pair-sphp4 /cgi-sys/php-cgiwrap/username/php4.cgi/users/
  AddType application/x-pair-sphp4 .php
  AddType application/x-pair-sphp4 .htm
  AddType application/x-pair-sphp4 .html


This will allow the webserver to access files as 'user' when parsing these filetypes through PHP.

Now the question is: does CMSMS (want to) support usage on a shared host like this?
Or what is the attitude/philosophy towards this issue?


I havn't seen this adressed in the documentation wiki in any detail. I have observed much different behavior from different modules with regards to file permissions. Things like upload of files in the file manager. And generation of Captchs images. And... This makes me wonder what the overall strategy is? - and what's being done to make the (module-) developers understand the importance?

The risks of not paying attention to file permissions on a shared host are very real:
  • Other users can read your database passwords etc. if you leave the config.php file with read-access for 'group' or 'other'.
  • Other users can erase files and write stuff into your web-directories if you open for write access for 'group' or 'other'.
Your comments and suggestions are much appreciated.
gearloss

Re: CMSMS suitable for shared host environments?

Post by gearloss »

Pair Networks is just one host - in business for 10+ years and hosting more than 190.000 websites. Fairly respectable. Not cheap. Very competent as well. I am sure other hosts solve the issues in other ways.

But the question remains - in that kind of environment (which is reality for a fair amount of accounts), what is the philosophy for CMSMS?

1) Don't care - find another host that has this and that setup (what are the requirements really?).

2) Want to support it, and here is the idea (haven't found it in the docs so far - hence the question)... Maybe we still have work to do in order to fully implement it, but it's on the list and part of the philosophy.

3) Does already support it, and here is how...

I do notice a few obvious attempts at doing something... there is a mask value you can set in the site admin screen. And something you can set in config.php.

As to the open_basedir suggestion - that really just applies to safe_mode on php installs right? And you can still cat another uses file in the shell - where php is not invoked at all anyways. And that's not something a user on a shared host can do/realistically influence, right?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: CMSMS suitable for shared host environments?

Post by Dr.CSS »

Shared hosting is fine for CMSMS, I have it... No problems so far 2 yrs....
gearloss

Re: CMSMS suitable for shared host environments?

Post by gearloss »

Not all shared hosts use cPanel - Pair does not - and my comments still holds.

If the persmission scheme is supported (as required for this style shared hosting), maybe show how it's done?
Post Reply

Return to “General Discussion”