Scroll to navigation

httpd_selinux(8) SELinux Policy httpd httpd_selinux(8)

NAME

httpd_selinux - Security Enhanced Linux Policy for the httpd processes

DESCRIPTION

Security-Enhanced Linux secures the httpd processes via flexible mandatory access control.

The httpd processes execute with the httpd_t SELinux type. You can check if you have these processes running by executing the ps command with the -Z qualifier.

For example:

ps -eZ | grep httpd_t

ENTRYPOINTS

The httpd_t SELinux type can be entered via the httpd_exec_t file type.

The default entrypoint paths for the httpd_t domain are the following:

/usr/sbin/httpd(.worker)?, /usr/sbin/apache(2)?, /usr/lib/apache-ssl/.+, /usr/sbin/apache-ssl(2)?, /usr/sbin/nginx, /usr/sbin/thttpd, /usr/sbin/php-fpm, /usr/sbin/cherokee, /usr/sbin/lighttpd, /usr/bin/mongrel_rails, /usr/sbin/htcacheclean

PROCESS TYPES

SELinux defines process types (domains) for each process running on the system

You can see the context of a process using the -Z option to ps

Policy governs the access confined processes have to files. SELinux httpd policy is very flexible allowing users to setup their httpd processes in as secure a method as possible.

The following process types are defined for httpd:

httpd_collectd_script_t, httpd_cvs_script_t, httpd_rotatelogs_t, httpd_bugzilla_script_t, httpd_smokeping_cgi_script_t, httpd_nagios_script_t, httpd_dirsrvadmin_script_t, httpd_suexec_t, httpd_php_t, httpd_w3c_validator_script_t, httpd_user_script_t, httpd_awstats_script_t, httpd_apcupsd_cgi_script_t, httpd_nutups_cgi_script_t, httpd_munin_script_t, httpd_openshift_script_t, httpd_sys_script_t, httpd_dspam_script_t, httpd_prewikka_script_t, httpd_git_script_t, httpd_unconfined_script_t, httpd_t, httpd_helper_t, httpd_squid_script_t, httpd_cobbler_script_t, httpd_mediawiki_script_t

Note: semanage permissive -a httpd_t can be used to make the process type httpd_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated.

BOOLEANS

SELinux policy is customizable based on least access required. httpd policy is extremely flexible and has several booleans that allow you to manipulate the policy and run httpd with the tightest access possible.

If you want to allow httpd to use built in scripting (usually php), you must turn on the httpd_builtin_scripting boolean. Enabled by default.

setsebool -P httpd_builtin_scripting 1

If you want to allow http daemon to check spam, you must turn on the httpd_can_check_spam boolean. Disabled by default.

setsebool -P httpd_can_check_spam 1

If you want to allow HTTPD scripts and modules to connect to the network using TCP, you must turn on the httpd_can_network_connect boolean. Disabled by default.

setsebool -P httpd_can_network_connect 1

If you want to allow HTTPD scripts and modules to connect to cobbler over the network, you must turn on the httpd_can_network_connect_cobbler boolean. Disabled by default.

setsebool -P httpd_can_network_connect_cobbler 1

If you want to allow HTTPD scripts and modules to connect to databases over the network, you must turn on the httpd_can_network_connect_db boolean. Disabled by default.

setsebool -P httpd_can_network_connect_db 1

If you want to allow httpd to connect to memcache server, you must turn on the httpd_can_network_memcache boolean. Disabled by default.

setsebool -P httpd_can_network_memcache 1

If you want to allow httpd to act as a relay, you must turn on the httpd_can_network_relay boolean. Disabled by default.

setsebool -P httpd_can_network_relay 1

If you want to allow http daemon to send mail, you must turn on the httpd_can_sendmail boolean. Disabled by default.

setsebool -P httpd_can_sendmail 1

If you want to allow Apache to communicate with avahi service via dbus, you must turn on the httpd_dbus_avahi boolean. Disabled by default.

setsebool -P httpd_dbus_avahi 1

If you want to allow Apache to communicate with sssd service via dbus, you must turn on the httpd_dbus_sssd boolean. Disabled by default.

setsebool -P httpd_dbus_sssd 1

If you want to allow httpd cgi support, you must turn on the httpd_enable_cgi boolean. Enabled by default.

setsebool -P httpd_enable_cgi 1

If you want to allow httpd to act as a FTP server by listening on the ftp port, you must turn on the httpd_enable_ftp_server boolean. Disabled by default.

setsebool -P httpd_enable_ftp_server 1

If you want to allow httpd to read home directories, you must turn on the httpd_enable_homedirs boolean. Disabled by default.

setsebool -P httpd_enable_homedirs 1

If you want to allow httpd scripts and modules execmem/execstack, you must turn on the httpd_execmem boolean. Disabled by default.

setsebool -P httpd_execmem 1

If you want to allow httpd processes to manage IPA content, you must turn on the httpd_manage_ipa boolean. Disabled by default.

setsebool -P httpd_manage_ipa 1

If you want to allow httpd to read user content, you must turn on the httpd_read_user_content boolean. Disabled by default.

setsebool -P httpd_read_user_content 1

If you want to allow Apache to run preupgrade, you must turn on the httpd_run_preupgrade boolean. Disabled by default.

setsebool -P httpd_run_preupgrade 1

If you want to allow Apache to run in stickshift mode, not transition to passenger, you must turn on the httpd_run_stickshift boolean. Disabled by default.

setsebool -P httpd_run_stickshift 1

If you want to allow HTTPD scripts and modules to server cobbler files, you must turn on the httpd_serve_cobbler_files boolean. Disabled by default.

setsebool -P httpd_serve_cobbler_files 1

If you want to allow httpd daemon to change system limits, you must turn on the httpd_setrlimit boolean. Disabled by default.

setsebool -P httpd_setrlimit 1

If you want to allow HTTPD to run SSI executables in the same domain as system CGI scripts, you must turn on the httpd_ssi_exec boolean. Disabled by default.

setsebool -P httpd_ssi_exec 1

