1smbd_selinux(8) SELinux Policy smbd smbd_selinux(8)
2
3
4
6 smbd_selinux - Security Enhanced Linux Policy for the smbd processes
7
9 Security-Enhanced Linux secures the smbd processes via flexible manda‐
10 tory access control.
11
12 The smbd processes execute with the smbd_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 smbd_t
19
20
21
23 The smbd_t SELinux type can be entered via the smbd_exec_t file type.
24
25 The default entrypoint paths for the smbd_t domain are the following:
26
27 /usr/sbin/smbd
28
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 smbd policy is very flexible allowing users to setup their smbd pro‐
37 cesses in as secure a method as possible.
38
39 The following process types are defined for smbd:
40
41 smbd_t
42
43 Note: semanage permissive -a smbd_t can be used to make the process
44 type smbd_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
50 SELinux policy is customizable based on least access required. smbd
51 policy is extremely flexible and has several booleans that allow you to
52 manipulate the policy and run smbd with the tightest access possible.
53
54
55
56 If you want to allow users to resolve user passwd entries directly from
57 ldap rather then using a sssd server, you must turn on the authlo‐
58 gin_nsswitch_use_ldap boolean. Disabled by default.
59
60 setsebool -P authlogin_nsswitch_use_ldap 1
61
62
63
64 If you want to allow all daemons to write corefiles to /, you must turn
65 on the daemons_dump_core boolean. Disabled by default.
66
67 setsebool -P daemons_dump_core 1
68
69
70
71 If you want to enable cluster mode for daemons, you must turn on the
72 daemons_enable_cluster_mode boolean. Enabled by default.
73
74 setsebool -P daemons_enable_cluster_mode 1
75
76
77
78 If you want to allow all daemons to use tcp wrappers, you must turn on
79 the daemons_use_tcp_wrapper boolean. Disabled by default.
80
81 setsebool -P daemons_use_tcp_wrapper 1
82
83
84
85 If you want to allow all daemons the ability to read/write terminals,
86 you must turn on the daemons_use_tty boolean. Disabled by default.
87
88 setsebool -P daemons_use_tty 1
89
90
91
92 If you want to deny any process from ptracing or debugging any other
93 processes, you must turn on the deny_ptrace boolean. Enabled by
94 default.
95
96 setsebool -P deny_ptrace 1
97
98
99
100 If you want to allow any process to mmap any file on system with
101 attribute file_type, you must turn on the domain_can_mmap_files bool‐
102 ean. Enabled by default.
103
104 setsebool -P domain_can_mmap_files 1
105
106
107
108 If you want to allow all domains write to kmsg_device, while kernel is
109 executed with systemd.log_target=kmsg parameter, you must turn on the
110 domain_can_write_kmsg boolean. Disabled by default.
111
112 setsebool -P domain_can_write_kmsg 1
113
114
115
116 If you want to allow all domains to use other domains file descriptors,
117 you must turn on the domain_fd_use boolean. Enabled by default.
118
119 setsebool -P domain_fd_use 1
120
121
122
123 If you want to allow all domains to have the kernel load modules, you
124 must turn on the domain_kernel_load_modules boolean. Disabled by
125 default.
126
127 setsebool -P domain_kernel_load_modules 1
128
129
130
131 If you want to allow all domains to execute in fips_mode, you must turn
132 on the fips_mode boolean. Enabled by default.
133
134 setsebool -P fips_mode 1
135
136
137
138 If you want to enable reading of urandom for all domains, you must turn
139 on the global_ssp boolean. Disabled by default.
140
141 setsebool -P global_ssp 1
142
143
144
145 If you want to allow confined applications to run with kerberos, you
146 must turn on the kerberos_enabled boolean. Enabled by default.
147
148 setsebool -P kerberos_enabled 1
149
150
151
152 If you want to allow system to run with NIS, you must turn on the
153 nis_enabled boolean. Disabled by default.
154
155 setsebool -P nis_enabled 1
156
157
158
159 If you want to allow confined applications to use nscd shared memory,
160 you must turn on the nscd_use_shm boolean. Disabled by default.
161
162 setsebool -P nscd_use_shm 1
163
164
165
166 If you want to allow samba to create new home directories (e.g. via
167 PAM), you must turn on the samba_create_home_dirs boolean. Disabled by
168 default.
169
170 setsebool -P samba_create_home_dirs 1
171
172
173
174 If you want to allow samba to act as the domain controller, add users,
175 groups and change passwords, you must turn on the samba_domain_con‐
176 troller boolean. Disabled by default.
177
178 setsebool -P samba_domain_controller 1
179
180
181
182 If you want to allow samba to share users home directories, you must
183 turn on the samba_enable_home_dirs boolean. Disabled by default.
184
185 setsebool -P samba_enable_home_dirs 1
186
187
188
189 If you want to allow samba to share any file/directory read only, you
190 must turn on the samba_export_all_ro boolean. Disabled by default.
191
192 setsebool -P samba_export_all_ro 1
193
194
195
196 If you want to allow samba to share any file/directory read/write, you
197 must turn on the samba_export_all_rw boolean. Disabled by default.
198
199 setsebool -P samba_export_all_rw 1
200
201
202
203 If you want to allow smbd to load libgfapi from gluster, you must turn
204 on the samba_load_libgfapi boolean. Disabled by default.
205
206 setsebool -P samba_load_libgfapi 1
207
208
209
210 If you want to allow samba to act as a portmapper, you must turn on the
211 samba_portmapper boolean. Disabled by default.
212
213 setsebool -P samba_portmapper 1
214
215
216
217 If you want to allow samba to run unconfined scripts, you must turn on
218 the samba_run_unconfined boolean. Disabled by default.
219
220 setsebool -P samba_run_unconfined 1
221
222
223
224 If you want to allow samba to export ntfs/fusefs volumes, you must turn
225 on the samba_share_fusefs boolean. Enabled by default.
226
227 setsebool -P samba_share_fusefs 1
228
229
230
231 If you want to allow samba to export NFS volumes, you must turn on the
232 samba_share_nfs boolean. Disabled by default.
233
234 setsebool -P samba_share_nfs 1
235
236
237
239 SELinux defines port types to represent TCP and UDP ports.
240
241 You can see the types associated with a port by using the following
242 command:
243
244 semanage port -l
245
246
247 Policy governs the access confined processes have to these ports.
248 SELinux smbd policy is very flexible allowing users to setup their smbd
249 processes in as secure a method as possible.
250
251 The following port types are defined for smbd:
252
253
254 smbd_port_t
255
256
257
258 Default Defined Ports:
259 tcp 445,137-139
260
262 The SELinux process type smbd_t can manage files labeled with the fol‐
263 lowing file types. The paths listed are the default paths for these
264 file types. Note the processes UID still need to have DAC permissions.
265
266 cluster_var_lib_t
267
268 /var/lib/pcsd(/.*)?
269 /var/lib/cluster(/.*)?
270 /var/lib/openais(/.*)?
271 /var/lib/pengine(/.*)?
272 /var/lib/corosync(/.*)?
273 /usr/lib/heartbeat(/.*)?
274 /var/lib/heartbeat(/.*)?
275 /var/lib/pacemaker(/.*)?
276
277 cluster_var_run_t
278
279 /var/run/crm(/.*)?
280 /var/run/cman_.*
281 /var/run/rsctmp(/.*)?
282 /var/run/aisexec.*
283 /var/run/heartbeat(/.*)?
284 /var/run/corosync-qnetd(/.*)?
285 /var/run/corosync-qdevice(/.*)?
286 /var/run/cpglockd.pid
287 /var/run/corosync.pid
288 /var/run/rgmanager.pid
289 /var/run/cluster/rgmanager.sk
290
291 httpd_user_content_t
292
293 /home/[^/]+/((www)|(web)|(public_html))(/.+)?
294
295 krb5_host_rcache_t
296
297 /var/cache/krb5rcache(/.*)?
298 /var/tmp/nfs_0
299 /var/tmp/DNS_25
300 /var/tmp/host_0
301 /var/tmp/imap_0
302 /var/tmp/HTTP_23
303 /var/tmp/HTTP_48
304 /var/tmp/ldap_55
305 /var/tmp/ldap_487
306 /var/tmp/ldapmap1_0
307
308 non_security_file_type
309
310
311 noxattrfs
312
313 all files on file systems which do not support extended attributes
314
315 user_home_type
316
317 all user home files
318
319
321 SELinux requires files to have an extended attribute to define the file
322 type.
323
324 You can see the context of a file using the -Z option to ls
325
326 Policy governs the access confined processes have to these files.
327 SELinux smbd policy is very flexible allowing users to setup their smbd
328 processes in as secure a method as possible.
329
330 EQUIVALENCE DIRECTORIES
331
332
333 smbd policy stores data with multiple different file context types
334 under the /var/run/samba directory. If you would like to store the
335 data in a different directory you can use the semanage command to cre‐
336 ate an equivalence mapping. If you wanted to store this data under the
337 /srv dirctory you would execute the following command:
338
339 semanage fcontext -a -e /var/run/samba /srv/samba
340 restorecon -R -v /srv/samba
341
342 STANDARD FILE CONTEXT
343
344 SELinux defines the file context types for the smbd, if you wanted to
345 store files with these types in a diffent paths, you need to execute
346 the semanage command to sepecify alternate labeling and then use
347 restorecon to put the labels on disk.
348
349 semanage fcontext -a -t smbd_var_run_t '/srv/mysmbd_content(/.*)?'
350 restorecon -R -v /srv/mysmbd_content
351
352 Note: SELinux often uses regular expressions to specify labels that
353 match multiple files.
354
355 The following file types are defined for smbd:
356
357
358
359 smbd_exec_t
360
361 - Set files with the smbd_exec_t type, if you want to transition an
362 executable to the smbd_t domain.
363
364
365
366 smbd_keytab_t
367
368 - Set files with the smbd_keytab_t type, if you want to treat the files
369 as kerberos keytab files.
370
371
372
373 smbd_tmp_t
374
375 - Set files with the smbd_tmp_t type, if you want to store smbd tempo‐
376 rary files in the /tmp directories.
377
378
379
380 smbd_tmpfs_t
381
382 - Set files with the smbd_tmpfs_t type, if you want to store smbd files
383 on a tmpfs file system.
384
385
386
387 smbd_var_run_t
388
389 - Set files with the smbd_var_run_t type, if you want to store the smbd
390 files under the /run or /var/run directory.
391
392
393 Paths:
394 /var/run/samba(/.*)?, /var/run/samba/smbd.pid,
395 /var/run/samba/brlock.tdb, /var/run/samba/locking.tdb,
396 /var/run/samba/gencache.tdb, /var/run/samba/sessionid.tdb,
397 /var/run/samba/share_info.tdb, /var/run/samba/connections.tdb
398
399
400 Note: File context can be temporarily modified with the chcon command.
401 If you want to permanently change the file context you need to use the
402 semanage fcontext command. This will modify the SELinux labeling data‐
403 base. You will need to use restorecon to apply the labels.
404
405
407 If you want to share files with multiple domains (Apache, FTP, rsync,
408 Samba), you can set a file context of public_content_t and public_con‐
409 tent_rw_t. These context allow any of the above domains to read the
410 content. If you want a particular domain to write to the public_con‐
411 tent_rw_t domain, you must set the appropriate boolean.
412
413 Allow smbd servers to read the /var/smbd directory by adding the pub‐
414 lic_content_t file type to the directory and by restoring the file
415 type.
416
417 semanage fcontext -a -t public_content_t "/var/smbd(/.*)?"
418 restorecon -F -R -v /var/smbd
419
420 Allow smbd servers to read and write /var/smbd/incoming by adding the
421 public_content_rw_t type to the directory and by restoring the file
422 type. You also need to turn on the smbd_anon_write boolean.
423
424 semanage fcontext -a -t public_content_rw_t "/var/smbd/incoming(/.*)?"
425 restorecon -F -R -v /var/smbd/incoming
426 setsebool -P smbd_anon_write 1
427
428
429 If you want to allow samba to modify public files used for public file
430 transfer services. Files/Directories must be labeled public_con‐
431 tent_rw_t., you must turn on the smbd_anon_write boolean.
432
433 setsebool -P smbd_anon_write 1
434
435
437 semanage fcontext can also be used to manipulate default file context
438 mappings.
439
440 semanage permissive can also be used to manipulate whether or not a
441 process type is permissive.
442
443 semanage module can also be used to enable/disable/install/remove pol‐
444 icy modules.
445
446 semanage port can also be used to manipulate the port definitions
447
448 semanage boolean can also be used to manipulate the booleans
449
450
451 system-config-selinux is a GUI tool available to customize SELinux pol‐
452 icy settings.
453
454
456 This manual page was auto-generated using sepolicy manpage .
457
458
460 selinux(8), smbd(8), semanage(8), restorecon(8), chcon(1), sepolicy(8)
461 , setsebool(8)
462
463
464
465smbd 19-04-25 smbd_selinux(8)