httpd_suexec_selinux(8)

๐Ÿ“ฆ
version 20250627+git412.dbf877ab7 ยท 7 versions
, in opensuse-leap 16.0

๐Ÿ’… httpd_suexec_selinux โ€” bestie's guide to the SELinux policy for httpd_suexec โœจ

okay so this is the httpd_suexec_selinux manual page, from the SELinux Policy httpd_suexec corner of the universe. sit down, hydrate, let's get into it ๐Ÿซถ


โœจ NAME โœจ

httpd_suexec_selinux โ€” the Security Enhanced Linux Policy for the httpd_suexec processes. that's the whole vibe, that's the assignment ๐Ÿ’…


๐ŸŒธ DESCRIPTION ๐ŸŒธ

so like, Security-Enhanced Linux secures the httpd_suexec processes via flexible mandatory access control. flexible! mandatory! both! iconic honestly ๐Ÿ‘‘

the httpd_suexec processes execute with the httpd_suexec_t SELinux type. wanna check if you've got these processes running? just run the ps command with the -Z qualifier. fr fr that's it.

for example:

ps -eZ | grep httpd_suexec_t

look at you go, doing process recon ๐Ÿ•ต๏ธโ€โ™€๏ธโœจ


๐Ÿฆ‹ ENTRYPOINTS ๐Ÿฆ‹

the httpd_suexec_t SELinux type can be entered via the httpd_suexec_exec_t file type. that's the doorway, that's the portal ๐ŸŒ€

the default entrypoint paths for the httpd_suexec_t domain are literally these:

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

๐Ÿ‘‘ PROCESS TYPES ๐Ÿ‘‘

SELinux defines process types (domains) for each process running on the system. one type per process era, basically main character energy for each one ๐Ÿ’ซ

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

policy governs the access confined processes have to files. the SELinux httpd_suexec policy is very flexible, allowing users to set up their httpd_suexec processes in as secure a method as possible. secure AND flexible, we love a multihyphenate ๐ŸŒˆ

the following process types are defined for httpd_suexec:

  • httpd_suexec_t
Note: semanage permissive -a httpd_suexec_t can be used to make the process type httpd_suexec_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. so like, it stops blocking you, but it's still writing down everything you do in its little diary ๐Ÿ““๐Ÿ˜ญ

๐ŸŽ€ BOOLEANS ๐ŸŽ€

SELinux policy is customizable based on least access required. the httpd_suexec policy is extremely flexible and has several booleans that allow you to manipulate the policy and run httpd_suexec with the tightest access possible. tightest access possible = the look, the fit, the security ๐Ÿ”’โœจ

fips_mode โ€” 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

httpd_builtin_scripting โ€” 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

httpd_can_network_connect โ€” 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

httpd_can_network_connect_db โ€” 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

httpd_can_sendmail โ€” 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

httpd_enable_cgi โ€” 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

httpd_enable_homedirs โ€” 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

httpd_execmem โ€” 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

httpd_read_user_content โ€” 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

httpd_tty_comm โ€” 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

httpd_unified โ€” 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

httpd_use_cifs โ€” 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

httpd_use_fusefs โ€” 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

httpd_use_nfs โ€” 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

nis_enabled โ€” if you want to allow system to run with NIS, you must turn on the nis_enabled boolean. Disabled by default.

setsebool -P nis_enabled 1

use_nfs_home_dirs โ€” if you want to support NFS home directories, you must turn on the use_nfs_home_dirs boolean. Enabled by default.

setsebool -P use_nfs_home_dirs 1

use_samba_home_dirs โ€” 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

๐Ÿงš MANAGED FILES ๐Ÿงš

the SELinux process type httpd_suexec_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 โ€” SELinux ain't doing your DAC homework for you, bestie ๐Ÿ˜ค๐Ÿ“š

cifs_t

fusefs_t

/run/user/[0-9]+/gvfs

httpd_suexec_tmp_t

krb5_host_rcache_t

/var/tmp/krb5_0.rcache2
/var/cache/krb5rcache(/.*)?
/var/tmp/nfs_0
/var/tmp/DNS_25
/var/tmp/host_0
/var/tmp/imap_0
/var/tmp/HTTP_23
/var/tmp/HTTP_48
/var/tmp/ldap_55
/var/tmp/ldap_487
/var/tmp/ldapmap1_0

nfs_t


๐Ÿ’œ FILE CONTEXTS ๐Ÿ’œ

SELinux requires files to have an extended attribute to define the file type. yes, every file has a little aura and SELinux is reading it ๐Ÿ”ฎ

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

policy governs the access confined processes have to these files. the SELinux httpd_suexec policy is very flexible, allowing users to set up their httpd_suexec processes in as secure a method as possible. (yes she said it again, she means it ๐Ÿ’…)

๐ŸŒŸ STANDARD FILE CONTEXT ๐ŸŒŸ

SELinux defines the file context types for the httpd_suexec. if you wanted to store files with these types in a different paths, you need to execute the semanage command to specify alternate labeling and then use restorecon to put the labels on disk. relocate the files, keep the labels, that's the whole trick โœจ

semanage fcontext -a -t httpd_suexec_exec_t
'/srv/httpd_suexec/content(/.*)?'
restorecon -R -v /srv/myhttpd_suexec_content
Note: SELinux often uses regular expressions to specify labels that match multiple files. regex girlies stay winning ๐ŸŽฏ

the following file types are defined for httpd_suexec:

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.

paths:

/usr/lib/apache(2)?/suexec(2)?, /usr/lib/cgi-bin/(nph-)?cgiwrap(d)?,
/usr/bin/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.
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. chcon is the cute temporary tattoo, semanage fcontext is the real ink, no cap ๐Ÿ–Š๏ธ๐Ÿ’€

โญ 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 boolean can also be used to manipulate the booleans
  • system-config-selinux is a GUI tool available to customize SELinux policy settings. a GUI!! for the mouse girlies ๐Ÿ–ฑ๏ธ๐ŸŽ€

๐ŸŒˆ AUTHOR ๐ŸŒˆ

this manual page was auto-generated using sepolicy manpage. the robots wrote this one, respect to them ๐Ÿค–๐Ÿซถ


๐Ÿ“ SEE ALSO ๐Ÿ“

selinux(8), httpd_suexec(8), semanage(8), restorecon(8), chcon(1), sepolicy(8), setsebool(8)


and that's the page, bestie!! mwah ๐Ÿ’‹ this whole thing is httpd_suexec, dated 26-10-06, living its best life in section httpd_suexec_selinux(8). go forth and label responsibly ๐Ÿ”ฅ๐Ÿ‘‘

๐Ÿ“ฆ where this page comes from