If you want to allow Apache to execute tmp content, you must turn on the httpd_tmp_exec boolean. Disabled by default.

setsebool -P httpd_tmp_exec 1

If you want to unify HTTPD to communicate with the terminal. Needed for entering the passphrase for certificates at the terminal, you must turn on the httpd_tty_comm boolean. Disabled by default.

setsebool -P httpd_tty_comm 1

If you want to unify HTTPD handling of all content files, you must turn on the httpd_unified boolean. Disabled by default.

setsebool -P httpd_unified 1

If you want to allow httpd to access cifs file systems, you must turn on the httpd_use_cifs boolean. Disabled by default.

setsebool -P httpd_use_cifs 1

If you want to allow httpd to access FUSE file systems, you must turn on the httpd_use_fusefs boolean. Disabled by default.

setsebool -P httpd_use_fusefs 1

If you want to allow httpd to run gpg in gpg-web domain, you must turn on the httpd_use_gpg boolean. Disabled by default.

setsebool -P httpd_use_gpg 1

If you want to allow httpd to access nfs file systems, you must turn on the httpd_use_nfs boolean. Disabled by default.

setsebool -P httpd_use_nfs 1

If you want to allow Apache to query NS records, you must turn on the httpd_verify_dns boolean. Disabled by default.

setsebool -P httpd_verify_dns 1

If you want to allow all daemons to write corefiles to /, you must turn on the allow_daemons_dump_core boolean. Disabled by default.

setsebool -P allow_daemons_dump_core 1

If you want to allow all daemons to use tcp wrappers, you must turn on the allow_daemons_use_tcp_wrapper boolean. Disabled by default.

setsebool -P allow_daemons_use_tcp_wrapper 1

If you want to allow all daemons the ability to read/write terminals, you must turn on the allow_daemons_use_tty boolean. Disabled by default.

setsebool -P allow_daemons_use_tty 1

If you want to allow all domains to use other domains file descriptors, you must turn on the allow_domain_fd_use boolean. Enabled by default.

setsebool -P allow_domain_fd_use 1

If you want to allow Apache to use mod_auth_ntlm_winbind, you must turn on the allow_httpd_mod_auth_ntlm_winbind boolean. Disabled by default.

setsebool -P allow_httpd_mod_auth_ntlm_winbind 1

If you want to allow Apache to use mod_auth_pam, you must turn on the allow_httpd_mod_auth_pam boolean. Disabled by default.

setsebool -P allow_httpd_mod_auth_pam 1

If you want to allow confined applications to run with kerberos, you must turn on the allow_kerberos boolean. Enabled by default.

setsebool -P allow_kerberos 1

If you want to allow sysadm to debug or ptrace all processes, you must turn on the allow_ptrace boolean. Disabled by default.

setsebool -P allow_ptrace 1

If you want to allow system to run with NIS, you must turn on the allow_ypbind boolean. Disabled by default.

setsebool -P allow_ypbind 1

If you want to enable cluster mode for daemons, you must turn on the daemons_enable_cluster_mode boolean. Disabled by default.

setsebool -P daemons_enable_cluster_mode 1

If you want to allow all domains to have the kernel load modules, you must turn on the domain_kernel_load_modules boolean. Disabled by default.

setsebool -P domain_kernel_load_modules 1

If you want to allow all domains to execute in fips_mode, you must turn on the fips_mode boolean. Enabled by default.

setsebool -P fips_mode 1

If you want to determine whether Git system daemon can access cifs file systems, you must turn on the git_system_use_cifs boolean. Disabled by default.

setsebool -P git_system_use_cifs 1

If you want to determine whether Git system daemon can access nfs file systems, you must turn on the git_system_use_nfs boolean. Disabled by default.

setsebool -P git_system_use_nfs 1

If you want to enable reading of urandom for all domains, you must turn on the global_ssp boolean. Disabled by default.

setsebool -P global_ssp 1

If you want to enable support for upstart as the init program, you must turn on the init_upstart boolean. Enabled by default.

setsebool -P init_upstart 1

If you want to allow confined applications to use nscd shared memory, you must turn on the nscd_use_shm boolean. Enabled by default.

setsebool -P nscd_use_shm 1

If you want to allow unprivileged users to execute DDL statement, you must turn on the sepgsql_enable_users_ddl boolean. Enabled by default.

setsebool -P sepgsql_enable_users_ddl 1

If you want to support NFS home directories, you must turn on the use_nfs_home_dirs boolean. Disabled by default.

setsebool -P use_nfs_home_dirs 1

If you want to support SAMBA home directories, you must turn on the use_samba_home_dirs boolean. Disabled by default.

setsebool -P use_samba_home_dirs 1

PORT TYPES

SELinux defines port types to represent TCP and UDP ports.

You can see the types associated with a port by using the following command:

semanage port -l

Policy governs the access confined processes have to these ports. SELinux httpd policy is very flexible allowing users to setup their httpd processes in as secure a method as possible.

The following port types are defined for httpd:


Default Defined Ports: tcp 3128,8080,8118,8123,10001-10010 udp 3130


Default Defined Ports: tcp 80,81,443,488,8008,8009,8443,9000

MANAGED FILES

The SELinux process type httpd_t can manage files labeled with the following file types. The paths listed are the default paths for these file types. Note the processes UID still need to have DAC permissions.

cifs_t

cluster_conf_t

/etc/cluster(/.*)?

cluster_var_lib_t

/var/lib(64)?/openais(/.*)?
/var/lib(64)?/pengine(/.*)?
/var/lib(64)?/corosync(/.*)?
/usr/lib(64)?/heartbeat(/.*)?
/var/lib(64)?/heartbeat(/.*)?
/var/lib(64)?/pacemaker(/.*)?
/var/lib/cluster(/.*)?

cluster_var_run_t

/var/run/crm(/.*)?
/var/run/cman_.*
/var/run/rsctmp(/.*)?
/var/run/aisexec.*
/var/run/heartbeat(/.*)?
/var/run/cpglockd.pid
/var/run/corosync.pid
/var/run/rgmanager.pid
/var/run/cluster/rgmanager.sk

cobbler_var_lib_t

