Skip to contentSkip to conversation

apache tunables

DISCUSSION Russell Coker 1 participant 1 message Jun 14, 2004 SELinux security module

lore
Share & tools
lore
#0 lore raw

I think that the following are good candidates for Apache tunables:

Whether to have system cgi-bin scripts.

Whether to have user cgi-bin scripts.

Whether to have user cgi-bin script read access to regular files in user home directory.

Whether to have user cgi-bin script read/write access to regular files in user home directory.

Whether to allow httpd_t and cgi-bin scripts to connect to databases and LDAP servers (for both PHP and cgi-bin access). Should we have one tunable for everything or one for each database? One for everything is a lot easier to manage as we don't want to ask 1000 questions of the user.

Maybe allow some of these cgi-bin options on a per-user basis, EG allow httpd_dba_script_t access to databases but not httpd_user_script_t. This will require more fancy M4 programming.

A more controversial issue is whether user cgi-bin script runs as user_t (or whichever userdomain is appropriate) instead of a special script domain, not something we really want to support, but the users will be happy. NB for the targetted policy, if we have Apache as a target then user cgi-bin scripts would be run as unconfined_t if this option is selected. :(

A bad option that we need to have is to run system cgi-bin scripts as sysadm_t or unconfined_t.

Are there any other possible tunables I missed?

Anther Apache related issue is testing of cgi-bin scripts, what domain should we run them in for testing? Currently we default to having a domain_auto_trans() rule to run the script in the same domain regardless of whether it's started by the user or by Apache. The problem is that when started by the user it can't access a pty device (otherwise the script when started by Apache could use character stuffing to take over a live user session if the script is buggy). /dev/tty access is allowed but the script would need stdin/stdout/stderr redirected to that (and I'm not sure it's safe when /dev/tty maps to the /dev/pty entry for a live user session). Maybe the correct solution to this is to have a program similar in concept to run_init for testing user cgi-bin scripts. If it allowed simulating the Apache environment (passing parameters etc) then it could be well accepted by the users. There's probably some program out there which does everything that's needed apart from the SE Linux stuff which can be modified to do what we want (using /dev/tty is not the right thing for a cgi-bin script to do anyway).

Finally there's the issue of non-sysadm administration of daemons. I have been talking about doing this for quite a long time, and Apache might be a good first test case.

Signature · 9 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.