1ftpd_selinux(8)               SELinux Policy ftpd              ftpd_selinux(8)
2
3
4

NAME

6       ftpd_selinux - Security Enhanced Linux Policy for the ftpd processes
7

DESCRIPTION

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

ENTRYPOINTS

23       The ftpd_t SELinux type can be entered via the ftpd_exec_t file type.
24
25       The default entrypoint paths for the ftpd_t domain are the following:
26
27       /usr/sbin/ftpwho,         /usr/sbin/vsftpd,          /usr/sbin/in.ftpd,
28       /usr/sbin/proftpd,    /usr/sbin/muddleftpd,    /usr/kerberos/sbin/ftpd,
29       /etc/cron.monthly/proftpd
30

PROCESS TYPES

32       SELinux defines process types (domains) for each process running on the
33       system
34
35       You can see the context of a process using the -Z option to ps
36
37       Policy  governs  the  access confined processes have to files.  SELinux
38       ftpd policy is very flexible allowing users to setup  their  ftpd  pro‐
39       cesses in as secure a method as possible.
40
41       The following process types are defined for ftpd:
42
43       ftpd_t, ftpdctl_t
44
45       Note:  semanage  permissive  -a  ftpd_t can be used to make the process
46       type ftpd_t permissive. SELinux does  not  deny  access  to  permissive
47       process  types, but the AVC (SELinux denials) messages are still gener‐
48       ated.
49
50

BOOLEANS