/var/lib/cobbler(/.*)?
/var/www/cobbler/pub(/.*)?
/var/lib/tftpboot/etc(/.*)?
/var/lib/tftpboot/ppc(/.*)?
/var/lib/tftpboot/grub(/.*)?
/var/www/cobbler/links(/.*)?
/var/lib/tftpboot/s390x(/.*)?
/var/www/cobbler/images(/.*)?
/var/lib/tftpboot/images(2)?(/.*)?
/var/lib/tftpboot/aarch64(/.*)?
/var/www/cobbler/rendered(/.*)?
/var/www/cobbler/ks_mirror(/.*)?
/var/www/cobbler/localmirror(/.*)?
/var/www/cobbler/repo_mirror(/.*)?
/var/lib/tftpboot/pxelinux.cfg(/.*)?
/var/lib/tftpboot/yaboot
/var/lib/tftpboot/memdisk
/var/lib/tftpboot/menu.c32
/var/lib/tftpboot/pxelinux.0

dirsrv_config_t

/etc/dirsrv(/.*)?

dirsrv_var_log_t

/var/log/dirsrv(/.*)?

dirsrv_var_run_t

/var/run/slapd.*
/var/run/dirsrv(/.*)?

dirsrvadmin_config_t

/etc/dirsrv/dsgw(/.*)?
/etc/dirsrv/admin-serv(/.*)?

dirsrvadmin_tmp_t

fusefs_t

httpd_apcupsd_cgi_rw_content_t

httpd_awstats_rw_content_t

httpd_bugzilla_rw_content_t

/var/lib/bugzilla(/.*)?

httpd_cache_t

/var/cache/rt3(/.*)?
/var/cache/ssl.*.sem
/var/cache/mod_.*
/var/cache/php-.*
/var/cache/httpd(/.*)?
/var/cache/mason(/.*)?
/var/cache/mod_ssl(/.*)?
/var/cache/lighttpd(/.*)?
/var/cache/mediawiki(/.*)?
/var/cache/mod_proxy(/.*)?
/var/cache/mod_gnutls(/.*)?
/var/cache/php-mmcache(/.*)?
/var/cache/php-eaccelerator(/.*)?

httpd_cobbler_rw_content_t

httpd_collectd_rw_content_t

httpd_cvs_rw_content_t

httpd_dirsrvadmin_rw_content_t

httpd_dspam_rw_content_t

/var/lib/dspam/data(/.*)?

httpd_git_rw_content_t

/var/cache/cgit(/.*)?
/var/cache/gitweb-caching(/.*)?

httpd_lock_t

httpd_mediawiki_rw_content_t

/var/www/wiki(/.*)?

httpd_munin_rw_content_t

httpd_nagios_rw_content_t

httpd_nutups_cgi_rw_content_t

httpd_openshift_rw_content_t

httpd_prewikka_rw_content_t

httpd_smokeping_cgi_rw_content_t

httpd_squid_rw_content_t

httpd_squirrelmail_t

/var/lib/squirrelmail/prefs(/.*)?

httpd_sys_rw_content_t

/etc/drupal.*
/var/lib/svn(/.*)?
/var/www/svn(/.*)?
/etc/dokuwiki(/.*)?
/etc/owncloud(/.*)?
/var/lib/koji(/.*)?
/etc/mock/koji(/.*)?
/var/www/html/[^/]*/sites/default/files(/.*)?
/var/www/html/[^/]*/sites/default/settings.php
/var/lib/drupal.*
/etc/zabbix/web(/.*)?
/var/log/z-push(/.*)?
/var/spool/gosa(/.*)?
/var/www/moodle(/.*)?
/var/lib/dokuwiki(/.*)?
/var/lib/owncloud(/.*)?
/var/spool/viewvc(/.*)?
/var/www/moodledata(/.*)?
/var/www/gallery/albums(/.*)?
/var/www/html/owncloud/data(/.*)?
/usr/share/wordpress-mu/wp-content(/.*)?
/usr/share/wordpress/wp-content/uploads(/.*)?
/usr/share/wordpress/wp-content/upgrade(/.*)?
/var/www/html/configuration.php

httpd_tmp_t

/var/www/openshift/console/tmp(/.*)?

httpd_tmpfs_t

httpd_user_rw_content_t

httpd_var_lib_t

/var/lib/dav(/.*)?
/var/lib/httpd(/.*)?
/var/lib/nginx(/.*)?
/var/lib/z-push(/.*)?
/var/lib/cherokee(/.*)?
/var/lib/roundcubemail(/.*)?
/var/lib/rt3/data/RT-Shredder(/.*)?

httpd_var_run_t

/var/run/mod_.*
/var/run/wsgi.*
/var/run/httpd.*
/var/run/nginx.*
/var/run/apache.*
/var/run/php-fpm(/.*)?
/var/run/lighttpd(/.*)?
/var/lib/php/session(/.*)?
/var/run/thttpd.pid
/var/run/gcache_port

httpd_w3c_validator_rw_content_t

httpdcontent

initrc_tmp_t

memcached_var_run_t

/var/run/memcached(/.*)?
/var/run/ipa_memcached(/.*)?

mirrormanager_var_run_t

/var/run/mirrormanager(/.*)?

mnt_t

/mnt(/[^/]*)
/mnt(/[^/]*)?
/rhev(/[^/]*)?
/media(/[^/]*)
/media(/[^/]*)?
/etc/rhgb(/.*)?
/media/.hal-.*
/net
/afs
/rhev
/misc

nfs_t

passenger_tmp_t

passenger_var_lib_t

/var/lib(64)?/passenger(/.*)?
/var/lib/passenger(/.*)?

passenger_var_run_t

/var/run/passenger(/.*)?

postfix_spool_maildrop_t

/var/spool/postfix/defer(/.*)?
/var/spool/postfix/deferred(/.*)?
/var/spool/postfix/maildrop(/.*)?

preupgrade_data_t

/var/lib/preupgrade(/.*)?
/var/log/preupgrade(/.*)?

public_content_rw_t

/var/spool/abrt-upload(/.*)?

