1httpd_selinux(8) SELinux Policy httpd httpd_selinux(8)
2
3
4
6 httpd_selinux - Security Enhanced Linux Policy for the httpd processes
7
9 Security-Enhanced Linux secures the httpd processes via flexible manda‐
10 tory access control.
11
12 The httpd processes execute with the httpd_t SELinux type. You can
13 check if you have these processes running by executing the ps command
14 with the -Z qualifier.
15
16 For example:
17
18 ps -eZ | grep httpd_t
19
20
21
23 The httpd_t SELinux type can be entered via the httpd_exec_t file type.
24
25 The default entrypoint paths for the httpd_t domain are the following:
26
27 /usr/sbin/httpd(.worker)?, /usr/sbin/apache(2)?, /usr/lib/apache-
28 ssl/.+, /usr/sbin/apache-ssl(2)?, /usr/sbin/nginx, /usr/sbin/thttpd,
29 /usr/sbin/php-fpm, /usr/sbin/cherokee, /usr/sbin/lighttpd,
30 /usr/sbin/apachectl, /usr/sbin/httpd.event, /usr/bin/mongrel_rails,
31 /usr/sbin/htcacheclean
32
34 SELinux defines process types (domains) for each process running on the
35 system
36
37 You can see the context of a process using the -Z option to ps
38
39 Policy governs the access confined processes have to files. SELinux
40 httpd policy is very flexible allowing users to setup their httpd pro‐
41 cesses in as secure a method as possible.
42
43 The following process types are defined for httpd:
44
45 httpd_t, httpd_helper_t, httpd_php_t, httpd_rotatelogs_t, httpd_suexec_t, httpd_sys_script_t, httpd_user_script_t, httpd_passwd_t, httpd_unconfined_script_t
46
47 Note: semanage permissive -a httpd_t can be used to make the process
48 type httpd_t permissive. SELinux does not deny access to permissive
49 process types, but the AVC (SELinux denials) messages are still gener‐
50 ated.
51
52
54 SELinux policy is customizable based on least access required. httpd
55 policy is extremely flexible and has several booleans that allow you to
56 manipulate the policy and run httpd with the tightest access possible.
57
58
59
60 If you want to allow httpd to use built in scripting (usually php), you
61 must turn on the httpd_builtin_scripting boolean. Enabled by default.
62
63 setsebool -P httpd_builtin_scripting 1
64
65
66
67 If you want to allow httpd to act as a FTP client connecting to the ftp
68 port and ephemeral ports, you must turn on the httpd_can_connect_ftp
69 boolean. Disabled by default.
70
71 setsebool -P httpd_can_connect_ftp 1
72
73
74
75 If you want to allow httpd to connect to the ldap port, you must turn
76 on the httpd_can_connect_ldap boolean. Disabled by default.
77
78 setsebool -P httpd_can_connect_ldap 1
79
80
81
82 If you want to allow http daemon to connect to mythtv, you must turn on
83 the httpd_can_connect_mythtv boolean. Disabled by default.
84
85 setsebool -P httpd_can_connect_mythtv 1
86
87
88
89 If you want to allow http daemon to connect to zabbix, you must turn on
90 the httpd_can_connect_zabbix boolean. Disabled by default.
91
92 setsebool -P httpd_can_connect_zabbix 1
93
94
95
96 If you want to allow HTTPD scripts and modules to connect to the net‐
97 work using TCP, you must turn on the httpd_can_network_connect boolean.
98 Disabled by default.
99
100 setsebool -P httpd_can_network_connect 1
101
102
103
104 If you want to allow HTTPD scripts and modules to connect to cobbler
105 over the network, you must turn on the httpd_can_network_connect_cob‐
106 bler boolean. Disabled by default.
107
108 setsebool -P httpd_can_network_connect_cobbler 1
109
110
111
112 If you want to allow HTTPD scripts and modules to connect to databases
113 over the network, you must turn on the httpd_can_network_connect_db
114 boolean. Disabled by default.
115
116 setsebool -P httpd_can_network_connect_db 1
117
118
119
120 If you want to allow httpd to connect to memcache server, you must turn
121 on the httpd_can_network_memcache boolean. Disabled by default.
122
123 setsebool -P httpd_can_network_memcache 1
124
125
126
127 If you want to allow httpd to act as a relay, you must turn on the
128 httpd_can_network_relay boolean. Disabled by default.
129
130 setsebool -P httpd_can_network_relay 1
131
132
133
134 If you want to allow http daemon to send mail, you must turn on the
135 httpd_can_sendmail boolean. Disabled by default.
136
137 setsebool -P httpd_can_sendmail 1
138
139
140
141 If you want to allow Apache to communicate with avahi service via dbus,
142 you must turn on the httpd_dbus_avahi boolean. Disabled by default.
143
144 setsebool -P httpd_dbus_avahi 1
145
146
147
148 If you want to allow Apache to communicate with sssd service via dbus,
149 you must turn on the httpd_dbus_sssd boolean. Disabled by default.
150
151 setsebool -P httpd_dbus_sssd 1
152
153
154
155 If you want to allow httpd cgi support, you must turn on the httpd_en‐
156 able_cgi boolean. Enabled by default.
157
158 setsebool -P httpd_enable_cgi 1
159
160
161
162 If you want to allow httpd to act as a FTP server by listening on the
163 ftp port, you must turn on the httpd_enable_ftp_server boolean. Dis‐
164 abled by default.
165
166 setsebool -P httpd_enable_ftp_server 1
167
168
169
170 If you want to allow httpd to read home directories, you must turn on
171 the httpd_enable_homedirs boolean. Disabled by default.
172
173 setsebool -P httpd_enable_homedirs 1
174
175
176
177 If you want to allow httpd scripts and modules execmem/execstack, you
178 must turn on the httpd_execmem boolean. Disabled by default.
179
180 setsebool -P httpd_execmem 1
181
182
183
184 If you want to allow HTTPD to connect to port 80 for graceful shutdown,
185 you must turn on the httpd_graceful_shutdown boolean. Disabled by de‐
186 fault.
187
188 setsebool -P httpd_graceful_shutdown 1
189
190
191
192 If you want to allow httpd processes to manage IPA content, you must
193 turn on the httpd_manage_ipa boolean. Disabled by default.
194
195 setsebool -P httpd_manage_ipa 1
196
197
198
199 If you want to allow Apache to use mod_auth_ntlm_winbind, you must turn
200 on the httpd_mod_auth_ntlm_winbind boolean. Disabled by default.
201
202 setsebool -P httpd_mod_auth_ntlm_winbind 1
203
204
205
206 If you want to allow Apache to use mod_auth_pam, you must turn on the
207 httpd_mod_auth_pam boolean. Disabled by default.
208
209 setsebool -P httpd_mod_auth_pam 1
210
211
212
213 If you want to allow httpd to read user content, you must turn on the
214 httpd_read_user_content boolean. Disabled by default.
215
216 setsebool -P httpd_read_user_content 1
217
218
219
220 If you want to allow Apache to run preupgrade, you must turn on the
221 httpd_run_preupgrade boolean. Disabled by default.
222
223 setsebool -P httpd_run_preupgrade 1
224
225
226
227 If you want to allow Apache to run in stickshift mode, not transition
228 to passenger, you must turn on the httpd_run_stickshift boolean. Dis‐
229 abled by default.
230
231 setsebool -P httpd_run_stickshift 1
232
233
234
235 If you want to allow HTTPD scripts and modules to server cobbler files,
236 you must turn on the httpd_serve_cobbler_files boolean. Disabled by de‐
237 fault.
238
239 setsebool -P httpd_serve_cobbler_files 1
240
241
242
243 If you want to allow httpd daemon to change its resource limits, you
244 must turn on the httpd_setrlimit boolean. Disabled by default.
245
246 setsebool -P httpd_setrlimit 1
247
248
249
250 If you want to allow HTTPD to run SSI executables in the same domain as
251 system CGI scripts, you must turn on the httpd_ssi_exec boolean. Dis‐
252 abled by default.
253
254 setsebool -P httpd_ssi_exec 1
255
256
257
258 If you want to unify HTTPD to communicate with the terminal. Needed for
259 entering the passphrase for certificates at the terminal, you must turn
260 on the httpd_tty_comm boolean. Disabled by default.
261
262 setsebool -P httpd_tty_comm 1
263
264
265
266 If you want to allow httpd to access cifs file systems, you must turn
267 on the httpd_use_cifs boolean. Disabled by default.
268
269 setsebool -P httpd_use_cifs 1
270
271
272
273 If you want to allow httpd to access FUSE file systems, you must turn
274 on the httpd_use_fusefs boolean. Disabled by default.
275
276 setsebool -P httpd_use_fusefs 1
277
278
279
280 If you want to allow httpd to access nfs file systems, you must turn on
281 the httpd_use_nfs boolean. Disabled by default.
282
283 setsebool -P httpd_use_nfs 1
284
285
286
287 If you want to allow httpd to use opencryptoki, you must turn on the
288 httpd_use_opencryptoki boolean. Disabled by default.
289
290 setsebool -P httpd_use_opencryptoki 1
291
292
293
294 If you want to allow httpd to access openstack ports, you must turn on
295 the httpd_use_openstack boolean. Disabled by default.
296
297 setsebool -P httpd_use_openstack 1
298
299
300
301 If you want to allow httpd to connect to sasl, you must turn on the
302 httpd_use_sasl boolean. Disabled by default.
303
304 setsebool -P httpd_use_sasl 1
305
306
307
308 If you want to allow Apache to query NS records, you must turn on the
309 httpd_verify_dns boolean. Disabled by default.
310
311 setsebool -P httpd_verify_dns 1
312
313
314
315 If you want to deny any process from ptracing or debugging any other
316 processes, you must turn on the deny_ptrace boolean. Enabled by de‐
317 fault.
318
319 setsebool -P deny_ptrace 1
320
321
322
323 If you want to allow all domains to execute in fips_mode, you must turn
324 on the fips_mode boolean. Enabled by default.
325
326 setsebool -P fips_mode 1
327
328
329
330 If you want to determine whether Git system daemon can access cifs file
331 systems, you must turn on the git_system_use_cifs boolean. Disabled by
332 default.
333
334 setsebool -P git_system_use_cifs 1
335
336
337
338 If you want to determine whether Git system daemon can access nfs file
339 systems, you must turn on the git_system_use_nfs boolean. Disabled by
340 default.
341
342 setsebool -P git_system_use_nfs 1
343
344
345
346 If you want to allow confined applications to run with kerberos, you
347 must turn on the kerberos_enabled boolean. Enabled by default.
348
349 setsebool -P kerberos_enabled 1
350
351
352
354 If you want to allow users to resolve user passwd entries directly from
355 ldap rather then using a sssd server for the httpd_t, you must turn on
356 the authlogin_nsswitch_use_ldap boolean.
357
358 setsebool -P authlogin_nsswitch_use_ldap 1
359
360
361 If you want to allow confined applications to run with kerberos for the
362 httpd_t, you must turn on the kerberos_enabled boolean.
363
364 setsebool -P kerberos_enabled 1
365
366
368 SELinux defines port types to represent TCP and UDP ports.
369
370 You can see the types associated with a port by using the following
371 command:
372
373 semanage port -l
374
375
376 Policy governs the access confined processes have to these ports.
377 SELinux httpd policy is very flexible allowing users to setup their
378 httpd processes in as secure a method as possible.
379
380 The following port types are defined for httpd:
381
382
383 http_cache_port_t
384
385
386
387 Default Defined Ports:
388 tcp 8080,8118,8123,10001-10010
389 udp 3130
390
391
392 http_port_t
393
394
395
396 Default Defined Ports:
397 tcp 80,81,443,488,8008,8009,8443,9000
398
400 The SELinux process type httpd_t can manage files labeled with the fol‐
401 lowing file types. The paths listed are the default paths for these
402 file types. Note the processes UID still need to have DAC permissions.
403
404 abrt_retrace_spool_t
405
406 /var/spool/faf(/.*)?
407 /var/spool/abrt-retrace(/.*)?
408 /var/spool/retrace-server(/.*)?
409
410 cifs_t
411
412
413 cluster_conf_t
414
415 /etc/cluster(/.*)?
416
417 cluster_var_lib_t
418
419 /var/lib/pcsd(/.*)?
420 /var/lib/cluster(/.*)?
421 /var/lib/openais(/.*)?
422 /var/lib/pengine(/.*)?
423 /var/lib/corosync(/.*)?
424 /usr/lib/heartbeat(/.*)?
425 /var/lib/heartbeat(/.*)?
426 /var/lib/pacemaker(/.*)?
427
428 cluster_var_run_t
429
430 /var/run/crm(/.*)?
431 /var/run/cman_.*
432 /var/run/rsctmp(/.*)?
433 /var/run/aisexec.*
434 /var/run/heartbeat(/.*)?
435 /var/run/pcsd-ruby.socket
436 /var/run/corosync-qnetd(/.*)?
437 /var/run/corosync-qdevice(/.*)?
438 /var/run/corosync.pid
439 /var/run/cpglockd.pid
440 /var/run/rgmanager.pid
441 /var/run/cluster/rgmanager.sk
442
443 cobbler_var_lib_t
444
445 /var/lib/cobbler(/.*)?
446 /var/www/cobbler(/.*)?
447 /var/cache/cobbler(/.*)?
448 /var/lib/tftpboot/etc(/.*)?
449 /var/lib/tftpboot/ppc(/.*)?
450 /var/lib/tftpboot/boot(/.*)?
451 /var/lib/tftpboot/grub(/.*)?
452 /var/lib/tftpboot/s390x(/.*)?
453 /var/lib/tftpboot/images(/.*)?
454 /var/lib/tftpboot/aarch64(/.*)?
455 /var/lib/tftpboot/images2(/.*)?
456 /var/lib/tftpboot/pxelinux.cfg(/.*)?
457 /var/lib/tftpboot/yaboot
458 /var/lib/tftpboot/memdisk
459 /var/lib/tftpboot/menu.c32
460 /var/lib/tftpboot/pxelinux.0
461
462 dirsrv_config_t
463
464 /etc/dirsrv(/.*)?
465
466 dirsrv_var_log_t
467
468 /var/log/dirsrv(/.*)?
469
470 dirsrv_var_run_t
471
472 /var/run/slapd.*
473 /var/run/dirsrv(/.*)?
474
475 dirsrvadmin_config_t
476
477 /etc/dirsrv/dsgw(/.*)?
478 /etc/dirsrv/admin-serv(/.*)?
479
480 dirsrvadmin_tmp_t
481
482
483 fusefs_t
484
485 /var/run/user/[0-9]+/gvfs
486
487 httpd_cache_t
488
489 /var/cache/rt(3|4)(/.*)?
490 /var/cache/ssl.*.sem
491 /var/cache/mod_.*
492 /var/cache/php-.*
493 /var/cache/httpd(/.*)?
494 /var/cache/mason(/.*)?
495 /var/cache/nginx(/.*)?
496 /var/cache/mod_ssl(/.*)?
497 /var/cache/lighttpd(/.*)?
498 /var/cache/mediawiki(/.*)?
499 /var/cache/mod_proxy(/.*)?
500 /var/cache/mod_gnutls(/.*)?
501 /var/cache/php-mmcache(/.*)?
502 /var/cache/php-eaccelerator(/.*)?
503
504 httpd_lock_t
505
506
507 httpd_squirrelmail_t
508
509 /var/lib/squirrelmail/prefs(/.*)?
510
511 httpd_tmp_t
512
513 /var/run/user/apache(/.*)?
514 /var/www/openshift/console/tmp(/.*)?
515
516 httpd_tmpfs_t
517
518
519 httpd_user_rw_content_t
520
521
522 httpd_var_lib_t
523
524 /var/lib/rt(3|4)/data/RT-Shredder(/.*)?
525 /var/lib/dav(/.*)?
526 /var/lib/php(/.*)?
527 /var/lib/glpi(/.*)?
528 /var/lib/httpd(/.*)?
529 /var/lib/nginx(/.*)?
530 /var/lib/z-push(/.*)?
531 /var/lib/ganglia(/.*)?
532 /var/lib/ipsilon(/.*)?
533 /var/lib/cherokee(/.*)?
534 /var/lib/lighttpd(/.*)?
535 /var/lib/mod_security(/.*)?
536 /var/lib/roundcubemail(/.*)?
537 /var/opt/rh/rh-nginx18/lib/nginx(/.*)?
538
539 httpd_var_run_t
540
541 /var/run/mod_.*
542 /var/run/wsgi.*
543 /var/run/httpd.*
544 /var/run/nginx.*
545 /var/run/apache.*
546 /var/run/php-fpm(/.*)?
547 /var/run/fcgiwrap(/.*)?
548 /var/run/lighttpd(/.*)?
549 /var/lib/php/session(/.*)?
550 /var/lib/php/wsdlcache(/.*)?
551 /var/run/dirsrv/admin-serv.*
552 /var/opt/rh/rh-nginx18/run/nginx(/.*)?
553 /var/www/openshift/broker/httpd/run(/.*)?
554 /var/www/openshift/console/httpd/run(/.*)?
555 /opt/dirsrv/var/run/dirsrv/dsgw/cookies(/.*)?
556 /var/run/thttpd.pid
557 /var/run/gcache_port
558 /var/run/cherokee.pid
559
560 httpdcontent
561
562
563 hugetlbfs_t
564
565 /dev/hugepages
566 /usr/lib/udev/devices/hugepages
567
568 insights_client_tmp_t
569
570 /var/tmp/insights-client(/.*)?
571 /tmp/insights-client.ppid
572 /var/tmp/insights-client.ppid
573
574 jetty_cache_t
575
576 /var/cache/jetty(/.*)?
577
578 jetty_log_t
579
580 /var/log/jetty(/.*)?
581
582 jetty_tmp_t
583
584
585 jetty_unit_file_t
586
587 /usr/lib/systemd/system/jetty.service
588
589 jetty_var_lib_t
590
591 /var/lib/jetty(/.*)?
592
593 jetty_var_run_t
594
595 /var/run/jetty(/.*)?
596
597 krb5_host_rcache_t
598
599 /var/tmp/krb5_0.rcache2
600 /var/cache/krb5rcache(/.*)?
601 /var/tmp/nfs_0
602 /var/tmp/DNS_25
603 /var/tmp/host_0
604 /var/tmp/imap_0
605 /var/tmp/HTTP_23
606 /var/tmp/HTTP_48
607 /var/tmp/ldap_55
608 /var/tmp/ldap_487
609 /var/tmp/ldapmap1_0
610
611 memcached_var_run_t
612
613 /var/run/memcached(/.*)?
614 /var/run/ipa_memcached(/.*)?
615
616 mirrormanager_var_run_t
617
618 /var/run/mirrormanager(/.*)?
619
620 named_cache_t
621
622 /var/named/data(/.*)?
623 /var/lib/softhsm(/.*)?
624 /var/lib/unbound(/.*)?
625 /var/named/slaves(/.*)?
626 /var/named/dynamic(/.*)?
627 /var/named/chroot/var/tmp(/.*)?
628 /var/named/chroot/var/named/data(/.*)?
629 /var/named/chroot/var/named/slaves(/.*)?
630 /var/named/chroot/var/named/dynamic(/.*)?
631
632 nfs_t
633
634
635 passenger_tmp_t
636
637
638 passenger_var_lib_t
639
640 /var/lib/passenger(/.*)?
641
642 passenger_var_run_t
643
644 /var/run/passenger(/.*)?
645
646 pkcs_slotd_lock_t
647
648 /var/lock/opencryptoki(/.*)?
649
650 pkcs_slotd_var_lib_t
651
652 /var/lib/opencryptoki(/.*)?
653
654 pki_apache_config
655
656
657 pki_apache_var_lib
658
659
660 pki_apache_var_log
661
662
663 postfix_spool_t
664
665 /var/spool/postfix.*
666 /var/spool/postfix/defer(/.*)?
667 /var/spool/postfix/flush(/.*)?
668 /var/spool/postfix/deferred(/.*)?
669 /var/spool/postfix/maildrop(/.*)?
670
671 preupgrade_data_t
672
673 /var/lib/preupgrade(/.*)?
674 /var/log/preupgrade(/.*)?
675
676 root_t
677
678 /sysroot/ostree/deploy/.*-atomic/deploy(/.*)?
679 /
680 /initrd
681
682 security_t
683
684 /selinux
685
686 squirrelmail_spool_t
687
688 /var/spool/squirrelmail(/.*)?
689
690 systemd_passwd_var_run_t
691
692 /var/run/systemd/ask-password(/.*)?
693 /var/run/systemd/ask-password-block(/.*)?
694
695 zarafa_var_lib_t
696
697 /var/lib/zarafa(/.*)?
698 /var/lib/zarafa-webapp(/.*)?
699 /var/lib/zarafa-webaccess(/.*)?
700
701 zoneminder_var_lib_t
702
703 /var/lib/zoneminder(/.*)?
704
705
707 SELinux requires files to have an extended attribute to define the file
708 type.
709
710 You can see the context of a file using the -Z option to ls
711
712 Policy governs the access confined processes have to these files.
713 SELinux httpd policy is very flexible allowing users to setup their
714 httpd processes in as secure a method as possible.
715
716 EQUIVALENCE DIRECTORIES
717
718
719 httpd policy stores data with multiple different file context types un‐
720 der the /var/lib/php directory. If you would like to store the data in
721 a different directory you can use the semanage command to create an
722 equivalence mapping. If you wanted to store this data under the /srv
723 directory you would execute the following command:
724
725 semanage fcontext -a -e /var/lib/php /srv/php
726 restorecon -R -v /srv/php
727
728 httpd policy stores data with multiple different file context types un‐
729 der the /var/www directory. If you would like to store the data in a
730 different directory you can use the semanage command to create an
731 equivalence mapping. If you wanted to store this data under the /srv
732 directory you would execute the following command:
733
734 semanage fcontext -a -e /var/www /srv/www
735 restorecon -R -v /srv/www
736
737 STANDARD FILE CONTEXT
738
739 SELinux defines the file context types for the httpd, if you wanted to
740 store files with these types in a diffent paths, you need to execute
741 the semanage command to specify alternate labeling and then use re‐
742 storecon to put the labels on disk.
743
744 semanage fcontext -a -t httpd_var_run_t '/srv/myhttpd_content(/.*)?'
745 restorecon -R -v /srv/myhttpd_content
746
747 Note: SELinux often uses regular expressions to specify labels that
748 match multiple files.
749
750 The following file types are defined for httpd:
751
752
753
754 httpd_cache_t
755
756 - Set files with the httpd_cache_t type, if you want to store the files
757 under the /var/cache directory.
758
759
760 Paths:
761 /var/cache/rt(3|4)(/.*)?, /var/cache/ssl.*.sem, /var/cache/mod_.*,
762 /var/cache/php-.*, /var/cache/httpd(/.*)?, /var/cache/mason(/.*)?,
763 /var/cache/nginx(/.*)?, /var/cache/mod_ssl(/.*)?,
764 /var/cache/lighttpd(/.*)?, /var/cache/mediawiki(/.*)?,
765 /var/cache/mod_proxy(/.*)?, /var/cache/mod_gnutls(/.*)?,
766 /var/cache/php-mmcache(/.*)?, /var/cache/php-eaccelerator(/.*)?
767
768
769 httpd_config_t
770
771 - Set files with the httpd_config_t type, if you want to treat the
772 files as httpd configuration data, usually stored under the /etc direc‐
773 tory.
774
775
776 Paths:
777 /etc/httpd(/.*)?, /etc/nginx(/.*)?, /etc/apache(2)?(/.*)?,
778 /etc/cherokee(/.*)?, /etc/lighttpd(/.*)?, /etc/apache-
779 ssl(2)?(/.*)?, /var/lib/openshift/.httpd.d(/.*)?, /etc/opt/rh/rh-
780 nginx18/nginx(/.*)?, /var/lib/stickshift/.httpd.d(/.*)?,
781 /etc/vhosts, /etc/thttpd.conf
782
783
784 httpd_exec_t
785
786 - Set files with the httpd_exec_t type, if you want to transition an
787 executable to the httpd_t domain.
788
789
790 Paths:
791 /usr/sbin/httpd(.worker)?, /usr/sbin/apache(2)?, /usr/lib/apache-
792 ssl/.+, /usr/sbin/apache-ssl(2)?, /usr/sbin/nginx,
793 /usr/sbin/thttpd, /usr/sbin/php-fpm, /usr/sbin/cherokee,
794 /usr/sbin/lighttpd, /usr/sbin/apachectl, /usr/sbin/httpd.event,
795 /usr/bin/mongrel_rails, /usr/sbin/htcacheclean
796
797
798 httpd_helper_exec_t
799
800 - Set files with the httpd_helper_exec_t type, if you want to transi‐
801 tion an executable to the httpd_helper_t domain.
802
803
804
805 httpd_initrc_exec_t
806
807 - Set files with the httpd_initrc_exec_t type, if you want to transi‐
808 tion an executable to the httpd_initrc_t domain.
809
810
811 Paths:
812 /etc/init.d/cherokee, /etc/rc.d/init.d/httpd,
813 /etc/rc.d/init.d/lighttpd
814
815
816 httpd_keytab_t
817
818 - Set files with the httpd_keytab_t type, if you want to treat the
819 files as kerberos keytab files.
820
821
822
823 httpd_lock_t
824
825 - Set files with the httpd_lock_t type, if you want to treat the files
826 as httpd lock data, stored under the /var/lock directory
827
828
829
830 httpd_log_t
831
832 - Set files with the httpd_log_t type, if you want to treat the data as
833 httpd log data, usually stored under the /var/log directory.
834
835
836 Paths:
837 /srv/([^/]*/)?www/logs(/.*)?, /var/www(/.*)?/logs(/.*)?,
838 /var/log/glpi(/.*)?, /var/log/cacti(/.*)?, /var/log/httpd(/.*)?,
839 /var/log/nginx(/.*)?, /var/log/apache(2)?(/.*)?, /var/log/hori‐
840 zon(/.*)?, /var/log/php-fpm(/.*)?, /var/log/cherokee(/.*)?,
841 /var/log/lighttpd(/.*)?, /var/log/suphp.log.*,
842 /var/log/thttpd.log.*, /var/log/apache-ssl(2)?(/.*)?,
843 /var/log/cgiwrap.log.*, /var/www/stickshift/[^/]*/log(/.*)?,
844 /var/log/graphite-web(/.*)?, /var/www/miq/vmdb/log(/.*)?,
845 /var/log/roundcubemail(/.*)?, /var/log/php_errors.log.*,
846 /var/log/dirsrv/admin-serv(/.*)?, /var/opt/rh/rh-ng‐
847 inx18/log(/.*)?, /var/lib/openshift/.log/httpd(/.*)?,
848 /var/www/openshift/console/log(/.*)?, /var/www/openshift/bro‐
849 ker/httpd/logs(/.*)?, /var/www/openshift/console/httpd/logs(/.*)?
850
851
852 httpd_modules_t
853
854 - Set files with the httpd_modules_t type, if you want to treat the
855 files as httpd modules.
856
857
858 Paths:
859 /usr/lib/httpd(/.*)?, /usr/lib/apache(/.*)?, /usr/lib/chero‐
860 kee(/.*)?, /usr/lib/lighttpd(/.*)?, /usr/lib/apache2/modules(/.*)?
861
862
863 httpd_passwd_exec_t
864
865 - Set files with the httpd_passwd_exec_t type, if you want to transi‐
866 tion an executable to the httpd_passwd_t domain.
867
868
869
870 httpd_php_exec_t
871
872 - Set files with the httpd_php_exec_t type, if you want to transition
873 an executable to the httpd_php_t domain.
874
875
876
877 httpd_php_tmp_t
878
879 - Set files with the httpd_php_tmp_t type, if you want to store httpd
880 php temporary files in the /tmp directories.
881
882
883
884 httpd_rotatelogs_exec_t
885
886 - Set files with the httpd_rotatelogs_exec_t type, if you want to tran‐
887 sition an executable to the httpd_rotatelogs_t domain.
888
889
890
891 httpd_squirrelmail_t
892
893 - Set files with the httpd_squirrelmail_t type, if you want to treat
894 the files as httpd squirrelmail data.
895
896
897
898 httpd_suexec_exec_t
899
900 - Set files with the httpd_suexec_exec_t type, if you want to transi‐
901 tion an executable to the httpd_suexec_t domain.
902
903
904 Paths:
905 /usr/lib/apache(2)?/suexec(2)?, /usr/lib/cgi-bin/(nph-)?cgi‐
906 wrap(d)?, /usr/sbin/suexec
907
908
909 httpd_suexec_tmp_t
910
911 - Set files with the httpd_suexec_tmp_t type, if you want to store
912 httpd suexec temporary files in the /tmp directories.
913
914
915
916 httpd_sys_content_t
917
918 - Set files with the httpd_sys_content_t type, if you want to treat the
919 files as httpd sys content.
920
921
922 Paths:
923 /srv/([^/]*/)?www(/.*)?, /var/www(/.*)?, /etc/htdig(/.*)?,
924 /srv/gallery2(/.*)?, /var/lib/trac(/.*)?, /var/lib/htdig(/.*)?,
925 /var/www/icons(/.*)?, /usr/share/glpi(/.*)?, /usr/share/ht‐
926 dig(/.*)?, /usr/share/drupal.*, /usr/share/z-push(/.*)?,
927 /var/www/svn/conf(/.*)?, /usr/share/icecast(/.*)?,
928 /var/lib/cacti/rra(/.*)?, /usr/share/ntop/html(/.*)?,
929 /usr/share/nginx/html(/.*)?, /usr/share/doc/ghc/html(/.*)?,
930 /usr/share/openca/htdocs(/.*)?, /usr/share/selinux-pol‐
931 icy[^/]*/html(/.*)?
932
933
934 httpd_sys_htaccess_t
935
936 - Set files with the httpd_sys_htaccess_t type, if you want to treat
937 the file as a httpd sys access file.
938
939
940
941 httpd_sys_ra_content_t
942
943 - Set files with the httpd_sys_ra_content_t type, if you want to treat
944 the files as httpd sys read/append content.
945
946
947
948 httpd_sys_rw_content_t
949
950 - Set files with the httpd_sys_rw_content_t type, if you want to treat
951 the files as httpd sys read/write content.
952
953
954 Paths:
955 /etc/rt(/.*)?, /etc/glpi(/.*)?, /etc/horde(/.*)?, /etc/drupal.*,
956 /etc/z-push(/.*)?, /var/lib/svn(/.*)?, /var/www/svn(/.*)?,
957 /etc/owncloud(/.*)?, /var/www/html(/.*)?/uploads(/.*)?,
958 /var/www/html(/.*)?/wp-content(/.*)?, /var/www/html(/.*)?/wp_back‐
959 ups(/.*)?, /var/www/html(/.*)?/sites/default/files(/.*)?,
960 /var/www/html(/.*)?/sites/default/settings.php,
961 /etc/mock/koji(/.*)?, /etc/nextcloud(/.*)?, /var/lib/drupal.*,
962 /etc/zabbix/web(/.*)?, /var/lib/moodle(/.*)?, /var/log/z-
963 push(/.*)?, /var/spool/gosa(/.*)?, /etc/WebCalendar(/.*)?,
964 /usr/share/joomla(/.*)?, /var/lib/dokuwiki(/.*)?, /var/lib/own‐
965 cloud(/.*)?, /var/spool/viewvc(/.*)?, /var/lib/nextcloud(/.*)?,
966 /var/lib/pootle/po(/.*)?, /var/lib/phpMyAdmin(/.*)?, /var/www/moo‐
967 dledata(/.*)?, /srv/gallery2/smarty(/.*)?, /var/www/moo‐
968 dle/data(/.*)?, /var/lib/graphite-web(/.*)?, /var/log/shibboleth-
969 www(/.*)?, /var/www/gallery/albums(/.*)?, /var/www/html/own‐
970 cloud/data(/.*)?, /var/www/html/nextcloud/data(/.*)?,
971 /usr/share/wordpress-mu/wp-content(/.*)?, /usr/share/wordpress/wp-
972 content/upgrade(/.*)?, /usr/share/wordpress/wp-content/up‐
973 loads(/.*)?, /var/www/html/configuration.php
974
975
976 httpd_sys_script_exec_t
977
978 - Set files with the httpd_sys_script_exec_t type, if you want to tran‐
979 sition an executable to the httpd_sys_script_t domain.
980
981
982 Paths:
983 /opt/.*.cgi, /usr/.*.cgi, /var/www/[^/]*/cgi-bin(/.*)?,
984 /var/www/perl(/.*)?, /var/www/html/[^/]*/cgi-bin(/.*)?,
985 /usr/lib/cgi-bin(/.*)?, /var/www/cgi-bin(/.*)?,
986 /var/www/svn/hooks(/.*)?, /usr/share/wordpress/.*.php, /usr/lo‐
987 cal/nagios/sbin(/.*)?, /usr/share/wordpress/wp-includes/.*.php,
988 /usr/share/wordpress-mu/wp-config.php
989
990
991 httpd_tmp_t
992
993 - Set files with the httpd_tmp_t type, if you want to store httpd tem‐
994 porary files in the /tmp directories.
995
996
997 Paths:
998 /var/run/user/apache(/.*)?, /var/www/openshift/console/tmp(/.*)?
999
1000
1001 httpd_tmpfs_t
1002
1003 - Set files with the httpd_tmpfs_t type, if you want to store httpd
1004 files on a tmpfs file system.
1005
1006
1007
1008 httpd_unconfined_script_exec_t
1009
1010 - Set files with the httpd_unconfined_script_exec_t type, if you want
1011 to transition an executable to the httpd_unconfined_script_t domain.
1012
1013
1014
1015 httpd_unit_file_t
1016
1017 - Set files with the httpd_unit_file_t type, if you want to treat the
1018 files as httpd unit content.
1019
1020
1021 Paths:
1022 /usr/lib/systemd/system/httpd.*, /usr/lib/systemd/system/nginx.*,
1023 /usr/lib/systemd/system/thttpd.*, /usr/lib/systemd/system/php-
1024 fpm.*
1025
1026
1027 httpd_user_content_t
1028
1029 - Set files with the httpd_user_content_t type, if you want to treat
1030 the files as httpd user content.
1031
1032
1033
1034 httpd_user_htaccess_t
1035
1036 - Set files with the httpd_user_htaccess_t type, if you want to treat
1037 the file as a httpd user access file.
1038
1039
1040
1041 httpd_user_ra_content_t
1042
1043 - Set files with the httpd_user_ra_content_t type, if you want to treat
1044 the files as httpd user read/append content.
1045
1046
1047
1048 httpd_user_rw_content_t
1049
1050 - Set files with the httpd_user_rw_content_t type, if you want to treat
1051 the files as httpd user read/write content.
1052
1053
1054
1055 httpd_user_script_exec_t
1056
1057 - Set files with the httpd_user_script_exec_t type, if you want to
1058 transition an executable to the httpd_user_script_t domain.
1059
1060
1061
1062 httpd_var_lib_t
1063
1064 - Set files with the httpd_var_lib_t type, if you want to store the
1065 httpd files under the /var/lib directory.
1066
1067
1068 Paths:
1069 /var/lib/rt(3|4)/data/RT-Shredder(/.*)?, /var/lib/dav(/.*)?,
1070 /var/lib/php(/.*)?, /var/lib/glpi(/.*)?, /var/lib/httpd(/.*)?,
1071 /var/lib/nginx(/.*)?, /var/lib/z-push(/.*)?, /var/lib/gan‐
1072 glia(/.*)?, /var/lib/ipsilon(/.*)?, /var/lib/cherokee(/.*)?,
1073 /var/lib/lighttpd(/.*)?, /var/lib/mod_security(/.*)?,
1074 /var/lib/roundcubemail(/.*)?, /var/opt/rh/rh-nginx18/lib/ng‐
1075 inx(/.*)?
1076
1077
1078 httpd_var_run_t
1079
1080 - Set files with the httpd_var_run_t type, if you want to store the
1081 httpd files under the /run or /var/run directory.
1082
1083
1084 Paths:
1085 /var/run/mod_.*, /var/run/wsgi.*, /var/run/httpd.*, /var/run/ng‐
1086 inx.*, /var/run/apache.*, /var/run/php-fpm(/.*)?, /var/run/fcgi‐
1087 wrap(/.*)?, /var/run/lighttpd(/.*)?, /var/lib/php/session(/.*)?,
1088 /var/lib/php/wsdlcache(/.*)?, /var/run/dirsrv/admin-serv.*,
1089 /var/opt/rh/rh-nginx18/run/nginx(/.*)?, /var/www/openshift/bro‐
1090 ker/httpd/run(/.*)?, /var/www/openshift/console/httpd/run(/.*)?,
1091 /opt/dirsrv/var/run/dirsrv/dsgw/cookies(/.*)?,
1092 /var/run/thttpd.pid, /var/run/gcache_port, /var/run/cherokee.pid
1093
1094
1095 Note: File context can be temporarily modified with the chcon command.
1096 If you want to permanently change the file context you need to use the
1097 semanage fcontext command. This will modify the SELinux labeling data‐
1098 base. You will need to use restorecon to apply the labels.
1099
1100
1102 If you want to share files with multiple domains (Apache, FTP, rsync,
1103 Samba), you can set a file context of public_content_t and public_con‐
1104 tent_rw_t. These context allow any of the above domains to read the
1105 content. If you want a particular domain to write to the public_con‐
1106 tent_rw_t domain, you must set the appropriate boolean.
1107
1108 Allow httpd servers to read the /var/httpd directory by adding the pub‐
1109 lic_content_t file type to the directory and by restoring the file
1110 type.
1111
1112 semanage fcontext -a -t public_content_t "/var/httpd(/.*)?"
1113 restorecon -F -R -v /var/httpd
1114
1115 Allow httpd servers to read and write /var/httpd/incoming by adding the
1116 public_content_rw_t type to the directory and by restoring the file
1117 type. You also need to turn on the httpd_anon_write boolean.
1118
1119 semanage fcontext -a -t public_content_rw_t "/var/httpd/incoming(/.*)?"
1120 restorecon -F -R -v /var/httpd/incoming
1121 setsebool -P httpd_anon_write 1
1122
1123
1124 If you want to allow Apache to modify public files used for public file
1125 transfer services. Directories/Files must be labeled public_con‐
1126 tent_rw_t., you must turn on the httpd_anon_write boolean.
1127
1128 setsebool -P httpd_anon_write 1
1129
1130
1132 semanage fcontext can also be used to manipulate default file context
1133 mappings.
1134
1135 semanage permissive can also be used to manipulate whether or not a
1136 process type is permissive.
1137
1138 semanage module can also be used to enable/disable/install/remove pol‐
1139 icy modules.
1140
1141 semanage port can also be used to manipulate the port definitions
1142
1143 semanage boolean can also be used to manipulate the booleans
1144
1145
1146 system-config-selinux is a GUI tool available to customize SELinux pol‐
1147 icy settings.
1148
1149
1151 This manual page was auto-generated using sepolicy manpage .
1152
1153
1155 selinux(8), httpd(8), semanage(8), restorecon(8), chcon(1), sepol‐
1156 icy(8), setsebool(8), httpd_helper_selinux(8), httpd_passwd_selinux(8),
1157 httpd_php_selinux(8), httpd_rotatelogs_selinux(8),
1158 httpd_suexec_selinux(8), httpd_sys_script_selinux(8), httpd_uncon‐
1159 fined_script_selinux(8), httpd_user_script_selinux(8)
1160
1161
1162
1163httpd 23-02-03 httpd_selinux(8)