52       SELinux policy is customizable based on least  access  required.   ftpd
53       policy is extremely flexible and has several booleans that allow you to
54       manipulate the policy and run ftpd with the tightest access possible.
55
56
57
58       If you want to determine whether ftpd can  connect  to  all  unreserved
59       ports,  you  must turn on the ftpd_connect_all_unreserved boolean. Dis‐
60       abled by default.
61
62       setsebool -P ftpd_connect_all_unreserved 1
63
64
65
66       If you want to determine whether ftpd can connect to databases over the
67       TCP  network, you must turn on the ftpd_connect_db boolean. Disabled by
68       default.
69
70       setsebool -P ftpd_connect_db 1
71
72
73
74       If you want to determine whether ftpd can login to local users and  can
75       read  and write all files on the system, governed by DAC, you must turn
76       on the ftpd_full_access boolean. Disabled by default.
77
78       setsebool -P ftpd_full_access 1
79
80
81
82       If you want to determine whether ftpd can use CIFS used for public file
83       transfer services, you must turn on the ftpd_use_cifs boolean. Disabled
84       by default.
85
86       setsebool -P ftpd_use_cifs 1
87
88
89
90       If you want to allow ftpd to use ntfs/fusefs volumes, you must turn  on
91       the ftpd_use_fusefs boolean. Disabled by default.
92
93       setsebool -P ftpd_use_fusefs 1
94
95
96
97       If  you want to determine whether ftpd can use NFS used for public file
98       transfer services, you must turn on the ftpd_use_nfs boolean.  Disabled
99       by default.
100
101       setsebool -P ftpd_use_nfs 1
102
103
104
105       If  you want to determine whether ftpd can bind to all unreserved ports
106       for passive mode, you must turn on the  ftpd_use_passive_mode  boolean.
107       Disabled by default.
108
109       setsebool -P ftpd_use_passive_mode 1
110
111
112
113       If you want to allow users to resolve user passwd entries directly from
114       ldap rather then using a sssd server, you  must  turn  on  the  authlo‐
115       gin_nsswitch_use_ldap boolean. Disabled by default.
116
117       setsebool -P authlogin_nsswitch_use_ldap 1
118
119
120
121       If you want to allow all daemons to write corefiles to /, you must turn
122       on the daemons_dump_core boolean. Disabled by default.
123
124       setsebool -P daemons_dump_core 1
125
126
127
128       If you want to enable cluster mode for daemons, you must  turn  on  the
129       daemons_enable_cluster_mode boolean. Enabled by default.
130
131       setsebool -P daemons_enable_cluster_mode 1
132
133
134
135       If  you want to allow all daemons to use tcp wrappers, you must turn on
136       the daemons_use_tcp_wrapper boolean. Disabled by default.
137
138       setsebool -P daemons_use_tcp_wrapper 1
139
140
141
142       If you want to allow all daemons the ability to  read/write  terminals,
143       you must turn on the daemons_use_tty boolean. Disabled by default.
144
145       setsebool -P daemons_use_tty 1
146
147
148
149       If  you  want  to deny any process from ptracing or debugging any other
150       processes, you  must  turn  on  the  deny_ptrace  boolean.  Enabled  by
151       default.
152
153       setsebool -P deny_ptrace 1
154
155
156
157       If  you  want  to  allow  any  process  to mmap any file on system with
158       attribute file_type, you must turn on the  domain_can_mmap_files  bool‐
159       ean. Enabled by default.
160
161       setsebool -P domain_can_mmap_files 1
162
163
164
165       If  you want to allow all domains write to kmsg_device, while kernel is
166       executed with systemd.log_target=kmsg parameter, you must turn  on  the
167       domain_can_write_kmsg boolean. Disabled by default.
168
169       setsebool -P domain_can_write_kmsg 1
170
171
172
173       If you want to allow all domains to use other domains file descriptors,
174       you must turn on the domain_fd_use boolean. Enabled by default.
175
176       setsebool -P domain_fd_use 1
177
178
179
180       If you want to allow all domains to have the kernel load  modules,  you
181       must  turn  on  the  domain_kernel_load_modules  boolean.  Disabled  by
182       default.
183
184       setsebool -P domain_kernel_load_modules 1
185
186
187
188       If you want to allow all domains to execute in fips_mode, you must turn
189       on the fips_mode boolean. Enabled by default.
190
191       setsebool -P fips_mode 1
192
193
194
195       If you want to enable reading of urandom for all domains, you must turn
196       on the global_ssp boolean. Disabled by default.
197
198       setsebool -P global_ssp 1
199
200
201
202       If you want to allow confined applications to run  with  kerberos,  you
203       must turn on the kerberos_enabled boolean. Enabled by default.
204
205       setsebool -P kerberos_enabled 1
206
207
208
209       If  you  want  to  allow  system  to run with NIS, you must turn on the
210       nis_enabled boolean. Disabled by default.
211
212       setsebool -P nis_enabled 1
213
214
215
216       If you want to allow confined applications to use nscd  shared  memory,
217       you must turn on the nscd_use_shm boolean. Disabled by default.
218
219       setsebool -P nscd_use_shm 1
220
221
222
223       If  you  want  to  support  NFS  home directories, you must turn on the
224       use_nfs_home_dirs boolean. Disabled by default.
225
226       setsebool -P use_nfs_home_dirs 1
227
228
229
230       If you want to support SAMBA home directories, you  must  turn  on  the
231       use_samba_home_dirs boolean. Disabled by default.
232
233       setsebool -P use_samba_home_dirs 1
234
235
236

PORT TYPES

238       SELinux defines port types to represent TCP and UDP ports.
239
240       You  can  see  the  types associated with a port by using the following
241       command:
242
243       semanage port -l
244
245
246       Policy governs the access  confined  processes  have  to  these  ports.
247       SELinux ftpd policy is very flexible allowing users to setup their ftpd
248       processes in as secure a method as possible.
249
250       The following port types are defined for ftpd:
251
252
253       ftp_data_port_t
254
255
256
257       Default Defined Ports:
258                 tcp 20
259
260
261       ftp_port_t
262
263
264
265       Default Defined Ports:
266                 tcp 21,989,990
267                 udp 989,990
268

MANAGED FILES

