Blame README.SELinux

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