1nfsd_selinux(8)               SELinux Policy nfsd              nfsd_selinux(8)
2
3
4

NAME

6       nfsd_selinux - Security Enhanced Linux Policy for the nfsd processes
7

DESCRIPTION

9       Security-Enhanced  Linux secures the nfsd processes via flexible manda‐
10       tory access control.
11
12       The nfsd processes execute with the nfsd_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 nfsd_t
19
20
21

ENTRYPOINTS

23       The nfsd_t SELinux type can be entered via the nfsd_exec_t file type.
24
25       The default entrypoint paths for the nfsd_t domain are the following:
26
27       /usr/sbin/rpc.nfsd, /usr/sbin/rpc.mountd
28

PROCESS TYPES

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

BOOLEANS

50       SELinux policy is customizable based on least  access  required.   nfsd
51       policy is extremely flexible and has several booleans that allow you to
52       manipulate the policy and run nfsd with the tightest access possible.
53
54
55
56       If you want to allow any files/directories to be exported read/only via
57       NFS,  you  must  turn  on  the  nfs_export_all_ro  boolean.  Enabled by
58       default.
59
60       setsebool -P nfs_export_all_ro 1
61
62
63
64       If you want to allow any files/directories to  be  exported  read/write
65       via  NFS,  you  must  turn on the nfs_export_all_rw boolean. Enabled by
66       default.
67
68       setsebool -P nfs_export_all_rw 1
69
70
71
72       If you want to allow users to resolve user passwd entries directly from
73       ldap  rather  then  using  a  sssd server, you must turn on the authlo‐
74       gin_nsswitch_use_ldap boolean. Disabled by default.
75
76       setsebool -P authlogin_nsswitch_use_ldap 1
77
78
79
80       If you want to allow all daemons to write corefiles to /, you must turn
81       on the daemons_dump_core boolean. Disabled by default.
82
83       setsebool -P daemons_dump_core 1
84
85
86
87       If  you  want  to enable cluster mode for daemons, you must turn on the
88       daemons_enable_cluster_mode boolean. Enabled by default.
89
90       setsebool -P daemons_enable_cluster_mode 1
91
92
93
94       If you want to allow all daemons to use tcp wrappers, you must turn  on
95       the daemons_use_tcp_wrapper boolean. Disabled by default.
96
97       setsebool -P daemons_use_tcp_wrapper 1
98
99
100
101       If  you  want to allow all daemons the ability to read/write terminals,
102       you must turn on the daemons_use_tty boolean. Disabled by default.
103
104       setsebool -P daemons_use_tty 1
105
106
107
108       If you want to deny any process from ptracing or  debugging  any  other
109       processes,  you  must  turn  on  the  deny_ptrace  boolean.  Enabled by
110       default.
111
112       setsebool -P deny_ptrace 1
113
114
115
116       If you want to allow any process  to  mmap  any  file  on  system  with
117       attribute  file_type,  you must turn on the domain_can_mmap_files bool‐
118       ean. Enabled by default.
119
120       setsebool -P domain_can_mmap_files 1
121
122
123
124       If you want to allow all domains write to kmsg_device, while kernel  is
125       executed  with  systemd.log_target=kmsg parameter, you must turn on the
126       domain_can_write_kmsg boolean. Disabled by default.
127
128       setsebool -P domain_can_write_kmsg 1
129
130
131
132       If you want to allow all domains to use other domains file descriptors,
133       you must turn on the domain_fd_use boolean. Enabled by default.
134
135       setsebool -P domain_fd_use 1
136
137
138
139       If  you  want to allow all domains to have the kernel load modules, you
140       must  turn  on  the  domain_kernel_load_modules  boolean.  Disabled  by
141       default.
142
143       setsebool -P domain_kernel_load_modules 1
144
145
146
147       If you want to allow all domains to execute in fips_mode, you must turn
148       on the fips_mode boolean. Enabled by default.
149
150       setsebool -P fips_mode 1
151
152
153
154       If you want to enable reading of urandom for all domains, you must turn
155       on the global_ssp boolean. Disabled by default.
156
157       setsebool -P global_ssp 1
158
159
160
161       If  you  want  to allow confined applications to run with kerberos, you
162       must turn on the kerberos_enabled boolean. Enabled by default.
163
164       setsebool -P kerberos_enabled 1
165
166
167
168       If you want to allow system to run with  NIS,  you  must  turn  on  the
169       nis_enabled boolean. Disabled by default.
170
171       setsebool -P nis_enabled 1
172
173
174
175       If  you  want to allow confined applications to use nscd shared memory,
176       you must turn on the nscd_use_shm boolean. Disabled by default.
177
178       setsebool -P nscd_use_shm 1
179
180
181

PORT TYPES

183       SELinux defines port types to represent TCP and UDP ports.
184
185       You can see the types associated with a port  by  using  the  following
186       command:
187
188       semanage port -l
189
190
191       Policy  governs  the  access  confined  processes  have to these ports.
192       SELinux nfsd policy is very flexible allowing users to setup their nfsd
193       processes in as secure a method as possible.
194
195       The following port types are defined for nfsd:
196
197
198       nfs_port_t
199
200
201
202       Default Defined Ports:
203                 tcp 2049,20048-20049
204                 udp 2049,20048-20049
205

MANAGED FILES