root_t

/
/initrd

squirrelmail_spool_t

/var/spool/squirrelmail(/.*)?

tmp_t

/tmp
/usr/tmp
/var/tmp
/tmp-inst
/var/tmp-inst
/var/tmp/vi.recover

zarafa_var_lib_t

/var/lib/zarafa(/.*)?
/var/lib/zarafa-webapp(/.*)?
/var/lib/zarafa-webaccess(/.*)?

FILE CONTEXTS

SELinux requires files to have an extended attribute to define the file type.

You can see the context of a file using the -Z option to ls

Policy governs the access confined processes have to these files. SELinux httpd policy is very flexible allowing users to setup their httpd processes in as secure a method as possible.

EQUIVALENCE DIRECTORIES

httpd policy stores data with multiple different file context types under the /var/www directory. If you would like to store the data in a different directory you can use the semanage command to create an equivalence mapping. If you wanted to store this data under the /srv dirctory you would execute the following command:

semanage fcontext -a -e /var/www /srv/www
restorecon -R -v /srv/www

STANDARD FILE CONTEXT

SELinux defines the file context types for the httpd, if you wanted to store files with these types in a diffent paths, you need to execute the semanage command to sepecify alternate labeling and then use restorecon to put the labels on disk.

semanage fcontext -a -t httpd_w3c_validator_tmp_t '/srv/myhttpd_content(/.*)?'
restorecon -R -v /srv/myhttpd_content

Note: SELinux often uses regular expressions to specify labels that match multiple files.

The following file types are defined for httpd:

httpd_apcupsd_cgi_content_t

- Set files with the httpd_apcupsd_cgi_content_t type, if you want to treat the files as httpd apcupsd cgi content.

httpd_apcupsd_cgi_htaccess_t

- Set files with the httpd_apcupsd_cgi_htaccess_t type, if you want to treat the file as a httpd apcupsd cgi access file.

httpd_apcupsd_cgi_ra_content_t

- Set files with the httpd_apcupsd_cgi_ra_content_t type, if you want to treat the files as httpd apcupsd cgi read/append content.

httpd_apcupsd_cgi_rw_content_t

- Set files with the httpd_apcupsd_cgi_rw_content_t type, if you want to treat the files as httpd apcupsd cgi read/write content.

httpd_apcupsd_cgi_script_exec_t

- Set files with the httpd_apcupsd_cgi_script_exec_t type, if you want to transition an executable to the httpd_apcupsd_cgi_script_t domain.

/var/www/cgi-bin/apcgui(/.*)?, /var/www/apcupsd/multimon.cgi, /var/www/apcupsd/upsimage.cgi, /var/www/apcupsd/upsstats.cgi, /var/www/apcupsd/upsfstats.cgi

httpd_awstats_content_t

- Set files with the httpd_awstats_content_t type, if you want to treat the files as httpd awstats content.

httpd_awstats_htaccess_t

- Set files with the httpd_awstats_htaccess_t type, if you want to treat the file as a httpd awstats access file.

httpd_awstats_ra_content_t

- Set files with the httpd_awstats_ra_content_t type, if you want to treat the files as httpd awstats read/append content.

httpd_awstats_rw_content_t

- Set files with the httpd_awstats_rw_content_t type, if you want to treat the files as httpd awstats read/write content.

httpd_awstats_script_exec_t

- Set files with the httpd_awstats_script_exec_t type, if you want to transition an executable to the httpd_awstats_script_t domain.

httpd_bugzilla_content_t

- Set files with the httpd_bugzilla_content_t type, if you want to treat the files as httpd bugzilla content.

httpd_bugzilla_htaccess_t

- Set files with the httpd_bugzilla_htaccess_t type, if you want to treat the file as a httpd bugzilla access file.

httpd_bugzilla_ra_content_t

- Set files with the httpd_bugzilla_ra_content_t type, if you want to treat the files as httpd bugzilla read/append content.

httpd_bugzilla_rw_content_t

- Set files with the httpd_bugzilla_rw_content_t type, if you want to treat the files as httpd bugzilla read/write content.

httpd_bugzilla_script_exec_t

- Set files with the httpd_bugzilla_script_exec_t type, if you want to transition an executable to the httpd_bugzilla_script_t domain.

httpd_bugzilla_tmp_t

- Set files with the httpd_bugzilla_tmp_t type, if you want to store httpd bugzilla temporary files in the /tmp directories.

httpd_cache_t

- Set files with the httpd_cache_t type, if you want to store the files under the /var/cache directory.

/var/cache/rt3(/.*)?, /var/cache/ssl.*.sem, /var/cache/mod_.*, /var/cache/php-.*, /var/cache/httpd(/.*)?, /var/cache/mason(/.*)?, /var/cache/mod_ssl(/.*)?, /var/cache/lighttpd(/.*)?, /var/cache/mediawiki(/.*)?, /var/cache/mod_proxy(/.*)?, /var/cache/mod_gnutls(/.*)?, /var/cache/php-mmcache(/.*)?, /var/cache/php-eaccelerator(/.*)?

httpd_cobbler_content_t

- Set files with the httpd_cobbler_content_t type, if you want to treat the files as httpd cobbler content.

httpd_cobbler_htaccess_t

- Set files with the httpd_cobbler_htaccess_t type, if you want to treat the file as a httpd cobbler access file.

httpd_cobbler_ra_content_t

- Set files with the httpd_cobbler_ra_content_t type, if you want to treat the files as httpd cobbler read/append content.

httpd_cobbler_rw_content_t

- Set files with the httpd_cobbler_rw_content_t type, if you want to treat the files as httpd cobbler read/write content.

httpd_cobbler_script_exec_t

- Set files with the httpd_cobbler_script_exec_t type, if you want to transition an executable to the httpd_cobbler_script_t domain.

httpd_collectd_content_t

- Set files with the httpd_collectd_content_t type, if you want to treat the files as httpd collectd content.

httpd_collectd_htaccess_t

- Set files with the httpd_collectd_htaccess_t type, if you want to treat the file as a httpd collectd access file.

