1httpd_sys_script_selinux(S8E)Linux Policy httpd_sys_scrhitpttpd_sys_script_selinux(8)
2
3
4

NAME

6       httpd_sys_script_selinux  -  Security  Enhanced  Linux  Policy  for the
7       httpd_sys_script processes
8

DESCRIPTION

10       Security-Enhanced Linux  secures  the  httpd_sys_script  processes  via
11       flexible mandatory access control.
12
13       The  httpd_sys_script  processes  execute  with  the httpd_sys_script_t
14       SELinux type. You can check if you have these processes running by exe‐
15       cuting the ps command with the -Z qualifier.
16
17       For example:
18
19       ps -eZ | grep httpd_sys_script_t
20
21
22

ENTRYPOINTS

24       The   httpd_sys_script_t   SELinux   type   can   be  entered  via  the
25       httpd_sys_script_exec_t, httpd_sys_content_t, cifs_t, nfs_t,  httpdcon‐
26       tent file types.
27
28       The  default entrypoint paths for the httpd_sys_script_t domain are the
29       following:
30
31       /opt/.*.cgi,         /usr/.*.cgi,         /var/www/[^/]*/cgi-bin(/.*)?,
32       /var/www/perl(/.*)?,  /var/www/html/[^/]*/cgi-bin(/.*)?,  /usr/lib/cgi-
33       bin(/.*)?,      /var/www/cgi-bin(/.*)?,       /var/www/svn/hooks(/.*)?,
34       /usr/share/wordpress/.*.php,              /usr/local/nagios/sbin(/.*)?,
35       /usr/share/wordpress/wp-includes/.*.php,    /usr/share/wordpress-mu/wp-
36       config.php,  /srv/([^/]*/)?www(/.*)?, /var/www(/.*)?, /etc/htdig(/.*)?,
37       /srv/gallery2(/.*)?,     /var/lib/trac(/.*)?,     /var/lib/htdig(/.*)?,
38       /var/www/icons(/.*)?,   /usr/share/glpi(/.*)?,  /usr/share/htdig(/.*)?,
39       /usr/share/drupal.*, /usr/share/z-push(/.*)?,  /var/www/svn/conf(/.*)?,
40       /usr/share/icecast(/.*)?,                     /var/lib/cacti/rra(/.*)?,
41       /usr/share/ntop/html(/.*)?,                /usr/share/nginx/html(/.*)?,
42       /usr/share/doc/ghc/html(/.*)?,          /usr/share/openca/htdocs(/.*)?,
43       /usr/share/selinux-policy[^/]*/html(/.*)?
44

PROCESS TYPES

46       SELinux defines process types (domains) for each process running on the
47       system
48
49       You can see the context of a process using the -Z option to ps
50
51       Policy  governs  the  access confined processes have to files.  SELinux
52       httpd_sys_script policy is very flexible allowing users to setup  their
53       httpd_sys_script processes in as secure a method as possible.
54
55       The following process types are defined for httpd_sys_script:
56
57       httpd_sys_script_t
58
59       Note: semanage permissive -a httpd_sys_script_t can be used to make the
60       process type httpd_sys_script_t permissive. SELinux does not  deny  ac‐
61       cess  to  permissive  process types, but the AVC (SELinux denials) mes‐
62       sages are still generated.
63
64

BOOLEANS