270       The SELinux process type ftpd_t can manage files labeled with the  fol‐
271       lowing  file  types.   The paths listed are the default paths for these
272       file types.  Note the processes UID still need to have DAC permissions.
273
274       cifs_t
275
276
277       cluster_var_lib_t
278
279            /var/lib/pcsd(/.*)?
280            /var/lib/cluster(/.*)?
281            /var/lib/openais(/.*)?
282            /var/lib/pengine(/.*)?
283            /var/lib/corosync(/.*)?
284            /usr/lib/heartbeat(/.*)?
285            /var/lib/heartbeat(/.*)?
286            /var/lib/pacemaker(/.*)?
287
288       cluster_var_run_t
289
290            /var/run/crm(/.*)?
291            /var/run/cman_.*
292            /var/run/rsctmp(/.*)?
293            /var/run/aisexec.*
294            /var/run/heartbeat(/.*)?
295            /var/run/corosync-qnetd(/.*)?
296            /var/run/corosync-qdevice(/.*)?
297            /var/run/cpglockd.pid
298            /var/run/corosync.pid
299            /var/run/rgmanager.pid
300            /var/run/cluster/rgmanager.sk
301
302       httpd_user_content_t
303
304            /home/[^/]+/((www)|(web)|(public_html))(/.+)?
305
306       krb5_host_rcache_t
307
308            /var/cache/krb5rcache(/.*)?
309            /var/tmp/nfs_0
310            /var/tmp/DNS_25
311            /var/tmp/host_0
312            /var/tmp/imap_0
313            /var/tmp/HTTP_23
314            /var/tmp/HTTP_48
315            /var/tmp/ldap_55
316            /var/tmp/ldap_487
317            /var/tmp/ldapmap1_0
318
319       non_security_file_type
320
321
322       user_home_t
323
324            /home/[^/]+/.+
325
326       user_tmp_t
327
328            /dev/shm/mono.*
329            /var/run/user(/.*)?
330            /tmp/.X11-unix(/.*)?
331            /tmp/.ICE-unix(/.*)?
332            /dev/shm/pulse-shm.*
333            /tmp/.X0-lock
334            /tmp/hsperfdata_root
335            /var/tmp/hsperfdata_root
336            /home/[^/]+/tmp
337            /home/[^/]+/.tmp
338            /tmp/gconfd-[^/]+
339
340

FILE CONTEXTS

342       SELinux requires files to have an extended attribute to define the file
343       type.
344
345       You can see the context of a file using the -Z option to ls
346
347       Policy  governs  the  access  confined  processes  have to these files.
348       SELinux ftpd policy is very flexible allowing users to setup their ftpd
349       processes in as secure a method as possible.
350
351       STANDARD FILE CONTEXT
352
353       SELinux  defines  the file context types for the ftpd, if you wanted to
354       store files with these types in a diffent paths, you  need  to  execute
355       the  semanage  command  to  sepecify  alternate  labeling  and then use
356       restorecon to put the labels on disk.
357
358       semanage fcontext -a -t ftpdctl_tmp_t '/srv/myftpd_content(/.*)?'
359       restorecon -R -v /srv/myftpd_content
360
361       Note: SELinux often uses regular expressions  to  specify  labels  that
362       match multiple files.
363
364       The following file types are defined for ftpd:
365
366
367
368       ftpd_etc_t
369
370       -  Set  files with the ftpd_etc_t type, if you want to store ftpd files
371       in the /etc directories.
372
373
374
375       ftpd_exec_t
376
377       - Set files with the ftpd_exec_t type, if you  want  to  transition  an
378       executable to the ftpd_t domain.
379
380
381       Paths:
382            /usr/sbin/ftpwho,       /usr/sbin/vsftpd,       /usr/sbin/in.ftpd,
383            /usr/sbin/proftpd, /usr/sbin/muddleftpd,  /usr/kerberos/sbin/ftpd,
384            /etc/cron.monthly/proftpd
385
386
387       ftpd_initrc_exec_t
388
389       - Set files with the ftpd_initrc_exec_t type, if you want to transition
390       an executable to the ftpd_initrc_t domain.
391
392
393       Paths:
394            /etc/rc.d/init.d/vsftpd, /etc/rc.d/init.d/proftpd
395
396
397       ftpd_keytab_t
398
399       - Set files with the ftpd_keytab_t type, if you want to treat the files
400       as kerberos keytab files.
401
402
403
404       ftpd_lock_t
405
406       -  Set  files with the ftpd_lock_t type, if you want to treat the files
407       as ftpd lock data, stored under the /var/lock directory
408
409
410
411       ftpd_tmp_t
412
413       - Set files with the ftpd_tmp_t type, if you want to store ftpd  tempo‐
414       rary files in the /tmp directories.
415
416
417
418       ftpd_tmpfs_t
419
420       - Set files with the ftpd_tmpfs_t type, if you want to store ftpd files
421       on a tmpfs file system.
422
423
424
425       ftpd_unit_file_t
426
427       - Set files with the ftpd_unit_file_t type, if you want  to  treat  the
428       files as ftpd unit content.
429
430
431
432       ftpd_var_run_t
433
434       - Set files with the ftpd_var_run_t type, if you want to store the ftpd
435       files under the /run or /var/run directory.
436
437
438
439       ftpdctl_exec_t
440
441       - Set files with the ftpdctl_exec_t type, if you want to transition  an
442       executable to the ftpdctl_t domain.
443
444
445
446       ftpdctl_tmp_t
447
448       -  Set  files with the ftpdctl_tmp_t type, if you want to store ftpdctl
449       temporary files in the /tmp directories.
450
451
452
453       Note: File context can be temporarily modified with the chcon  command.
454       If  you want to permanently change the file context you need to use the
455       semanage fcontext command.  This will modify the SELinux labeling data‐
456       base.  You will need to use restorecon to apply the labels.
457
458