httpd_collectd_ra_content_t

- Set files with the httpd_collectd_ra_content_t type, if you want to treat the files as httpd collectd read/append content.

httpd_collectd_rw_content_t

- Set files with the httpd_collectd_rw_content_t type, if you want to treat the files as httpd collectd read/write content.

httpd_collectd_script_exec_t

- Set files with the httpd_collectd_script_exec_t type, if you want to transition an executable to the httpd_collectd_script_t domain.

httpd_config_t

- Set files with the httpd_config_t type, if you want to treat the files as httpd configuration data, usually stored under the /etc directory.

/etc/httpd(/.*)?, /etc/nginx(/.*)?, /etc/apache(2)?(/.*)?, /etc/cherokee(/.*)?, /etc/lighttpd(/.*)?, /etc/apache-ssl(2)?(/.*)?, /var/lib/openshift/.httpd.d(/.*)?, /var/lib/stickshift/.httpd.d(/.*)?, /etc/vhosts, /etc/thttpd.conf

httpd_cvs_content_t

- Set files with the httpd_cvs_content_t type, if you want to treat the files as httpd cvs content.

httpd_cvs_htaccess_t

- Set files with the httpd_cvs_htaccess_t type, if you want to treat the file as a httpd cvs access file.

httpd_cvs_ra_content_t

- Set files with the httpd_cvs_ra_content_t type, if you want to treat the files as httpd cvs read/append content.

httpd_cvs_rw_content_t

- Set files with the httpd_cvs_rw_content_t type, if you want to treat the files as httpd cvs read/write content.

httpd_cvs_script_exec_t

- Set files with the httpd_cvs_script_exec_t type, if you want to transition an executable to the httpd_cvs_script_t domain.

/var/www/cgi-bin/cvsweb.cgi, /usr/share/cvsweb/cvsweb.cgi

httpd_dirsrvadmin_content_t

- Set files with the httpd_dirsrvadmin_content_t type, if you want to treat the files as httpd dirsrvadmin content.

httpd_dirsrvadmin_htaccess_t

- Set files with the httpd_dirsrvadmin_htaccess_t type, if you want to treat the file as a httpd dirsrvadmin access file.

httpd_dirsrvadmin_ra_content_t

- Set files with the httpd_dirsrvadmin_ra_content_t type, if you want to treat the files as httpd dirsrvadmin read/append content.

httpd_dirsrvadmin_rw_content_t

- Set files with the httpd_dirsrvadmin_rw_content_t type, if you want to treat the files as httpd dirsrvadmin read/write content.

httpd_dirsrvadmin_script_exec_t

- Set files with the httpd_dirsrvadmin_script_exec_t type, if you want to transition an executable to the httpd_dirsrvadmin_script_t domain.

/usr/lib(64)?/dirsrv/cgi-bin(/.*)?, /usr/lib(64)?/dirsrv/dsgw-cgi-bin(/.*)?

httpd_dspam_content_t

- Set files with the httpd_dspam_content_t type, if you want to treat the files as httpd dspam content.

httpd_dspam_htaccess_t

- Set files with the httpd_dspam_htaccess_t type, if you want to treat the file as a httpd dspam access file.

httpd_dspam_ra_content_t

- Set files with the httpd_dspam_ra_content_t type, if you want to treat the files as httpd dspam read/append content.

httpd_dspam_rw_content_t

- Set files with the httpd_dspam_rw_content_t type, if you want to treat the files as httpd dspam read/write content.

httpd_dspam_script_exec_t

- Set files with the httpd_dspam_script_exec_t type, if you want to transition an executable to the httpd_dspam_script_t domain.

/var/www/dspam/.*.cgi, /usr/share/dspam-web/dspam.cgi

httpd_exec_t

- Set files with the httpd_exec_t type, if you want to transition an executable to the httpd_t domain.

/usr/sbin/httpd(.worker)?, /usr/sbin/apache(2)?, /usr/lib/apache-ssl/.+, /usr/sbin/apache-ssl(2)?, /usr/sbin/nginx, /usr/sbin/thttpd, /usr/sbin/php-fpm, /usr/sbin/cherokee, /usr/sbin/lighttpd, /usr/bin/mongrel_rails, /usr/sbin/htcacheclean

httpd_git_content_t

- Set files with the httpd_git_content_t type, if you want to treat the files as httpd git content.

httpd_git_htaccess_t

- Set files with the httpd_git_htaccess_t type, if you want to treat the file as a httpd git access file.

httpd_git_ra_content_t

- Set files with the httpd_git_ra_content_t type, if you want to treat the files as httpd git read/append content.

httpd_git_rw_content_t

- Set files with the httpd_git_rw_content_t type, if you want to treat the files as httpd git read/write content.

/var/cache/cgit(/.*)?, /var/cache/gitweb-caching(/.*)?

httpd_git_script_exec_t

- Set files with the httpd_git_script_exec_t type, if you want to transition an executable to the httpd_git_script_t domain.

/var/www/git/gitweb.cgi, /var/www/cgi-bin/cgit, /var/www/gitweb-caching/gitweb.cgi

httpd_helper_exec_t

- Set files with the httpd_helper_exec_t type, if you want to transition an executable to the httpd_helper_t domain.

httpd_initrc_exec_t

- Set files with the httpd_initrc_exec_t type, if you want to transition an executable to the httpd_initrc_t domain.

/etc/rc.d/init.d/php-fpm.*, /etc/init.d/cherokee, /etc/rc.d/init.d/httpd, /etc/rc.d/init.d/nginx, /etc/rc.d/init.d/thttpd, /etc/rc.d/init.d/lighttpd, /etc/rc.d/init.d/htcacheclean

httpd_keytab_t

- Set files with the httpd_keytab_t type, if you want to treat the files as kerberos keytab files.

httpd_lock_t

- Set files with the httpd_lock_t type, if you want to treat the files as httpd lock data, stored under the /var/lock directory

httpd_log_t

- Set files with the httpd_log_t type, if you want to treat the data as httpd log data, usually stored under the /var/log directory.