66       SELinux  policy  is  customizable  based  on  least  access   required.
67       httpd_sys_script  policy is extremely flexible and has several booleans
68       that allow you to manipulate the policy and run  httpd_sys_script  with
69       the tightest access possible.
70
71
72
73       If you want to allow all domains to execute in fips_mode, you must turn
74       on the fips_mode boolean. Enabled by default.
75
76       setsebool -P fips_mode 1
77
78
79
80       If you want to allow httpd to use built in scripting (usually php), you
81       must turn on the httpd_builtin_scripting boolean. Enabled by default.
82
83       setsebool -P httpd_builtin_scripting 1
84
85
86
87       If  you want to allow httpd to manage the courier spool sock files, you
88       must turn on the httpd_can_manage_courier_spool  boolean.  Disabled  by
89       default.
90
91       setsebool -P httpd_can_manage_courier_spool 1
92
93
94
95       If  you  want to allow HTTPD scripts and modules to connect to the net‐
96       work using TCP, you must turn on the httpd_can_network_connect boolean.
97       Disabled by default.
98
99       setsebool -P httpd_can_network_connect 1
100
101
102
103       If  you want to allow HTTPD scripts and modules to connect to databases
104       over the network, you must  turn  on  the  httpd_can_network_connect_db
105       boolean. Disabled by default.
106
107       setsebool -P httpd_can_network_connect_db 1
108
109
110
111       If  you  want  to  allow http daemon to send mail, you must turn on the
112       httpd_can_sendmail boolean. Disabled by default.
113
114       setsebool -P httpd_can_sendmail 1
115
116
117
118       If you want to allow httpd cgi support, you must turn on the  httpd_en‐
119       able_cgi boolean. Enabled by default.
120
121       setsebool -P httpd_enable_cgi 1
122
123
124
125       If  you  want to allow httpd to read home directories, you must turn on
126       the httpd_enable_homedirs boolean. Disabled by default.
127
128       setsebool -P httpd_enable_homedirs 1
129
130
131
132       If you want to allow httpd scripts and modules  execmem/execstack,  you
133       must turn on the httpd_execmem boolean. Disabled by default.
134
135       setsebool -P httpd_execmem 1
136
137
138
139       If  you  want to allow httpd to read user content, you must turn on the
140       httpd_read_user_content boolean. Disabled by default.
141
142       setsebool -P httpd_read_user_content 1
143
144
145
146       If you want to allow HTTPD to run SSI executables in the same domain as
147       system  CGI  scripts, you must turn on the httpd_ssi_exec boolean. Dis‐
148       abled by default.
149
150       setsebool -P httpd_ssi_exec 1
151
152
153
154       If you want to allow Apache to execute tmp content, you  must  turn  on
155       the httpd_tmp_exec boolean. Disabled by default.
156
157       setsebool -P httpd_tmp_exec 1
158
159
160
161       If you want to unify HTTPD handling of all content files, you must turn
162       on the httpd_unified boolean. Disabled by default.
163
164       setsebool -P httpd_unified 1
165
166
167
168       If you want to allow httpd to access cifs file systems, you  must  turn
169       on the httpd_use_cifs boolean. Disabled by default.
170
171       setsebool -P httpd_use_cifs 1
172
173
174
175       If  you  want to allow httpd to access FUSE file systems, you must turn
176       on the httpd_use_fusefs boolean. Disabled by default.
177
178       setsebool -P httpd_use_fusefs 1
179
180
181
182       If you want to allow httpd to access nfs file systems, you must turn on
183       the httpd_use_nfs boolean. Disabled by default.
184
185       setsebool -P httpd_use_nfs 1
186
187
188
189       If  you want to allow httpd to access openstack ports, you must turn on
190       the httpd_use_openstack boolean. Disabled by default.
191
192       setsebool -P httpd_use_openstack 1
193
194
195
196       If you want to allow system to run with  NIS,  you  must  turn  on  the
197       nis_enabled boolean. Disabled by default.
198
199       setsebool -P nis_enabled 1
200
201
202
203       If  you  want  to  support  NFS  home directories, you must turn on the
204       use_nfs_home_dirs boolean. Disabled by default.
205
206       setsebool -P use_nfs_home_dirs 1
207
208
209
210       If you want to support SAMBA home directories, you  must  turn  on  the
211       use_samba_home_dirs boolean. Disabled by default.
212
213       setsebool -P use_samba_home_dirs 1
214
215
216

MANAGED FILES

218       The  SELinux  process  type httpd_sys_script_t can manage files labeled
219       with the following file types.  The paths listed are the default  paths
220       for  these  file  types.  Note the processes UID still need to have DAC
221       permissions.
222
223       fusefs_t
224
225            /var/run/user/[0-9]+/gvfs
226
227       httpd_sys_rw_content_t
228
229            /etc/rt(/.*)?
230            /etc/glpi(/.*)?
231            /etc/horde(/.*)?
232            /etc/drupal.*
233            /etc/z-push(/.*)?
234            /var/lib/svn(/.*)?
235            /var/www/svn(/.*)?
236            /etc/owncloud(/.*)?
237            /var/www/html(/.*)?/uploads(/.*)?
238            /var/www/html(/.*)?/wp-content(/.*)?
239            /var/www/html(/.*)?/wp_backups(/.*)?
240            /var/www/html(/.*)?/sites/default/files(/.*)?
241            /var/www/html(/.*)?/sites/default/settings.php
242            /etc/mock/koji(/.*)?
243            /etc/nextcloud(/.*)?
244            /var/lib/drupal.*
245            /etc/zabbix/web(/.*)?
246            /var/lib/moodle(/.*)?
247            /var/log/z-push(/.*)?
248            /var/spool/gosa(/.*)?
249            /etc/WebCalendar(/.*)?
250            /usr/share/joomla(/.*)?
251            /var/lib/dokuwiki(/.*)?
252            /var/lib/httpd/md(/.*)?
253            /var/lib/owncloud(/.*)?
254            /var/spool/viewvc(/.*)?
255            /var/lib/nextcloud(/.*)?
256            /var/lib/pootle/po(/.*)?
257            /var/lib/phpMyAdmin(/.*)?
258            /var/www/moodledata(/.*)?
259            /srv/gallery2/smarty(/.*)?
260            /var/www/moodle/data(/.*)?
261            /var/lib/graphite-web(/.*)?
262            /var/log/shibboleth-www(/.*)?
263            /var/www/gallery/albums(/.*)?
264            /var/www/html/owncloud/data(/.*)?
265            /var/www/html/nextcloud/data(/.*)?
266            /usr/share/wordpress-mu/wp-content(/.*)?
267            /usr/share/wordpress/wp-content/upgrade(/.*)?
268            /usr/share/wordpress/wp-content/uploads(/.*)?
269            /var/www/html/configuration.php
270
271       httpd_tmp_t
272
273            /var/run/user/apache(/.*)?
274            /var/www/openshift/console/tmp(/.*)?
275
276       httpdcontent
277
278
279       hugetlbfs_t
280
281            /dev/hugepages
282            /usr/lib/udev/devices/hugepages
283
284       krb5_host_rcache_t
285
286            /var/tmp/krb5_0.rcache2
287            /var/cache/krb5rcache(/.*)?
288            /var/tmp/nfs_0
289            /var/tmp/DNS_25
290            /var/tmp/host_0
291            /var/tmp/imap_0
292            /var/tmp/HTTP_23
293            /var/tmp/HTTP_48
294            /var/tmp/ldap_55
295            /var/tmp/ldap_487
296            /var/tmp/ldapmap1_0
297
298

