Blame SOURCES/mod_fcgid-2.1-README.SELinux

fdb13c
Using mod_fcgid with SELinux in Fedora Core 5 / RHEL 5 onwards
fdb13c
==============================================================
fdb13c
fdb13c
Versions of this package built for Fedora Core 5, 6, or 7 include an SELinux
fdb13c
policy module to support FastCGI applications. Later Fedora releases and Red
fdb13c
Hat Enterprise Linux 5.3 onwards include the policy in the main selinux-policy
fdb13c
package and do not require the separate module.
fdb13c
fdb13c
The module source (fastcgi.{fc,te}) is included for reference as documentation
fdb13c
in the package.
fdb13c
fdb13c
The module uses the same set of SELinux types for FastCGI applications as for
fdb13c
regular CGI scripts (or "system scripts" as they are known in SELinux), as
fdb13c
described in "man httpd_selinux".
fdb13c
fdb13c
 * httpd_sys_content_t
fdb13c
 - Set files with httpd_sys_content_t for content that is available
fdb13c
   from all FastCGI scripts and the daemon.
fdb13c
fdb13c
 * httpd_sys_script_exec_t
fdb13c
 - Set FastCGI scripts with httpd_sys_script_exec_t to allow them to run
fdb13c
   with access to all system script types.
fdb13c
fdb13c
 * httpd_sys_script_ro_t
fdb13c
 - Set files with httpd_sys_script_ro_t if you want httpd_sys_script_exec_t
fdb13c
   scripts to read but not write the data, and disallow other processes from
fdb13c
   access.
fdb13c
fdb13c
 * httpd_sys_script_rw_t
fdb13c
 - Set files with httpd_sys_script_rw_t if you want httpd_sys_script_exec_t
fdb13c
   scripts to read/write the data, and disallow other processes from access.
fdb13c
fdb13c
 * httpd_sys_script_ra_t
fdb13c
 - Set files with httpd_sys_script_ra_t if you want httpd_sys_script_exec_t
fdb13c
   scripts to read/append to the file, and disallow other processes from
fdb13c
   access.
fdb13c
fdb13c
So for the moin wiki layout described in README.RPM of the main mod_fcgid
fdb13c
package, the contexts would be set as follows:
fdb13c
fdb13c
    cd /var/www/mywiki
fdb13c
    chcon -t httpd_sys_content_t .
fdb13c
    chcon -R -t httpd_sys_script_exec_t cgi-bin
fdb13c
    chcon -R -t httpd_sys_script_rw_t data underlay
fdb13c
fdb13c
It is necessary to turn on the httpd_enable_cgi boolean to run either regular
fdb13c
or FastCGI scripts:
fdb13c
fdb13c
    setsebool -P httpd_enable_cgi 1
fdb13c
fdb13c
The httpd_can_sendmail boolean is used to specify whether any of your
fdb13c
web applications can make outbound SMTP connections (e.g. moin sending
fdb13c
notifications). By default it is off, but can be enabled as follows:
fdb13c
fdb13c
    setsebool -P httpd_can_sendmail 1
fdb13c
fdb13c
Only enable this functionality if you actually need it, since it increases the
fdb13c
chances that any vulnerability in any of your web applications could be
fdb13c
exploited by a spammer.
fdb13c
fdb13c
If you have any questions or issues regarding FastCGI and SELinux, please don't
fdb13c
hesitate to bring them up on fedora-selinux-list.
fdb13c