/var/log/cacti(/.*)?, /var/log/httpd(/.*)?, /var/log/nginx(/.*)?, /var/log/apache(2)?(/.*)?, /var/log/php-fpm(/.*)?, /var/log/cherokee(/.*)?, /var/log/lighttpd(/.*)?, /var/log/thttpd.log.*, /var/log/apache-ssl(2)?(/.*)?, /var/log/cgiwrap.log.*, /var/www/stickshift/[^/]*/log(/.*)?, /var/log/roundcubemail(/.*)?, /var/lib/openshift/.log/httpd(/.*)?, /var/www/openshift/console/log(/.*)?, /etc/httpd/logs

httpd_mediawiki_content_t

- Set files with the httpd_mediawiki_content_t type, if you want to treat the files as httpd mediawiki content.

/var/www/wiki/.*.php, /usr/share/mediawiki(/.*)?

httpd_mediawiki_htaccess_t

- Set files with the httpd_mediawiki_htaccess_t type, if you want to treat the file as a httpd mediawiki access file.

httpd_mediawiki_ra_content_t

- Set files with the httpd_mediawiki_ra_content_t type, if you want to treat the files as httpd mediawiki read/append content.

httpd_mediawiki_rw_content_t

- Set files with the httpd_mediawiki_rw_content_t type, if you want to treat the files as httpd mediawiki read/write content.

httpd_mediawiki_script_exec_t

- Set files with the httpd_mediawiki_script_exec_t type, if you want to transition an executable to the httpd_mediawiki_script_t domain.

/usr/lib(64)?/mediawiki/math/texvc, /usr/lib(64)?/mediawiki/math/texvc_tex, /usr/lib(64)?/mediawiki/math/texvc_tes

httpd_mediawiki_tmp_t

- Set files with the httpd_mediawiki_tmp_t type, if you want to store httpd mediawiki temporary files in the /tmp directories.

httpd_modules_t

- Set files with the httpd_modules_t type, if you want to treat the files as httpd modules.

/usr/lib(64)?/httpd(/.*)?, /usr/lib(64)?/apache(/.*)?, /usr/lib(64)?/cherokee(/.*)?, /usr/lib(64)?/lighttpd(/.*)?, /usr/lib(64)?/apache2/modules(/.*)?, /etc/httpd/modules

httpd_munin_content_t

- Set files with the httpd_munin_content_t type, if you want to treat the files as httpd munin content.

httpd_munin_htaccess_t

- Set files with the httpd_munin_htaccess_t type, if you want to treat the file as a httpd munin access file.

httpd_munin_ra_content_t

- Set files with the httpd_munin_ra_content_t type, if you want to treat the files as httpd munin read/append content.

httpd_munin_rw_content_t

- Set files with the httpd_munin_rw_content_t type, if you want to treat the files as httpd munin read/write content.

httpd_munin_script_exec_t

- Set files with the httpd_munin_script_exec_t type, if you want to transition an executable to the httpd_munin_script_t domain.

/var/www/cgi-bin/munin.*, /var/www/html/cgi/munin.*, /var/www/html/munin/cgi(/.*)?

httpd_munin_script_tmp_t

- Set files with the httpd_munin_script_tmp_t type, if you want to store httpd munin script temporary files in the /tmp directories.

httpd_nagios_content_t

- Set files with the httpd_nagios_content_t type, if you want to treat the files as httpd nagios content.

httpd_nagios_htaccess_t

- Set files with the httpd_nagios_htaccess_t type, if you want to treat the file as a httpd nagios access file.

httpd_nagios_ra_content_t

- Set files with the httpd_nagios_ra_content_t type, if you want to treat the files as httpd nagios read/append content.

httpd_nagios_rw_content_t

- Set files with the httpd_nagios_rw_content_t type, if you want to treat the files as httpd nagios read/write content.

httpd_nagios_script_exec_t

- Set files with the httpd_nagios_script_exec_t type, if you want to transition an executable to the httpd_nagios_script_t domain.

/usr/lib(64)?/nagios/cgi(/.*)?, /usr/lib(64)?/cgi-bin/nagios(/.+)?, /usr/lib(64)?/nagios/cgi-bin(/.*)?, /usr/lib(64)?/cgi-bin/netsaint(/.*)?

httpd_nutups_cgi_content_t

- Set files with the httpd_nutups_cgi_content_t type, if you want to treat the files as httpd nutups cgi content.

httpd_nutups_cgi_htaccess_t

- Set files with the httpd_nutups_cgi_htaccess_t type, if you want to treat the file as a httpd nutups cgi access file.

httpd_nutups_cgi_ra_content_t

- Set files with the httpd_nutups_cgi_ra_content_t type, if you want to treat the files as httpd nutups cgi read/append content.

httpd_nutups_cgi_rw_content_t

- Set files with the httpd_nutups_cgi_rw_content_t type, if you want to treat the files as httpd nutups cgi read/write content.

httpd_nutups_cgi_script_exec_t

- Set files with the httpd_nutups_cgi_script_exec_t type, if you want to transition an executable to the httpd_nutups_cgi_script_t domain.

/var/www/nut-cgi-bin/upsset.cgi, /var/www/nut-cgi-bin/upsimage.cgi, /var/www/nut-cgi-bin/upsstats.cgi

httpd_openshift_content_t

- Set files with the httpd_openshift_content_t type, if you want to treat the files as httpd openshift content.

httpd_openshift_htaccess_t

- Set files with the httpd_openshift_htaccess_t type, if you want to treat the file as a httpd openshift access file.

httpd_openshift_ra_content_t

- Set files with the httpd_openshift_ra_content_t type, if you want to treat the files as httpd openshift read/append content.

httpd_openshift_rw_content_t

- Set files with the httpd_openshift_rw_content_t type, if you want to treat the files as httpd openshift read/write content.

httpd_openshift_script_exec_t

- Set files with the httpd_openshift_script_exec_t type, if you want to transition an executable to the httpd_openshift_script_t domain.

httpd_php_exec_t

- Set files with the httpd_php_exec_t type, if you want to transition an executable to the httpd_php_t domain.

httpd_php_tmp_t