FILE CONTEXTS

300       SELinux requires files to have an extended attribute to define the file
301       type.
302
303       You can see the context of a file using the -Z option to ls
304
305       Policy  governs  the  access  confined  processes  have to these files.
306       SELinux httpd_sys_script policy is  very  flexible  allowing  users  to
307       setup  their httpd_sys_script processes in as secure a method as possi‐
308       ble.
309
310       STANDARD FILE CONTEXT
311
312       SELinux defines the file context types for the httpd_sys_script, if you
313       wanted  to  store files with these types in a different paths, you need
314       to execute the semanage command to specify alternate labeling and  then
315       use restorecon to put the labels on disk.
316
317       semanage       fcontext       -a       -t       httpd_sys_script_exec_t
318       '/srv/httpd_sys_script/content(/.*)?'
319       restorecon -R -v /srv/myhttpd_sys_script_content
320
321       Note: SELinux often uses regular expressions  to  specify  labels  that
322       match multiple files.
323
324       The following file types are defined for httpd_sys_script:
325
326
327
328       httpd_sys_script_exec_t
329
330       - Set files with the httpd_sys_script_exec_t type, if you want to tran‐
331       sition an executable to the httpd_sys_script_t domain.
332
333
334       Paths:
335            /opt/.*.cgi,      /usr/.*.cgi,       /var/www/[^/]*/cgi-bin(/.*)?,
336            /var/www/perl(/.*)?,            /var/www/html/[^/]*/cgi-bin(/.*)?,
337            /usr/lib/cgi-bin(/.*)?,                    /var/www/cgi-bin(/.*)?,
338            /var/www/svn/hooks(/.*)?,   /usr/share/wordpress/.*.php,  /usr/lo‐
339            cal/nagios/sbin(/.*)?,    /usr/share/wordpress/wp-includes/.*.php,
340            /usr/share/wordpress-mu/wp-config.php
341
342
343       Note:  File context can be temporarily modified with the chcon command.
344       If you want to permanently change the file context you need to use  the
345       semanage fcontext command.  This will modify the SELinux labeling data‐
346       base.  You will need to use restorecon to apply the labels.
347
348

SHARING FILES

350       If you want to share files with multiple domains (Apache,  FTP,  rsync,
351       Samba),  you can set a file context of public_content_t and public_con‐
352       tent_rw_t.  These context allow any of the above domains  to  read  the
353       content.   If  you want a particular domain to write to the public_con‐
354       tent_rw_t domain, you must set the appropriate boolean.
355
356       Allow httpd_sys_script servers to read the /var/httpd_sys_script direc‐
357       tory  by  adding the public_content_t file type to the directory and by
358       restoring the file type.
359
360       semanage fcontext -a -t public_content_t "/var/httpd_sys_script(/.*)?"
361       restorecon -F -R -v /var/httpd_sys_script
362
363       Allow    httpd_sys_script     servers     to     read     and     write
364       /var/httpd_sys_script/incoming  by  adding the public_content_rw_t type
365       to the directory and by restoring the file type.  You also need to turn
366       on the httpd_sys_script_anon_write boolean.
367
368       semanage  fcontext -a -t public_content_rw_t "/var/httpd_sys_script/in‐
369       coming(/.*)?"
370       restorecon -F -R -v /var/httpd_sys_script/incoming
371       setsebool -P httpd_sys_script_anon_write 1
372
373
374       If you want to allow apache scripts to write to public content,  direc‐
375       tories/files must be labeled public_rw_content_t., you must turn on the
376       httpd_sys_script_anon_write boolean.
377
378       setsebool -P httpd_sys_script_anon_write 1
379
380

COMMANDS

382       semanage fcontext can also be used to manipulate default  file  context
383       mappings.
384
385       semanage  permissive  can  also  be used to manipulate whether or not a
386       process type is permissive.
387
388       semanage module can also be used to enable/disable/install/remove  pol‐
389       icy modules.
390
391       semanage boolean can also be used to manipulate the booleans
392
393
394       system-config-selinux is a GUI tool available to customize SELinux pol‐
395       icy settings.
396
397

AUTHOR

399       This manual page was auto-generated using sepolicy manpage .
400
401

SEE ALSO

403       selinux(8), httpd_sys_script(8), semanage(8), restorecon(8),  chcon(1),
404       sepolicy(8), setsebool(8)
405
406
407
408httpd_sys_script                   23-12-15        httpd_sys_script_selinux(8)
Impressum