207       The  SELinux process type nfsd_t can manage files labeled with the fol‐
208       lowing file types.  The paths listed are the default  paths  for  these
209       file types.  Note the processes UID still need to have DAC permissions.
210
211       cluster_conf_t
212
213            /etc/cluster(/.*)?
214
215       cluster_var_lib_t
216
217            /var/lib/pcsd(/.*)?
218            /var/lib/cluster(/.*)?
219            /var/lib/openais(/.*)?
220            /var/lib/pengine(/.*)?
221            /var/lib/corosync(/.*)?
222            /usr/lib/heartbeat(/.*)?
223            /var/lib/heartbeat(/.*)?
224            /var/lib/pacemaker(/.*)?
225
226       cluster_var_run_t
227
228            /var/run/crm(/.*)?
229            /var/run/cman_.*
230            /var/run/rsctmp(/.*)?
231            /var/run/aisexec.*
232            /var/run/heartbeat(/.*)?
233            /var/run/corosync-qnetd(/.*)?
234            /var/run/corosync-qdevice(/.*)?
235            /var/run/cpglockd.pid
236            /var/run/corosync.pid
237            /var/run/rgmanager.pid
238            /var/run/cluster/rgmanager.sk
239
240       mount_var_run_t
241
242            /run/mount(/.*)?
243            /dev/.mount(/.*)?
244            /var/run/mount(/.*)?
245            /var/run/davfs2(/.*)?
246            /var/cache/davfs2(/.*)?
247
248       nfsd_fs_t
249
250
251       public_content_rw_t
252
253            /var/spool/abrt-upload(/.*)?
254
255       root_t
256
257            /sysroot/ostree/deploy/.*-atomic.*/deploy(/.*)?
258            /
259            /initrd
260
261       var_lib_nfs_t
262
263            /var/lib/nfs(/.*)?
264
265       var_lib_t
266
267            /opt/(.*/)?var/lib(/.*)?
268            /var/lib(/.*)?
269
270

FILE CONTEXTS

272       SELinux requires files to have an extended attribute to define the file
273       type.
274
275       You can see the context of a file using the -Z option to ls
276
277       Policy governs the access  confined  processes  have  to  these  files.
278       SELinux nfsd policy is very flexible allowing users to setup their nfsd
279       processes in as secure a method as possible.
280
281       STANDARD FILE CONTEXT
282
283       SELinux defines the file context types for the nfsd, if you  wanted  to
284       store  files  with  these types in a diffent paths, you need to execute
285       the semanage command  to  sepecify  alternate  labeling  and  then  use
286       restorecon to put the labels on disk.
287
288       semanage fcontext -a -t nfsd_unit_file_t '/srv/mynfsd_content(/.*)?'
289       restorecon -R -v /srv/mynfsd_content
290
291       Note:  SELinux  often  uses  regular expressions to specify labels that
292       match multiple files.
293
294       The following file types are defined for nfsd:
295
296
297
298       nfsd_exec_t
299
300       - Set files with the nfsd_exec_t type, if you  want  to  transition  an
301       executable to the nfsd_t domain.
302
303
304       Paths:
305            /usr/sbin/rpc.nfsd, /usr/sbin/rpc.mountd
306
307
308       nfsd_fs_t
309
310       -  Set files with the nfsd_fs_t type, if you want to treat the files as
311       nfsd fs data.
312
313
314
315       nfsd_initrc_exec_t
316
317       - Set files with the nfsd_initrc_exec_t type, if you want to transition
318       an executable to the nfsd_initrc_t domain.
319
320
321
322       nfsd_unit_file_t
323
324       -  Set  files  with the nfsd_unit_file_t type, if you want to treat the
325       files as nfsd unit content.
326
327
328
329       Note: File context can be temporarily modified with the chcon  command.
330       If  you want to permanently change the file context you need to use the
331       semanage fcontext command.  This will modify the SELinux labeling data‐
332       base.  You will need to use restorecon to apply the labels.
333
334

SHARING FILES

336       If  you  want to share files with multiple domains (Apache, FTP, rsync,
337       Samba), you can set a file context of public_content_t and  public_con‐
338       tent_rw_t.   These  context  allow any of the above domains to read the
339       content.  If you want a particular domain to write to  the  public_con‐
340       tent_rw_t domain, you must set the appropriate boolean.
341
342       Allow  nfsd  servers to read the /var/nfsd directory by adding the pub‐
343       lic_content_t file type to the directory  and  by  restoring  the  file
344       type.
345
346       semanage fcontext -a -t public_content_t "/var/nfsd(/.*)?"
347       restorecon -F -R -v /var/nfsd
348
349       Allow  nfsd  servers to read and write /var/nfsd/incoming by adding the
350       public_content_rw_t type to the directory and  by  restoring  the  file
351       type.  You also need to turn on the nfsd_anon_write boolean.
352
353       semanage fcontext -a -t public_content_rw_t "/var/nfsd/incoming(/.*)?"
354       restorecon -F -R -v /var/nfsd/incoming
355       setsebool -P nfsd_anon_write 1
356
357
358       If you want to allow nfs servers to modify public files used for public
359       file transfer services.  Files/Directories must be labeled  public_con‐
360       tent_rw_t., you must turn on the nfsd_anon_write boolean.
361
362       setsebool -P nfsd_anon_write 1
363
364

COMMANDS

366       semanage  fcontext  can also be used to manipulate default file context
367       mappings.
368
369       semanage permissive can also be used to manipulate  whether  or  not  a
370       process type is permissive.
371
372       semanage  module can also be used to enable/disable/install/remove pol‐
373       icy modules.
374
375       semanage port can also be used to manipulate the port definitions
376
377       semanage boolean can also be used to manipulate the booleans
378
379
380       system-config-selinux is a GUI tool available to customize SELinux pol‐
381       icy settings.
382
383

AUTHOR

385       This manual page was auto-generated using sepolicy manpage .
386
387

SEE ALSO

389       selinux(8),  nfsd(8), semanage(8), restorecon(8), chcon(1), sepolicy(8)
390       , setsebool(8)
391
392
393
394nfsd                               19-04-25                    nfsd_selinux(8)
Impressum