- Set files with the httpd_php_tmp_t type, if you want to store httpd php temporary files in the /tmp directories.

httpd_prewikka_content_t

- Set files with the httpd_prewikka_content_t type, if you want to treat the files as httpd prewikka content.

httpd_prewikka_htaccess_t

- Set files with the httpd_prewikka_htaccess_t type, if you want to treat the file as a httpd prewikka access file.

httpd_prewikka_ra_content_t

- Set files with the httpd_prewikka_ra_content_t type, if you want to treat the files as httpd prewikka read/append content.

httpd_prewikka_rw_content_t

- Set files with the httpd_prewikka_rw_content_t type, if you want to treat the files as httpd prewikka read/write content.

httpd_prewikka_script_exec_t

- Set files with the httpd_prewikka_script_exec_t type, if you want to transition an executable to the httpd_prewikka_script_t domain.

httpd_rotatelogs_exec_t

- Set files with the httpd_rotatelogs_exec_t type, if you want to transition an executable to the httpd_rotatelogs_t domain.

httpd_smokeping_cgi_content_t

- Set files with the httpd_smokeping_cgi_content_t type, if you want to treat the files as httpd smokeping cgi content.

httpd_smokeping_cgi_htaccess_t

- Set files with the httpd_smokeping_cgi_htaccess_t type, if you want to treat the file as a httpd smokeping cgi access file.

httpd_smokeping_cgi_ra_content_t

- Set files with the httpd_smokeping_cgi_ra_content_t type, if you want to treat the files as httpd smokeping cgi read/append content.

httpd_smokeping_cgi_rw_content_t

- Set files with the httpd_smokeping_cgi_rw_content_t type, if you want to treat the files as httpd smokeping cgi read/write content.

httpd_smokeping_cgi_script_exec_t

- Set files with the httpd_smokeping_cgi_script_exec_t type, if you want to transition an executable to the httpd_smokeping_cgi_script_t domain.

httpd_squid_content_t

- Set files with the httpd_squid_content_t type, if you want to treat the files as httpd squid content.

httpd_squid_htaccess_t

- Set files with the httpd_squid_htaccess_t type, if you want to treat the file as a httpd squid access file.

httpd_squid_ra_content_t

- Set files with the httpd_squid_ra_content_t type, if you want to treat the files as httpd squid read/append content.

httpd_squid_rw_content_t

- Set files with the httpd_squid_rw_content_t type, if you want to treat the files as httpd squid read/write content.

httpd_squid_script_exec_t

- Set files with the httpd_squid_script_exec_t type, if you want to transition an executable to the httpd_squid_script_t domain.

/usr/lib/squid/cachemgr.cgi, /usr/lib64/squid/cachemgr.cgi

httpd_squirrelmail_t

- Set files with the httpd_squirrelmail_t type, if you want to treat the files as httpd squirrelmail data.

httpd_suexec_exec_t

- Set files with the httpd_suexec_exec_t type, if you want to transition an executable to the httpd_suexec_t domain.

/usr/lib(64)?/apache(2)?/suexec(2)?, /usr/lib(64)?/cgi-bin/(nph-)?cgiwrap(d)?, /usr/sbin/suexec

httpd_suexec_tmp_t

- Set files with the httpd_suexec_tmp_t type, if you want to store httpd suexec temporary files in the /tmp directories.

httpd_sys_content_t

- Set files with the httpd_sys_content_t type, if you want to treat the files as httpd sys content.

/srv/([^/]*/)?www(/.*)?, /var/www(/.*)?, /etc/htdig(/.*)?, /srv/gallery2(/.*)?, /var/lib/trac(/.*)?, /var/lib/htdig(/.*)?, /var/www/icons(/.*)?, /usr/share/htdig(/.*)?, /usr/share/drupal.*, /var/www/svn/conf(/.*)?, /usr/share/icecast(/.*)?, /usr/share/mythweb(/.*)?, /var/lib/cacti/rra(/.*)?, /usr/share/ntop/html(/.*)?, /var/lib/graphite-web(/.*), /usr/share/mythtv/data(/.*)?, /usr/share/openca/htdocs(/.*)?, /usr/share/selinux-policy[^/]*/html(/.*)?

httpd_sys_htaccess_t

- Set files with the httpd_sys_htaccess_t type, if you want to treat the file as a httpd sys access file.

httpd_sys_ra_content_t

- Set files with the httpd_sys_ra_content_t type, if you want to treat the files as httpd sys read/append content.

httpd_sys_rw_content_t

- Set files with the httpd_sys_rw_content_t type, if you want to treat the files as httpd sys read/write content.

/etc/drupal.*, /var/lib/svn(/.*)?, /var/www/svn(/.*)?, /etc/dokuwiki(/.*)?, /etc/owncloud(/.*)?, /var/lib/koji(/.*)?, /etc/mock/koji(/.*)?, /var/www/html/[^/]*/sites/default/files(/.*)?, /var/www/html/[^/]*/sites/default/settings.php, /var/lib/drupal.*, /etc/zabbix/web(/.*)?, /var/log/z-push(/.*)?, /var/spool/gosa(/.*)?, /var/www/moodle(/.*)?, /var/lib/dokuwiki(/.*)?, /var/lib/owncloud(/.*)?, /var/spool/viewvc(/.*)?, /var/www/moodledata(/.*)?, /var/www/gallery/albums(/.*)?, /var/www/html/owncloud/data(/.*)?, /usr/share/wordpress-mu/wp-content(/.*)?, /usr/share/wordpress/wp-content/uploads(/.*)?, /usr/share/wordpress/wp-content/upgrade(/.*)?, /var/www/html/configuration.php

httpd_sys_script_exec_t

- Set files with the httpd_sys_script_exec_t type, if you want to transition an executable to the httpd_sys_script_t domain.