SHARING FILES

460       If  you  want to share files with multiple domains (Apache, FTP, rsync,
461       Samba), you can set a file context of public_content_t and  public_con‐
462       tent_rw_t.   These  context  allow any of the above domains to read the
463       content.  If you want a particular domain to write to  the  public_con‐
464       tent_rw_t domain, you must set the appropriate boolean.
465
466       Allow  ftpd  servers to read the /var/ftpd directory by adding the pub‐
467       lic_content_t file type to the directory  and  by  restoring  the  file
468       type.
469
470       semanage fcontext -a -t public_content_t "/var/ftpd(/.*)?"
471       restorecon -F -R -v /var/ftpd
472
473       Allow  ftpd  servers to read and write /var/ftpd/incoming by adding the
474       public_content_rw_t type to the directory and  by  restoring  the  file
475       type.  You also need to turn on the ftpd_anon_write boolean.
476
477       semanage fcontext -a -t public_content_rw_t "/var/ftpd/incoming(/.*)?"
478       restorecon -F -R -v /var/ftpd/incoming
479       setsebool -P ftpd_anon_write 1
480
481
482       If  you want to determine whether ftpd can modify public files used for
483       public file transfer services. Directories/Files must be  labeled  pub‐
484       lic_content_rw_t., you must turn on the ftpd_anon_write boolean.
485
486       setsebool -P ftpd_anon_write 1
487
488

COMMANDS

490       semanage  fcontext  can also be used to manipulate default file context
491       mappings.
492
493       semanage permissive can also be used to manipulate  whether  or  not  a
494       process type is permissive.
495
496       semanage  module can also be used to enable/disable/install/remove pol‐
497       icy modules.
498
499       semanage port can also be used to manipulate the port definitions
500
501       semanage boolean can also be used to manipulate the booleans
502
503
504       system-config-selinux is a GUI tool available to customize SELinux pol‐
505       icy settings.
506
507

AUTHOR

509       This manual page was auto-generated using sepolicy manpage .
510
511

SEE ALSO

513       selinux(8),  ftpd(8), semanage(8), restorecon(8), chcon(1), sepolicy(8)
514       , setsebool(8)
515
516
517
518ftpd                               19-04-25                    ftpd_selinux(8)
Impressum