httpd_selinux | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
NAME | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
DESCRIPTION | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
FILE_CONTEXTS | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
The following file contexts types are defined for httpd:
httpd_sys_content_t- Set files with httpd_sys_content_t for content which is available from all httpd sys scripts and the daemon.
httpd_sys_script_exec_t- Set cgi scripts with httpd_sys_script_exec_t to allow them to run with access to all sys types.
httpd_sys_content_rw_t- Set files with httpd_sys_content_rw_t if you want httpd_sys_script_exec_t scripts to read/write the data, and disallow other non sys scripts from access.
httpd_sys_content_ra_t- Set files with httpd_sys_content_ra_t if you want httpd_sys_script_exec_t scripts to read/append to the file, and disallow other non sys scripts from access.
httpd_unconfined_script_exec_t- Set cgi scripts with httpd_unconfined_script_exec_t to allow them to run without any SELinux protection. This should only be used for a very complex httpd scripts, after exhausting all other options. It is better to use this script rather than turning off SELinux protection for httpd.
NOTE | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
SHARING FILES | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
setsebool -P allow_httpd_anon_write=1
or
setsebool -P allow_httpd_sys_script_anon_write=1
BOOLEANS | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
httpd can be setup to allow cgi scripts to be executed, set httpd_enable_cgi to allow this
setsebool -P httpd_enable_cgi 1
httpd by default is not allowed to access users home directories. If you want to allow access to users home directories you need to set the httpd_enable_homedirs boolean and change the context of the files that you want people to access off the home dir.
setsebool -P httpd_enable_homedirs 1 chcon -R -t httpd_sys_content_t ~user/public_html
httpd by default is not allowed access to the controling terminal. In most cases this is prefered, because an intruder might be able to use the access to the terminal to gain privileges. But in certain situations httpd needs to prompt for a password to open a certificate file, in these cases, terminal access is required. Set the httpd_tty_comm boolean to allow terminal access.
setsebool -P httpd_tty_comm 1
httpd can be configured to not differentiate file controls based on context, i.e. all files labeled as httpd context can be read/write/execute. Setting this boolean to false allows you to setup the security policy such that one httpd service can not interfere with another.
setsebool -P httpd_unified 0
httpd can be configured to turn on sending email. By default http is not allowed to send mail. This is a security feature, since it would prevent a vulnerabiltiy in http from causing a spam attack. I certain situations, you may want http modules to send mail. You can turn on the httpd_send_mail boolean.
setsebool -P httpd_can_sendmail 1 httpd can be configured to turn off internal scripting (PHP). PHP and other loadable modules run under the same context as httpd. Therefore several policy rules allow httpd greater access to the system then is needed if you only use external cgi scripts. setsebool -P httpd_builtin_scripting 0
httpd scripts by default are not allowed to connect out to the network. This would prevent a hacker from breaking into you httpd server and attacking other machines. If you need scripts to be able to connect you can set the httpd_can_network_connect boolean on.
setsebool -P httpd_can_network_connect 1
system-config-selinux is a GUI tool available to customize SELinux policy settings.
SEE ALSO | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
Sommaire | Début | Suivant | Sommaire | Préc.page.lue | Accueil |