/var/www/[^/]*/cgi-bin(/.*)?, /var/www/perl(/.*)?, /var/www/html/[^/]*/cgi-bin(/.*)?, /usr/lib/cgi-bin(/.*)?, /var/www/cgi-bin(/.*)?, /var/www/svn/hooks(/.*)?, /usr/share/wordpress/.*.php, /usr/share/wordpress/wp-includes/.*.php, /usr/share/mythtv/mythweather/scripts(/.*)?, /usr/share/mythweb/mythweb.pl, /usr/share/wordpress-mu/wp-config.php

httpd_tmp_t

- Set files with the httpd_tmp_t type, if you want to store httpd temporary files in the /tmp directories.

httpd_tmpfs_t

- Set files with the httpd_tmpfs_t type, if you want to store httpd files on a tmpfs file system.

httpd_unconfined_script_exec_t

- Set files with the httpd_unconfined_script_exec_t type, if you want to transition an executable to the httpd_unconfined_script_t domain.

httpd_user_content_t

- Set files with the httpd_user_content_t type, if you want to treat the files as httpd user content.

/home/[^/]*/((www)|(web)|(public_html))(/.+)?, /home/staff/((www)|(web)|(public_html))(/.+)?

httpd_user_htaccess_t

- Set files with the httpd_user_htaccess_t type, if you want to treat the file as a httpd user access file.

httpd_user_ra_content_t

- Set files with the httpd_user_ra_content_t type, if you want to treat the files as httpd user read/append content.

httpd_user_rw_content_t

- Set files with the httpd_user_rw_content_t type, if you want to treat the files as httpd user read/write content.

httpd_user_script_exec_t

- Set files with the httpd_user_script_exec_t type, if you want to transition an executable to the httpd_user_script_t domain.

httpd_var_lib_t

- Set files with the httpd_var_lib_t type, if you want to store the httpd files under the /var/lib directory.

/var/lib/dav(/.*)?, /var/lib/httpd(/.*)?, /var/lib/nginx(/.*)?, /var/lib/z-push(/.*)?, /var/lib/cherokee(/.*)?, /var/lib/roundcubemail(/.*)?, /var/lib/rt3/data/RT-Shredder(/.*)?

httpd_var_run_t

- Set files with the httpd_var_run_t type, if you want to store the httpd files under the /run or /var/run directory.

/var/run/mod_.*, /var/run/wsgi.*, /var/run/httpd.*, /var/run/nginx.*, /var/run/apache.*, /var/run/php-fpm(/.*)?, /var/run/lighttpd(/.*)?, /var/lib/php/session(/.*)?, /var/run/thttpd.pid, /var/run/gcache_port

httpd_w3c_validator_content_t

- Set files with the httpd_w3c_validator_content_t type, if you want to treat the files as httpd w3c validator content.

httpd_w3c_validator_htaccess_t

- Set files with the httpd_w3c_validator_htaccess_t type, if you want to treat the file as a httpd w3c validator access file.

httpd_w3c_validator_ra_content_t

- Set files with the httpd_w3c_validator_ra_content_t type, if you want to treat the files as httpd w3c validator read/append content.

httpd_w3c_validator_rw_content_t

- Set files with the httpd_w3c_validator_rw_content_t type, if you want to treat the files as httpd w3c validator read/write content.

httpd_w3c_validator_script_exec_t

- Set files with the httpd_w3c_validator_script_exec_t type, if you want to transition an executable to the httpd_w3c_validator_script_t domain.

/usr/share/w3c-markup-validator/cgi-bin(/.*)?, /usr/lib/cgi-bin/check

httpd_w3c_validator_tmp_t

- Set files with the httpd_w3c_validator_tmp_t type, if you want to store httpd w3c validator temporary files in the /tmp directories.

Note: File context can be temporarily modified with the chcon command. If you want to permanently change the file context you need to use the semanage fcontext command. This will modify the SELinux labeling database. You will need to use restorecon to apply the labels.

SHARING FILES

If you want to share files with multiple domains (Apache, FTP, rsync, Samba), you can set a file context of public_content_t and public_content_rw_t. These context allow any of the above domains to read the content. If you want a particular domain to write to the public_content_rw_t domain, you must set the appropriate boolean.

semanage fcontext -a -t public_content_t "/var/httpd(/.*)?"
restorecon -F -R -v /var/httpd

semanage fcontext -a -t public_content_rw_t "/var/httpd/incoming(/.*)?"
restorecon -F -R -v /var/httpd/incoming
setsebool -P httpd_anon_write 1

If you want to allow Apache to modify public files used for public file transfer services. Directories/Files must be labeled public_rw_content_t., you must turn on the allow_httpd_anon_write boolean.

setsebool -P allow_httpd_anon_write 1

COMMANDS

semanage fcontext can also be used to manipulate default file context mappings.

semanage permissive can also be used to manipulate whether or not a process type is permissive.

semanage module can also be used to enable/disable/install/remove policy modules.

semanage port can also be used to manipulate the port definitions

semanage boolean can also be used to manipulate the booleans

system-config-selinux is a GUI tool available to customize SELinux policy settings.

AUTHOR

This manual page was auto-generated using sepolicy manpage .

SEE ALSO

selinux(8), httpd(8), semanage(8), restorecon(8), chcon(1) , setsebool(8), httpd_apcupsd_cgi_script_selinux(8), httpd_awstats_script_selinux(8), httpd_bugzilla_script_selinux(8), httpd_cobbler_script_selinux(8), httpd_collectd_script_selinux(8), httpd_cvs_script_selinux(8), httpd_dirsrvadmin_script_selinux(8), httpd_dspam_script_selinux(8), httpd_git_script_selinux(8), httpd_helper_selinux(8), httpd_mediawiki_script_selinux(8), httpd_munin_script_selinux(8), httpd_nagios_script_selinux(8), httpd_nutups_cgi_script_selinux(8), httpd_openshift_script_selinux(8), httpd_php_selinux(8), httpd_prewikka_script_selinux(8), httpd_rotatelogs_selinux(8), httpd_smokeping_cgi_script_selinux(8), httpd_squid_script_selinux(8), httpd_suexec_selinux(8), httpd_sys_script_selinux(8), httpd_unconfined_script_selinux(8), httpd_user_script_selinux(8), httpd_w3c_validator_script_selinux(8)

15-06-03 httpd