]>
Commit | Line | Data |
---|---|---|
490639cd | 1 | ## <summary>Policy for user domains</summary> |
b16c6b8c | 2 | |
8fd36732 CP |
3 | ####################################### |
4 | ## <summary> | |
bbcd3c97 | 5 | ## The template containing the most basic rules common to all users. |
8fd36732 CP |
6 | ## </summary> |
7 | ## <desc> | |
8 | ## <p> | |
bbcd3c97 | 9 | ## The template containing the most basic rules common to all users. |
8fd36732 CP |
10 | ## </p> |
11 | ## <p> | |
bbcd3c97 CP |
12 | ## This template creates a user domain, types, and |
13 | ## rules for the user's tty and pty. | |
8fd36732 CP |
14 | ## </p> |
15 | ## </desc> | |
16 | ## <param name="userdomain_prefix"> | |
885b83ec | 17 | ## <summary> |
8fd36732 CP |
18 | ## The prefix of the user domain (e.g., user |
19 | ## is the prefix for user_t). | |
885b83ec | 20 | ## </summary> |
8fd36732 | 21 | ## </param> |
bbcd3c97 | 22 | ## <rolebase/> |
b16c6b8c | 23 | # |
bbcd3c97 | 24 | template(`userdom_base_user_template',` |
c6a60bb2 CP |
25 | |
26 | gen_require(` | |
d6d16b97 | 27 | attribute userdomain; |
296273a7 | 28 | type user_devpts_t, user_tty_device_t; |
c6a60bb2 CP |
29 | class context contains; |
30 | ') | |
31 | ||
0c73cd25 | 32 | attribute $1_file_type; |
3eaa9939 | 33 | attribute $1_usertype; |
0c73cd25 | 34 | |
3eaa9939 | 35 | type $1_t, userdomain, $1_usertype; |
c9428d33 | 36 | domain_type($1_t) |
95662e80 | 37 | role $1_r; |
c9428d33 | 38 | corecmd_shell_entry_type($1_t) |
d40c0ecf | 39 | corecmd_bin_entry_type($1_t) |
2e863f8a | 40 | domain_user_exemption_target($1_t) |
296273a7 | 41 | ubac_constrained($1_t) |
0c73cd25 CP |
42 | role $1_r types $1_t; |
43 | allow system_r $1_r; | |
44 | ||
296273a7 | 45 | term_user_pty($1_t, user_devpts_t) |
0c73cd25 | 46 | |
296273a7 | 47 | term_user_tty($1_t, user_tty_device_t) |
3eaa9939 DW |
48 | term_dontaudit_getattr_generic_ptys($1_t) |
49 | ||
995bdbb1 | 50 | allow $1_usertype $1_usertype:process { signal_perms getsched setsched share getpgid setpgid getcap setcap getsession getattr }; |
51 | tunable_policy(`deny_ptrace',`',` | |
52 | allow $1_usertype $1_usertype:process ptrace; | |
53 | ') | |
3eaa9939 DW |
54 | allow $1_usertype $1_usertype:fd use; |
55 | allow $1_usertype $1_t:key { create view read write search link setattr }; | |
56 | ||
57 | allow $1_usertype $1_usertype:fifo_file rw_fifo_file_perms; | |
58 | allow $1_usertype $1_usertype:unix_dgram_socket { create_socket_perms sendto }; | |
59 | allow $1_usertype $1_usertype:unix_stream_socket { create_stream_socket_perms connectto }; | |
60 | allow $1_usertype $1_usertype:shm create_shm_perms; | |
61 | allow $1_usertype $1_usertype:sem create_sem_perms; | |
62 | allow $1_usertype $1_usertype:msgq create_msgq_perms; | |
63 | allow $1_usertype $1_usertype:msg { send receive }; | |
64 | allow $1_usertype $1_usertype:context contains; | |
65 | dontaudit $1_usertype $1_usertype:socket create; | |
66 | ||
67 | allow $1_usertype user_devpts_t:chr_file { setattr rw_chr_file_perms }; | |
68 | term_create_pty($1_usertype, user_devpts_t) | |
296273a7 | 69 | # avoid annoying messages on terminal hangup on role change |
3eaa9939 | 70 | dontaudit $1_usertype user_devpts_t:chr_file ioctl; |
0c73cd25 | 71 | |
3eaa9939 | 72 | allow $1_usertype user_tty_device_t:chr_file { setattr rw_chr_file_perms }; |
296273a7 | 73 | # avoid annoying messages on terminal hangup on role change |
3eaa9939 DW |
74 | dontaudit $1_usertype user_tty_device_t:chr_file ioctl; |
75 | ||
76 | application_exec_all($1_usertype) | |
77 | ||
78 | kernel_read_kernel_sysctls($1_usertype) | |
79 | kernel_read_all_sysctls($1_usertype) | |
80 | kernel_dontaudit_list_unlabeled($1_usertype) | |
81 | kernel_dontaudit_getattr_unlabeled_files($1_usertype) | |
82 | kernel_dontaudit_getattr_unlabeled_symlinks($1_usertype) | |
83 | kernel_dontaudit_getattr_unlabeled_pipes($1_usertype) | |
84 | kernel_dontaudit_getattr_unlabeled_sockets($1_usertype) | |
85 | kernel_dontaudit_getattr_unlabeled_blk_files($1_usertype) | |
86 | kernel_dontaudit_getattr_unlabeled_chr_files($1_usertype) | |
87 | kernel_dontaudit_list_proc($1_usertype) | |
88 | ||
89 | dev_dontaudit_getattr_all_blk_files($1_usertype) | |
90 | dev_dontaudit_getattr_all_chr_files($1_usertype) | |
91 | dev_getattr_mtrr_dev($1_t) | |
847937da | 92 | |
2ec4c9d3 | 93 | # When the user domain runs ps, there will be a number of access |
ff8f0a63 | 94 | # denials when ps tries to search /proc. Do not audit these denials. |
3eaa9939 DW |
95 | domain_dontaudit_read_all_domains_state($1_usertype) |
96 | domain_dontaudit_getattr_all_domains($1_usertype) | |
97 | domain_dontaudit_getsession_all_domains($1_usertype) | |
7bbb31df | 98 | dev_dontaudit_all_access_check($1_usertype) |
3eaa9939 DW |
99 | |
100 | files_read_etc_files($1_usertype) | |
101 | files_list_mnt($1_usertype) | |
1415ddd2 | 102 | files_list_var($1_usertype) |
3eaa9939 | 103 | files_read_mnt_files($1_usertype) |
7455c4b3 | 104 | files_dontaudit_access_check_mnt($1_usertype) |
3eaa9939 DW |
105 | files_read_etc_runtime_files($1_usertype) |
106 | files_read_usr_files($1_usertype) | |
107 | files_read_usr_src_files($1_usertype) | |
bbcd3c97 CP |
108 | # Read directories and files with the readable_t type. |
109 | # This type is a general type for "world"-readable files. | |
3eaa9939 DW |
110 | files_list_world_readable($1_usertype) |
111 | files_read_world_readable_files($1_usertype) | |
112 | files_read_world_readable_symlinks($1_usertype) | |
113 | files_read_world_readable_pipes($1_usertype) | |
114 | files_read_world_readable_sockets($1_usertype) | |
a2868f6e | 115 | # old broswer_domain(): |
3eaa9939 DW |
116 | files_dontaudit_getattr_all_dirs($1_usertype) |
117 | files_dontaudit_list_non_security($1_usertype) | |
118 | files_dontaudit_getattr_all_files($1_usertype) | |
119 | files_dontaudit_getattr_non_security_symlinks($1_usertype) | |
120 | files_dontaudit_getattr_non_security_pipes($1_usertype) | |
121 | files_dontaudit_getattr_non_security_sockets($1_usertype) | |
d255399f | 122 | files_dontaudit_setattr_etc_runtime_files($1_usertype) |
3eaa9939 DW |
123 | |
124 | files_exec_usr_files($1_t) | |
125 | ||
126 | fs_list_cgroup_dirs($1_usertype) | |
127 | fs_dontaudit_rw_cgroup_files($1_usertype) | |
128 | ||
129 | storage_rw_fuse($1_usertype) | |
130 | ||
ae68f77d | 131 | auth_use_nsswitch($1_t) |
0c73cd25 | 132 | |
3eaa9939 | 133 | init_stream_connect($1_usertype) |
9461b606 DW |
134 | # The library functions always try to open read-write first, |
135 | # then fall back to read-only if it fails. | |
136 | init_dontaudit_rw_utmp($1_usertype) | |
bbcd3c97 | 137 | |
3eaa9939 | 138 | libs_exec_ld_so($1_usertype) |
6b19be33 | 139 | |
7e9cab9c DW |
140 | logging_send_audit_msgs($1_t) |
141 | ||
bbcd3c97 | 142 | miscfiles_read_localization($1_t) |
83406219 | 143 | miscfiles_read_generic_certs($1_t) |
6b19be33 | 144 | |
cab9bc9c | 145 | miscfiles_read_all_certs($1_usertype) |
3eaa9939 DW |
146 | miscfiles_read_localization($1_usertype) |
147 | miscfiles_read_man_pages($1_usertype) | |
148 | miscfiles_read_public_files($1_usertype) | |
bbcd3c97 | 149 | |
780fa294 DW |
150 | systemd_dbus_chat_logind($1_usertype) |
151 | ||
4a093096 | 152 | tunable_policy(`deny_execmem',`', ` |
bbcd3c97 CP |
153 | # Allow loading DSOs that require executable stack. |
154 | allow $1_t self:process execmem; | |
155 | ') | |
156 | ||
4a093096 | 157 | tunable_policy(`allow_execstack',` |
bbcd3c97 CP |
158 | # Allow making the stack executable via mprotect. |
159 | allow $1_t self:process execstack; | |
160 | ') | |
3eaa9939 | 161 | |
d0f23a26 DW |
162 | optional_policy(` |
163 | abrt_stream_connect($1_usertype) | |
164 | ') | |
165 | ||
3eaa9939 DW |
166 | optional_policy(` |
167 | fs_list_cgroup_dirs($1_usertype) | |
168 | ') | |
a8183914 | 169 | |
3eaa9939 DW |
170 | optional_policy(` |
171 | ssh_rw_stream_sockets($1_usertype) | |
172 | ssh_delete_tmp($1_t) | |
173 | ssh_signal($1_t) | |
174 | ') | |
bbcd3c97 CP |
175 | ') |
176 | ||
177 | ####################################### | |
178 | ## <summary> | |
296273a7 CP |
179 | ## Allow a home directory for which the |
180 | ## role has read-only access. | |
bbcd3c97 CP |
181 | ## </summary> |
182 | ## <desc> | |
183 | ## <p> | |
296273a7 CP |
184 | ## Allow a home directory for which the |
185 | ## role has read-only access. | |
bbcd3c97 CP |
186 | ## </p> |
187 | ## <p> | |
188 | ## This does not allow execute access. | |
189 | ## </p> | |
190 | ## </desc> | |
296273a7 | 191 | ## <param name="role"> |
bbcd3c97 | 192 | ## <summary> |
296273a7 CP |
193 | ## The user role |
194 | ## </summary> | |
195 | ## </param> | |
196 | ## <param name="userdomain"> | |
197 | ## <summary> | |
198 | ## The user domain | |
bbcd3c97 CP |
199 | ## </summary> |
200 | ## </param> | |
201 | ## <rolebase/> | |
202 | # | |
296273a7 | 203 | interface(`userdom_ro_home_role',` |
d6d16b97 | 204 | gen_require(` |
296273a7 | 205 | type user_home_t, user_home_dir_t; |
d6d16b97 CP |
206 | ') |
207 | ||
3eaa9939 DW |
208 | role $1 types { user_home_t user_home_dir_t }; |
209 | ||
bbcd3c97 CP |
210 | ############################## |
211 | # | |
212 | # Domain access to home dir | |
213 | # | |
214 | ||
296273a7 CP |
215 | type_member $2 user_home_dir_t:dir user_home_dir_t; |
216 | ||
bbcd3c97 | 217 | # read-only home directory |
296273a7 CP |
218 | allow $2 user_home_dir_t:dir list_dir_perms; |
219 | allow $2 user_home_t:dir list_dir_perms; | |
220 | allow $2 user_home_t:file entrypoint; | |
221 | read_files_pattern($2, { user_home_t user_home_dir_t }, user_home_t) | |
222 | read_lnk_files_pattern($2, { user_home_t user_home_dir_t }, user_home_t) | |
223 | read_fifo_files_pattern($2, { user_home_t user_home_dir_t }, user_home_t) | |
224 | read_sock_files_pattern($2, { user_home_t user_home_dir_t }, user_home_t) | |
225 | files_list_home($2) | |
bbcd3c97 | 226 | |
bbcd3c97 CP |
227 | ') |
228 | ||
229 | ####################################### | |
230 | ## <summary> | |
296273a7 CP |
231 | ## Allow a home directory for which the |
232 | ## role has full access. | |
bbcd3c97 CP |
233 | ## </summary> |
234 | ## <desc> | |
235 | ## <p> | |
296273a7 CP |
236 | ## Allow a home directory for which the |
237 | ## role has full access. | |
bbcd3c97 CP |
238 | ## </p> |
239 | ## <p> | |
240 | ## This does not allow execute access. | |
241 | ## </p> | |
242 | ## </desc> | |
296273a7 | 243 | ## <param name="role"> |
bbcd3c97 | 244 | ## <summary> |
296273a7 CP |
245 | ## The user role |
246 | ## </summary> | |
247 | ## </param> | |
248 | ## <param name="userdomain"> | |
249 | ## <summary> | |
250 | ## The user domain | |
bbcd3c97 CP |
251 | ## </summary> |
252 | ## </param> | |
253 | ## <rolebase/> | |
254 | # | |
296273a7 | 255 | interface(`userdom_manage_home_role',` |
d6d16b97 | 256 | gen_require(` |
296273a7 | 257 | type user_home_t, user_home_dir_t; |
3eaa9939 | 258 | attribute user_home_type; |
d6d16b97 CP |
259 | ') |
260 | ||
3eaa9939 DW |
261 | role $1 types { user_home_type user_home_dir_t }; |
262 | ||
bbcd3c97 CP |
263 | ############################## |
264 | # | |
265 | # Domain access to home dir | |
266 | # | |
267 | ||
296273a7 CP |
268 | type_member $2 user_home_dir_t:dir user_home_dir_t; |
269 | ||
bbcd3c97 | 270 | # full control of the home directory |
3eaa9939 | 271 | allow $2 user_home_t:dir mounton; |
296273a7 | 272 | allow $2 user_home_t:file entrypoint; |
3eaa9939 DW |
273 | |
274 | allow $2 user_home_type:dir_file_class_set { relabelto relabelfrom }; | |
275 | allow $2 user_home_dir_t:lnk_file read_lnk_file_perms; | |
276 | manage_dirs_pattern($2, { user_home_dir_t user_home_type }, user_home_type) | |
277 | manage_files_pattern($2, { user_home_dir_t user_home_type }, user_home_type) | |
278 | manage_lnk_files_pattern($2, { user_home_dir_t user_home_type }, user_home_type) | |
279 | manage_sock_files_pattern($2, { user_home_dir_t user_home_type }, user_home_type) | |
280 | manage_fifo_files_pattern($2, { user_home_dir_t user_home_type }, user_home_type) | |
281 | relabel_dirs_pattern($2, { user_home_dir_t user_home_type }, user_home_type) | |
282 | relabel_files_pattern($2, { user_home_dir_t user_home_type }, user_home_type) | |
283 | relabel_lnk_files_pattern($2, { user_home_dir_t user_home_type }, user_home_type) | |
284 | relabel_sock_files_pattern($2, { user_home_dir_t user_home_type }, user_home_type) | |
285 | relabel_fifo_files_pattern($2, { user_home_dir_t user_home_type }, user_home_type) | |
296273a7 | 286 | filetrans_pattern($2, user_home_dir_t, user_home_t, { dir file lnk_file sock_file fifo_file }) |
55a7fd92 | 287 | userdom_filetrans_home_content($2) |
288 | ||
296273a7 | 289 | files_list_home($2) |
bbcd3c97 | 290 | |
c0868a7a | 291 | # cjp: this should probably be removed: |
296273a7 | 292 | allow $2 user_home_dir_t:dir { manage_dir_perms relabel_dir_perms }; |
c0868a7a | 293 | |
bbcd3c97 | 294 | tunable_policy(`use_nfs_home_dirs',` |
3eaa9939 DW |
295 | fs_mount_nfs($2) |
296 | fs_mounton_nfs($2) | |
296273a7 CP |
297 | fs_manage_nfs_dirs($2) |
298 | fs_manage_nfs_files($2) | |
299 | fs_manage_nfs_symlinks($2) | |
300 | fs_manage_nfs_named_sockets($2) | |
301 | fs_manage_nfs_named_pipes($2) | |
bbcd3c97 CP |
302 | ') |
303 | ||
304 | tunable_policy(`use_samba_home_dirs',` | |
3eaa9939 DW |
305 | fs_mount_cifs($2) |
306 | fs_mounton_cifs($2) | |
296273a7 CP |
307 | fs_manage_cifs_dirs($2) |
308 | fs_manage_cifs_files($2) | |
309 | fs_manage_cifs_symlinks($2) | |
310 | fs_manage_cifs_named_sockets($2) | |
311 | fs_manage_cifs_named_pipes($2) | |
bbcd3c97 CP |
312 | ') |
313 | ') | |
314 | ||
315 | ####################################### | |
316 | ## <summary> | |
296273a7 | 317 | ## Manage user temporary files |
bbcd3c97 | 318 | ## </summary> |
296273a7 | 319 | ## <param name="role"> |
bbcd3c97 | 320 | ## <summary> |
296273a7 | 321 | ## Role allowed access. |
bbcd3c97 CP |
322 | ## </summary> |
323 | ## </param> | |
296273a7 | 324 | ## <param name="domain"> |
bbcd3c97 | 325 | ## <summary> |
296273a7 | 326 | ## Domain allowed access. |
bbcd3c97 CP |
327 | ## </summary> |
328 | ## </param> | |
329 | ## <rolebase/> | |
330 | # | |
296273a7 | 331 | interface(`userdom_manage_tmp_role',` |
d6d16b97 | 332 | gen_require(` |
8c9f6ee9 | 333 | attribute user_tmp_type; |
296273a7 | 334 | type user_tmp_t; |
d6d16b97 CP |
335 | ') |
336 | ||
3eaa9939 DW |
337 | role $1 types user_tmp_t; |
338 | ||
296273a7 | 339 | files_poly_member_tmp($2, user_tmp_t) |
bbcd3c97 | 340 | |
8c9f6ee9 DG |
341 | manage_dirs_pattern($2, user_tmp_type, user_tmp_type) |
342 | manage_files_pattern($2, user_tmp_type, user_tmp_type) | |
343 | manage_lnk_files_pattern($2, user_tmp_type, user_tmp_type) | |
344 | manage_sock_files_pattern($2, user_tmp_type, user_tmp_type) | |
345 | manage_fifo_files_pattern($2, user_tmp_type, user_tmp_type) | |
296273a7 | 346 | files_tmp_filetrans($2, user_tmp_t, { dir file lnk_file sock_file fifo_file }) |
8c9f6ee9 DG |
347 | relabel_dirs_pattern($2, user_tmp_type, user_tmp_type) |
348 | relabel_files_pattern($2, user_tmp_type, user_tmp_type) | |
349 | relabel_lnk_files_pattern($2, user_tmp_type, user_tmp_type) | |
350 | relabel_sock_files_pattern($2, user_tmp_type, user_tmp_type) | |
351 | relabel_fifo_files_pattern($2, user_tmp_type, user_tmp_type) | |
3eaa9939 DW |
352 | ') |
353 | ||
354 | ####################################### | |
355 | ## <summary> | |
356 | ## Dontaudit search of user bin dirs. | |
357 | ## </summary> | |
358 | ## <param name="domain"> | |
359 | ## <summary> | |
24280f35 | 360 | ## Domain to not audit. |
3eaa9939 DW |
361 | ## </summary> |
362 | ## </param> | |
363 | # | |
364 | interface(`userdom_dontaudit_search_user_bin_dirs',` | |
365 | gen_require(` | |
366 | type home_bin_t; | |
367 | ') | |
368 | ||
369 | dontaudit $1 home_bin_t:dir search_dir_perms; | |
370 | ') | |
371 | ||
372 | ####################################### | |
373 | ## <summary> | |
374 | ## Execute user bin files. | |
375 | ## </summary> | |
376 | ## <param name="domain"> | |
377 | ## <summary> | |
378 | ## Domain allowed access. | |
379 | ## </summary> | |
380 | ## </param> | |
381 | # | |
382 | interface(`userdom_exec_user_bin_files',` | |
383 | gen_require(` | |
384 | attribute user_home_type; | |
385 | type home_bin_t, user_home_dir_t; | |
386 | ') | |
387 | ||
388 | exec_files_pattern($1, { user_home_dir_t user_home_type }, home_bin_t) | |
389 | files_search_home($1) | |
bbcd3c97 CP |
390 | ') |
391 | ||
392 | ####################################### | |
393 | ## <summary> | |
296273a7 | 394 | ## The execute access user temporary files. |
bbcd3c97 | 395 | ## </summary> |
296273a7 | 396 | ## <param name="domain"> |
bbcd3c97 | 397 | ## <summary> |
296273a7 | 398 | ## Domain allowed access. |
bbcd3c97 CP |
399 | ## </summary> |
400 | ## </param> | |
401 | ## <rolebase/> | |
402 | # | |
296273a7 CP |
403 | interface(`userdom_exec_user_tmp_files',` |
404 | gen_require(` | |
405 | type user_tmp_t; | |
406 | ') | |
407 | ||
408 | exec_files_pattern($1, user_tmp_t, user_tmp_t) | |
3eaa9939 | 409 | dontaudit $1 user_tmp_t:sock_file execute; |
296273a7 | 410 | files_search_tmp($1) |
bbcd3c97 CP |
411 | ') |
412 | ||
413 | ####################################### | |
414 | ## <summary> | |
296273a7 | 415 | ## Role access for the user tmpfs type |
bbcd3c97 CP |
416 | ## that the user has full access. |
417 | ## </summary> | |
418 | ## <desc> | |
419 | ## <p> | |
296273a7 | 420 | ## Role access for the user tmpfs type |
bbcd3c97 CP |
421 | ## that the user has full access. |
422 | ## </p> | |
423 | ## <p> | |
424 | ## This does not allow execute access. | |
425 | ## </p> | |
426 | ## </desc> | |
296273a7 | 427 | ## <param name="role"> |
bbcd3c97 | 428 | ## <summary> |
296273a7 | 429 | ## Role allowed access. |
bbcd3c97 CP |
430 | ## </summary> |
431 | ## </param> | |
296273a7 | 432 | ## <param name="domain"> |
bbcd3c97 | 433 | ## <summary> |
296273a7 | 434 | ## Domain allowed access. |
bbcd3c97 CP |
435 | ## </summary> |
436 | ## </param> | |
296273a7 | 437 | ## <rolecap/> |
bbcd3c97 | 438 | # |
296273a7 | 439 | interface(`userdom_manage_tmpfs_role',` |
bbcd3c97 | 440 | gen_require(` |
faa4eacc | 441 | attribute user_tmpfs_type; |
296273a7 | 442 | type user_tmpfs_t; |
bbcd3c97 | 443 | ') |
bbcd3c97 | 444 | |
3eaa9939 DW |
445 | role $1 types user_tmpfs_t; |
446 | ||
8c9f6ee9 DG |
447 | manage_dirs_pattern($2, user_tmpfs_type, user_tmpfs_type) |
448 | manage_files_pattern($2, user_tmpfs_type, user_tmpfs_type) | |
449 | manage_lnk_files_pattern($2, user_tmpfs_type, user_tmpfs_type) | |
450 | manage_sock_files_pattern($2, user_tmpfs_type, user_tmpfs_type) | |
451 | manage_fifo_files_pattern($2, user_tmpfs_type, user_tmpfs_type) | |
296273a7 | 452 | fs_tmpfs_filetrans($2, user_tmpfs_t, { dir file lnk_file sock_file fifo_file }) |
8c9f6ee9 DG |
453 | relabel_dirs_pattern($2, user_tmpfs_type, user_tmpfs_type) |
454 | relabel_files_pattern($2, user_tmpfs_type, user_tmpfs_type) | |
455 | relabel_lnk_files_pattern($2, user_tmpfs_type, user_tmpfs_type) | |
456 | relabel_sock_files_pattern($2, user_tmpfs_type, user_tmpfs_type) | |
457 | relabel_fifo_files_pattern($2, user_tmpfs_type, user_tmpfs_type) | |
bbcd3c97 CP |
458 | ') |
459 | ||
460 | ####################################### | |
461 | ## <summary> | |
3eaa9939 | 462 | ## The interface allowing the user basic |
bbcd3c97 CP |
463 | ## network permissions |
464 | ## </summary> | |
3eaa9939 | 465 | ## <param name="userdomain"> |
bbcd3c97 | 466 | ## <summary> |
3eaa9939 | 467 | ## The user domain |
bbcd3c97 CP |
468 | ## </summary> |
469 | ## </param> | |
470 | ## <rolebase/> | |
471 | # | |
3eaa9939 DW |
472 | interface(`userdom_basic_networking',` |
473 | ||
474 | allow $1 self:tcp_socket create_stream_socket_perms; | |
475 | allow $1 self:udp_socket create_socket_perms; | |
476 | ||
477 | corenet_all_recvfrom_unlabeled($1) | |
478 | corenet_all_recvfrom_netlabel($1) | |
479 | corenet_tcp_sendrecv_generic_if($1) | |
480 | corenet_udp_sendrecv_generic_if($1) | |
481 | corenet_tcp_sendrecv_generic_node($1) | |
482 | corenet_udp_sendrecv_generic_node($1) | |
483 | corenet_tcp_sendrecv_all_ports($1) | |
484 | corenet_udp_sendrecv_all_ports($1) | |
485 | corenet_tcp_connect_all_ports($1) | |
486 | corenet_sendrecv_all_client_packets($1) | |
dc1920b2 CP |
487 | |
488 | optional_policy(` | |
3eaa9939 DW |
489 | init_tcp_recvfrom_all_daemons($1) |
490 | init_udp_recvfrom_all_daemons($1) | |
dc1920b2 CP |
491 | ') |
492 | ||
0b6acad1 | 493 | optional_policy(` |
3eaa9939 | 494 | ipsec_match_default_spd($1) |
0b6acad1 | 495 | ') |
3eaa9939 | 496 | |
bbcd3c97 CP |
497 | ') |
498 | ||
499 | ####################################### | |
500 | ## <summary> | |
93c49bdb | 501 | ## The template for creating a user xwindows client. (Deprecated) |
bbcd3c97 CP |
502 | ## </summary> |
503 | ## <param name="userdomain_prefix"> | |
504 | ## <summary> | |
505 | ## The prefix of the user domain (e.g., user | |
506 | ## is the prefix for user_t). | |
507 | ## </summary> | |
508 | ## </param> | |
509 | ## <rolebase/> | |
510 | # | |
511 | template(`userdom_xwindows_client_template',` | |
93c49bdb | 512 | refpolicywarn(`$0() has been deprecated, please use xserver_role() instead.') |
bbcd3c97 | 513 | gen_require(` |
296273a7 | 514 | type $1_t, user_tmpfs_t; |
bbcd3c97 CP |
515 | ') |
516 | ||
847937da CP |
517 | dev_rw_xserver_misc($1_t) |
518 | dev_rw_power_management($1_t) | |
519 | dev_read_input($1_t) | |
520 | dev_read_misc($1_t) | |
521 | dev_write_misc($1_t) | |
522 | # open office is looking for the following | |
523 | dev_getattr_agp_dev($1_t) | |
524 | dev_dontaudit_rw_dri($1_t) | |
525 | # GNOME checks for usb and other devices: | |
526 | dev_rw_usbfs($1_t) | |
3eaa9939 | 527 | dev_rw_generic_usb_dev($1_t) |
847937da | 528 | |
4279891d | 529 | xserver_user_x_domain_template($1, $1_t, user_tmpfs_t) |
847937da CP |
530 | xserver_xsession_entry_type($1_t) |
531 | xserver_dontaudit_write_log($1_t) | |
532 | xserver_stream_connect_xdm($1_t) | |
533 | # certain apps want to read xdm.pid file | |
534 | xserver_read_xdm_pid($1_t) | |
535 | # gnome-session creates socket under /tmp/.ICE-unix/ | |
536 | xserver_create_xdm_tmp_sockets($1_t) | |
537 | # Needed for escd, remove if we get escd policy | |
538 | xserver_manage_xdm_tmp_files($1_t) | |
bbcd3c97 CP |
539 | ') |
540 | ||
541 | ####################################### | |
542 | ## <summary> | |
543 | ## The template for allowing the user to change passwords. | |
544 | ## </summary> | |
545 | ## <param name="userdomain_prefix"> | |
546 | ## <summary> | |
547 | ## The prefix of the user domain (e.g., user | |
548 | ## is the prefix for user_t). | |
549 | ## </summary> | |
550 | ## </param> | |
551 | ## <rolebase/> | |
552 | # | |
553 | template(`userdom_change_password_template',` | |
554 | gen_require(` | |
296273a7 | 555 | type $1_t; |
bbcd3c97 CP |
556 | role $1_r; |
557 | ') | |
558 | ||
559 | optional_policy(` | |
f4aae210 MG |
560 | usermanage_run_chfn($1_t,$1_r) |
561 | usermanage_run_passwd($1_t,$1_r) | |
bbcd3c97 | 562 | ') |
bbcd3c97 CP |
563 | ') |
564 | ||
565 | ####################################### | |
566 | ## <summary> | |
567 | ## The template containing rules common to unprivileged | |
568 | ## users and administrative users. | |
569 | ## </summary> | |
570 | ## <desc> | |
571 | ## <p> | |
572 | ## This template creates a user domain, types, and | |
573 | ## rules for the user's tty, pty, tmp, and tmpfs files. | |
574 | ## </p> | |
575 | ## </desc> | |
576 | ## <param name="userdomain_prefix"> | |
577 | ## <summary> | |
578 | ## The prefix of the user domain (e.g., user | |
579 | ## is the prefix for user_t). | |
580 | ## </summary> | |
581 | ## </param> | |
582 | # | |
583 | template(`userdom_common_user_template',` | |
563e58e8 CP |
584 | gen_require(` |
585 | attribute unpriv_userdomain; | |
586 | ') | |
bbcd3c97 | 587 | |
3eaa9939 | 588 | userdom_basic_networking($1_usertype) |
bbcd3c97 | 589 | |
bbcd3c97 CP |
590 | ############################## |
591 | # | |
592 | # User domain Local policy | |
593 | # | |
594 | ||
bbcd3c97 CP |
595 | # evolution and gnome-session try to create a netlink socket |
596 | dontaudit $1_t self:netlink_socket { create ioctl read getattr write setattr append bind connect getopt setopt shutdown }; | |
597 | dontaudit $1_t self:netlink_route_socket { create ioctl read getattr write setattr append bind connect getopt setopt shutdown nlmsg_read nlmsg_write }; | |
3eaa9939 DW |
598 | allow $1_t self:netlink_kobject_uevent_socket create_socket_perms; |
599 | allow $1_t self:socket create_socket_perms; | |
bbcd3c97 | 600 | |
3eaa9939 | 601 | allow $1_usertype unpriv_userdomain:fd use; |
bbcd3c97 | 602 | |
3eaa9939 DW |
603 | kernel_read_system_state($1_usertype) |
604 | kernel_read_network_state($1_usertype) | |
5aff16e1 | 605 | kernel_read_software_raid_state($1_usertype) |
3eaa9939 | 606 | kernel_read_net_sysctls($1_usertype) |
bbcd3c97 | 607 | # Very permissive allowing every domain to see every type: |
3eaa9939 | 608 | kernel_get_sysvipc_info($1_usertype) |
bbcd3c97 | 609 | # Find CDROM devices: |
3eaa9939 DW |
610 | kernel_read_device_sysctls($1_usertype) |
611 | kernel_request_load_module($1_usertype) | |
296273a7 | 612 | |
3eaa9939 DW |
613 | corenet_udp_bind_generic_node($1_usertype) |
614 | corenet_udp_bind_generic_port($1_usertype) | |
bbcd3c97 | 615 | |
3eaa9939 DW |
616 | dev_read_rand($1_usertype) |
617 | dev_write_sound($1_usertype) | |
618 | dev_read_sound($1_usertype) | |
619 | dev_read_sound_mixer($1_usertype) | |
620 | dev_write_sound_mixer($1_usertype) | |
bbcd3c97 | 621 | |
3eaa9939 DW |
622 | files_exec_etc_files($1_usertype) |
623 | files_search_locks($1_usertype) | |
bbcd3c97 | 624 | # Check to see if cdrom is mounted |
3eaa9939 | 625 | files_search_mnt($1_usertype) |
bbcd3c97 | 626 | # cjp: perhaps should cut back on file reads: |
3eaa9939 DW |
627 | files_read_var_files($1_usertype) |
628 | files_read_var_symlinks($1_usertype) | |
629 | files_read_generic_spool($1_usertype) | |
630 | files_read_var_lib_files($1_usertype) | |
bbcd3c97 | 631 | # Stat lost+found. |
3eaa9939 DW |
632 | files_getattr_lost_found_dirs($1_usertype) |
633 | files_read_config_files($1_usertype) | |
634 | fs_read_noxattr_fs_files($1_usertype) | |
635 | fs_read_noxattr_fs_symlinks($1_usertype) | |
636 | fs_rw_cgroup_files($1_usertype) | |
bbcd3c97 | 637 | |
f3ef2629 DW |
638 | application_getattr_socket($1_usertype) |
639 | ||
3eaa9939 DW |
640 | logging_send_syslog_msg($1_usertype) |
641 | logging_send_audit_msgs($1_usertype) | |
642 | selinux_get_enforce_mode($1_usertype) | |
e2b9add5 | 643 | |
bbcd3c97 | 644 | # cjp: some of this probably can be removed |
3eaa9939 DW |
645 | selinux_get_fs_mount($1_usertype) |
646 | selinux_validate_context($1_usertype) | |
647 | selinux_compute_access_vector($1_usertype) | |
648 | selinux_compute_create_context($1_usertype) | |
649 | selinux_compute_relabel_context($1_usertype) | |
650 | selinux_compute_user_contexts($1_usertype) | |
bbcd3c97 CP |
651 | |
652 | # for eject | |
3eaa9939 | 653 | storage_getattr_fixed_disk_dev($1_usertype) |
bbcd3c97 | 654 | |
f4aae210 MG |
655 | auth_read_login_records($1_usertype) |
656 | auth_run_pam($1_t,$1_r) | |
657 | auth_run_utempter($1_t,$1_r) | |
11578593 DW |
658 | auth_filetrans_admin_home_content($1_t) |
659 | auth_filetrans_home_content($1_t) | |
bbcd3c97 | 660 | |
3eaa9939 | 661 | init_read_utmp($1_usertype) |
0c73cd25 | 662 | |
3eaa9939 DW |
663 | seutil_read_file_contexts($1_usertype) |
664 | seutil_read_default_contexts($1_usertype) | |
296273a7 | 665 | seutil_run_newrole($1_t,$1_r) |
6b19be33 | 666 | seutil_exec_checkpolicy($1_t) |
3eaa9939 | 667 | seutil_exec_setfiles($1_usertype) |
bbcd3c97 CP |
668 | # for when the network connection is killed |
669 | # this is needed when a login role can change | |
670 | # to this one. | |
671 | seutil_dontaudit_signal_newrole($1_t) | |
a1fcff33 | 672 | |
34c8fabe | 673 | tunable_policy(`user_direct_mouse',` |
3eaa9939 | 674 | dev_read_mouse($1_usertype) |
34c8fabe | 675 | ') |
0c73cd25 | 676 | |
34c8fabe | 677 | tunable_policy(`user_ttyfile_stat',` |
c3c753f7 | 678 | term_getattr_all_ttys($1_t) |
34c8fabe | 679 | ') |
0c73cd25 | 680 | |
bb7170f6 | 681 | optional_policy(` |
ac9aa26d | 682 | # Allow graphical boot to check battery lifespan |
3eaa9939 | 683 | apm_stream_connect($1_usertype) |
ac9aa26d CP |
684 | ') |
685 | ||
bb7170f6 | 686 | optional_policy(` |
3eaa9939 | 687 | canna_stream_connect($1_usertype) |
3509484c CP |
688 | ') |
689 | ||
bb7170f6 | 690 | optional_policy(` |
3eaa9939 DW |
691 | chrome_role($1_r, $1_usertype) |
692 | ') | |
693 | ||
bfc1cfe9 MG |
694 | optional_policy(` |
695 | colord_read_lib_files($1_usertype) | |
696 | ') | |
697 | ||
3eaa9939 DW |
698 | optional_policy(` |
699 | dbus_system_bus_client($1_usertype) | |
700 | ||
701 | allow $1_usertype $1_usertype:dbus send_msg; | |
702 | ||
703 | optional_policy(` | |
704 | avahi_dbus_chat($1_usertype) | |
705 | ') | |
706 | ||
707 | optional_policy(` | |
708 | policykit_dbus_chat($1_usertype) | |
709 | ') | |
710 | ||
711 | optional_policy(` | |
712 | bluetooth_dbus_chat($1_usertype) | |
713 | ') | |
714 | ||
715 | optional_policy(` | |
716 | consolekit_dbus_chat($1_usertype) | |
717 | consolekit_read_log($1_usertype) | |
718 | ') | |
719 | ||
720 | optional_policy(` | |
721 | devicekit_dbus_chat($1_usertype) | |
722 | devicekit_dbus_chat_power($1_usertype) | |
723 | devicekit_dbus_chat_disk($1_usertype) | |
724 | ') | |
725 | ||
726 | optional_policy(` | |
727 | evolution_dbus_chat($1_usertype) | |
728 | evolution_alarm_dbus_chat($1_usertype) | |
729 | ') | |
d828b5ca | 730 | |
bbcd3c97 | 731 | optional_policy(` |
3eaa9939 | 732 | gnome_dbus_chat_gconfdefault($1_usertype) |
bbcd3c97 CP |
733 | ') |
734 | ||
6b19be33 | 735 | optional_policy(` |
3eaa9939 | 736 | hal_dbus_chat($1_usertype) |
6b19be33 CP |
737 | ') |
738 | ||
1acd60e5 MG |
739 | optional_policy(` |
740 | kde_dbus_chat_backlighthelper($1_usertype) | |
741 | ') | |
742 | ||
bb7170f6 | 743 | optional_policy(` |
3eaa9939 | 744 | modemmanager_dbus_chat($1_usertype) |
9fd4b818 CP |
745 | ') |
746 | ||
bb7170f6 | 747 | optional_policy(` |
3eaa9939 DW |
748 | networkmanager_dbus_chat($1_usertype) |
749 | networkmanager_read_lib_files($1_usertype) | |
ac9aa26d CP |
750 | ') |
751 | ||
bb7170f6 | 752 | optional_policy(` |
3eaa9939 | 753 | vpn_dbus_chat($1_usertype) |
d828b5ca | 754 | ') |
0c3d1705 CP |
755 | ') |
756 | ||
bb7170f6 | 757 | optional_policy(` |
3eaa9939 DW |
758 | git_session_role($1_r, $1_usertype) |
759 | ') | |
760 | ||
761 | optional_policy(` | |
762 | inetd_use_fds($1_usertype) | |
763 | inetd_rw_tcp_sockets($1_usertype) | |
b24f35d8 CP |
764 | ') |
765 | ||
bb7170f6 | 766 | optional_policy(` |
3eaa9939 DW |
767 | inn_read_config($1_usertype) |
768 | inn_read_news_lib($1_usertype) | |
769 | inn_read_news_spool($1_usertype) | |
9b06402e CP |
770 | ') |
771 | ||
cdd2b8d2 MG |
772 | optional_policy(` |
773 | lircd_stream_connect($1_usertype) | |
774 | ') | |
775 | ||
6b19be33 | 776 | optional_policy(` |
3eaa9939 | 777 | locate_read_lib_files($1_usertype) |
6b19be33 CP |
778 | ') |
779 | ||
bbcd3c97 CP |
780 | # for running depmod as part of the kernel packaging process |
781 | optional_policy(` | |
3eaa9939 DW |
782 | modutils_read_module_config($1_usertype) |
783 | ') | |
784 | ||
785 | optional_policy(` | |
786 | mta_rw_spool($1_usertype) | |
787 | mta_manage_queue($1_usertype) | |
780198a1 | 788 | mta_filetrans_home_content($1_usertype) |
bbcd3c97 CP |
789 | ') |
790 | ||
bb7170f6 | 791 | optional_policy(` |
bbcd3c97 CP |
792 | tunable_policy(`allow_user_mysql_connect',` |
793 | mysql_stream_connect($1_t) | |
42be7c21 CP |
794 | ') |
795 | ') | |
796 | ||
329138be DG |
797 | optional_policy(` |
798 | oident_manage_user_content($1_t) | |
799 | oident_relabel_user_content($1_t) | |
800 | ') | |
801 | ||
bb7170f6 | 802 | optional_policy(` |
2ec4c9d3 | 803 | # to allow monitoring of pcmcia status |
3eaa9939 | 804 | pcmcia_read_pid($1_usertype) |
2ec4c9d3 CP |
805 | ') |
806 | ||
6b19be33 | 807 | optional_policy(` |
3eaa9939 DW |
808 | pcscd_read_pub_files($1_usertype) |
809 | pcscd_stream_connect($1_usertype) | |
6b19be33 CP |
810 | ') |
811 | ||
cb10a2d5 CP |
812 | optional_policy(` |
813 | tunable_policy(`allow_user_postgresql_connect',` | |
3eaa9939 DW |
814 | postgresql_stream_connect($1_usertype) |
815 | postgresql_tcp_connect($1_usertype) | |
cb10a2d5 CP |
816 | ') |
817 | ') | |
818 | ||
b057be8d | 819 | optional_policy(` |
3eaa9939 | 820 | resmgr_stream_connect($1_usertype) |
b057be8d CP |
821 | ') |
822 | ||
bb7170f6 | 823 | optional_policy(` |
3eaa9939 DW |
824 | rpc_dontaudit_getattr_exports($1_usertype) |
825 | rpc_manage_nfs_rw_content($1_usertype) | |
f00434fa CP |
826 | ') |
827 | ||
bb7170f6 | 828 | optional_policy(` |
3eaa9939 | 829 | rpcbind_stream_connect($1_usertype) |
ac9aa26d CP |
830 | ') |
831 | ||
bb7170f6 | 832 | optional_policy(` |
3eaa9939 | 833 | samba_stream_connect_winbind($1_usertype) |
1d427acc CP |
834 | ') |
835 | ||
bb7170f6 | 836 | optional_policy(` |
3eaa9939 | 837 | sandbox_transition($1_usertype, $1_r) |
8cc49473 | 838 | ') |
3eaa9939 DW |
839 | |
840 | optional_policy(` | |
841 | seunshare_role_template($1, $1_r, $1_t) | |
842 | ') | |
843 | ||
844 | optional_policy(` | |
845 | slrnpull_search_spool($1_usertype) | |
846 | ') | |
847 | ||
41a828ed DW |
848 | optional_policy(` |
849 | thumb_role($1_r, $1_usertype) | |
850 | ') | |
2ec4c9d3 | 851 | ') |
b16c6b8c | 852 | |
8fd36732 CP |
853 | ####################################### |
854 | ## <summary> | |
847937da | 855 | ## The template for creating a login user. |
8fd36732 CP |
856 | ## </summary> |
857 | ## <desc> | |
858 | ## <p> | |
859 | ## This template creates a user domain, types, and | |
860 | ## rules for the user's tty, pty, home directories, | |
861 | ## tmp, and tmpfs files. | |
862 | ## </p> | |
863 | ## </desc> | |
864 | ## <param name="userdomain_prefix"> | |
885b83ec | 865 | ## <summary> |
8fd36732 CP |
866 | ## The prefix of the user domain (e.g., user |
867 | ## is the prefix for user_t). | |
885b83ec | 868 | ## </summary> |
8fd36732 | 869 | ## </param> |
b16c6b8c | 870 | # |
847937da | 871 | template(`userdom_login_user_template', ` |
b1a90365 CP |
872 | gen_require(` |
873 | class context contains; | |
874 | ') | |
875 | ||
847937da | 876 | userdom_base_user_template($1) |
563e58e8 | 877 | |
3eaa9939 DW |
878 | userdom_manage_home_role($1_r, $1_usertype) |
879 | ||
880 | userdom_manage_tmp_role($1_r, $1_usertype) | |
881 | userdom_manage_tmpfs_role($1_r, $1_usertype) | |
847937da | 882 | |
3eaa9939 DW |
883 | ifelse(`$1',`unconfined',`',` |
884 | gen_tunable(allow_$1_exec_content, true) | |
847937da | 885 | |
3eaa9939 DW |
886 | tunable_policy(`allow_$1_exec_content',` |
887 | userdom_exec_user_tmp_files($1_usertype) | |
888 | userdom_exec_user_home_content_files($1_usertype) | |
889 | ') | |
890 | tunable_policy(`allow_$1_exec_content && use_nfs_home_dirs',` | |
891 | fs_exec_nfs_files($1_usertype) | |
892 | ') | |
893 | ||
894 | tunable_policy(`allow_$1_exec_content && use_samba_home_dirs',` | |
895 | fs_exec_cifs_files($1_usertype) | |
896 | ') | |
897 | ') | |
847937da CP |
898 | |
899 | userdom_change_password_template($1) | |
563e58e8 | 900 | |
0c73cd25 CP |
901 | ############################## |
902 | # | |
847937da | 903 | # User domain Local policy |
0c73cd25 | 904 | # |
b16c6b8c | 905 | |
847937da CP |
906 | allow $1_t self:capability { setgid chown fowner }; |
907 | dontaudit $1_t self:capability { sys_nice fsetid }; | |
908 | ||
995bdbb1 | 909 | allow $1_t self:process ~{ ptrace setcurrent setexec setrlimit execmem execstack execheap }; |
847937da CP |
910 | dontaudit $1_t self:process setrlimit; |
911 | dontaudit $1_t self:netlink_route_socket { create ioctl read getattr write setattr append bind connect getopt setopt shutdown nlmsg_read nlmsg_write }; | |
912 | ||
913 | allow $1_t self:context contains; | |
914 | ||
3eaa9939 DW |
915 | kernel_dontaudit_read_system_state($1_usertype) |
916 | kernel_dontaudit_list_all_proc($1_usertype) | |
847937da | 917 | |
3eaa9939 DW |
918 | dev_read_sysfs($1_usertype) |
919 | dev_read_urand($1_usertype) | |
847937da | 920 | |
3eaa9939 | 921 | domain_use_interactive_fds($1_usertype) |
847937da | 922 | # Command completion can fire hundreds of denials |
3eaa9939 | 923 | domain_dontaudit_exec_all_entry_files($1_usertype) |
847937da | 924 | |
3eaa9939 DW |
925 | files_dontaudit_list_default($1_usertype) |
926 | files_dontaudit_read_default_files($1_usertype) | |
847937da | 927 | # Stat lost+found. |
3eaa9939 | 928 | files_getattr_lost_found_dirs($1_usertype) |
847937da | 929 | |
3eaa9939 DW |
930 | fs_get_all_fs_quotas($1_usertype) |
931 | fs_getattr_all_fs($1_usertype) | |
932 | fs_search_all($1_usertype) | |
933 | fs_list_inotifyfs($1_usertype) | |
934 | fs_rw_anon_inodefs_files($1_usertype) | |
847937da CP |
935 | |
936 | auth_dontaudit_write_login_records($1_t) | |
3eaa9939 | 937 | auth_rw_cache($1_t) |
847937da | 938 | |
e933ac40 MG |
939 | application_exec_all($1_t) |
940 | # The library functions always try to open read-write first, | |
941 | # then fall back to read-only if it fails. | |
942 | init_dontaudit_rw_utmp($1_t) | |
943 | ||
847937da | 944 | # Stop warnings about access to /dev/console |
3eaa9939 DW |
945 | init_dontaudit_use_fds($1_usertype) |
946 | init_dontaudit_use_script_fds($1_usertype) | |
847937da | 947 | |
3eaa9939 | 948 | libs_exec_lib_files($1_usertype) |
847937da | 949 | |
3eaa9939 | 950 | logging_dontaudit_getattr_all_logs($1_usertype) |
847937da | 951 | |
847937da | 952 | # for running TeX programs |
3eaa9939 DW |
953 | miscfiles_read_tetex_data($1_usertype) |
954 | miscfiles_exec_tetex_data($1_usertype) | |
955 | ||
956 | seutil_read_config($1_usertype) | |
847937da | 957 | |
3eaa9939 DW |
958 | optional_policy(` |
959 | cups_read_config($1_usertype) | |
960 | cups_stream_connect($1_usertype) | |
961 | cups_stream_connect_ptal($1_usertype) | |
962 | ') | |
847937da CP |
963 | |
964 | optional_policy(` | |
3eaa9939 | 965 | kerberos_use($1_usertype) |
d141ac47 | 966 | kerberos_filetrans_home_content($1_usertype) |
847937da CP |
967 | ') |
968 | ||
969 | optional_policy(` | |
3eaa9939 | 970 | mta_dontaudit_read_spool_symlinks($1_usertype) |
847937da CP |
971 | ') |
972 | ||
973 | optional_policy(` | |
3eaa9939 | 974 | quota_dontaudit_getattr_db($1_usertype) |
847937da CP |
975 | ') |
976 | ||
977 | optional_policy(` | |
3eaa9939 DW |
978 | rpm_read_db($1_usertype) |
979 | rpm_dontaudit_manage_db($1_usertype) | |
980 | rpm_read_cache($1_usertype) | |
847937da CP |
981 | ') |
982 | ||
983 | optional_policy(` | |
3eaa9939 | 984 | oddjob_run_mkhomedir($1_t, $1_r) |
847937da CP |
985 | ') |
986 | ') | |
987 | ||
988 | ####################################### | |
989 | ## <summary> | |
990 | ## The template for creating a unprivileged login user. | |
991 | ## </summary> | |
992 | ## <desc> | |
993 | ## <p> | |
994 | ## This template creates a user domain, types, and | |
995 | ## rules for the user's tty, pty, home directories, | |
996 | ## tmp, and tmpfs files. | |
997 | ## </p> | |
998 | ## </desc> | |
999 | ## <param name="userdomain_prefix"> | |
1000 | ## <summary> | |
1001 | ## The prefix of the user domain (e.g., user | |
1002 | ## is the prefix for user_t). | |
1003 | ## </summary> | |
1004 | ## </param> | |
1005 | # | |
1006 | template(`userdom_restricted_user_template',` | |
1007 | gen_require(` | |
1008 | attribute unpriv_userdomain; | |
847937da CP |
1009 | ') |
1010 | ||
1011 | userdom_login_user_template($1) | |
b16c6b8c | 1012 | |
0f707d52 | 1013 | typeattribute $1_t unpriv_userdomain; |
15722ec9 | 1014 | domain_interactive_fd($1_t) |
b16c6b8c | 1015 | |
3eaa9939 DW |
1016 | allow $1_usertype self:netlink_kobject_uevent_socket create_socket_perms; |
1017 | dontaudit $1_usertype self:netlink_audit_socket create_socket_perms; | |
1018 | ||
0c73cd25 CP |
1019 | ############################## |
1020 | # | |
1021 | # Local policy | |
1022 | # | |
1023 | ||
847937da | 1024 | optional_policy(` |
e933ac40 | 1025 | loadkeys_run($1_t, $1_r) |
847937da CP |
1026 | ') |
1027 | ') | |
1028 | ||
1029 | ####################################### | |
1030 | ## <summary> | |
1031 | ## The template for creating a unprivileged xwindows login user. | |
1032 | ## </summary> | |
1033 | ## <desc> | |
1034 | ## <p> | |
1035 | ## The template for creating a unprivileged xwindows login user. | |
1036 | ## </p> | |
1037 | ## <p> | |
1038 | ## This template creates a user domain, types, and | |
1039 | ## rules for the user's tty, pty, home directories, | |
1040 | ## tmp, and tmpfs files. | |
1041 | ## </p> | |
1042 | ## </desc> | |
1043 | ## <param name="userdomain_prefix"> | |
1044 | ## <summary> | |
1045 | ## The prefix of the user domain (e.g., user | |
1046 | ## is the prefix for user_t). | |
1047 | ## </summary> | |
1048 | ## </param> | |
1049 | # | |
1050 | template(`userdom_restricted_xwindows_user_template',` | |
1051 | ||
1052 | userdom_restricted_user_template($1) | |
1053 | ||
847937da CP |
1054 | ############################## |
1055 | # | |
1056 | # Local policy | |
1057 | # | |
1058 | ||
296273a7 | 1059 | auth_role($1_r, $1_t) |
3eaa9939 | 1060 | auth_search_pam_console_data($1_usertype) |
b45aaab9 | 1061 | auth_dontaudit_read_login_records($1_usertype) |
847937da | 1062 | |
3eaa9939 DW |
1063 | dev_read_sound($1_usertype) |
1064 | dev_write_sound($1_usertype) | |
847937da | 1065 | # gnome keyring wants to read this. |
3eaa9939 DW |
1066 | dev_dontaudit_read_rand($1_usertype) |
1067 | # temporarily allow since openoffice requires this | |
1068 | dev_read_rand($1_usertype) | |
847937da | 1069 | |
3eaa9939 DW |
1070 | dev_read_video_dev($1_usertype) |
1071 | dev_write_video_dev($1_usertype) | |
1072 | dev_rw_wireless($1_usertype) | |
1073 | ||
773094ba DW |
1074 | libs_dontaudit_setattr_lib_files($1_usertype) |
1075 | ||
3eaa9939 DW |
1076 | tunable_policy(`user_rw_noexattrfile',` |
1077 | dev_rw_usbfs($1_t) | |
1078 | dev_rw_generic_usb_dev($1_usertype) | |
1079 | ||
1080 | fs_manage_noxattr_fs_files($1_usertype) | |
1081 | fs_manage_noxattr_fs_dirs($1_usertype) | |
1082 | fs_manage_dos_dirs($1_usertype) | |
1083 | fs_manage_dos_files($1_usertype) | |
1084 | storage_raw_read_removable_device($1_usertype) | |
1085 | storage_raw_write_removable_device($1_usertype) | |
1086 | ') | |
1087 | ||
1088 | logging_send_syslog_msg($1_usertype) | |
847937da CP |
1089 | logging_dontaudit_send_audit_msgs($1_t) |
1090 | ||
1091 | # Need to to this just so screensaver will work. Should be moved to screensaver domain | |
1092 | logging_send_audit_msgs($1_t) | |
1093 | selinux_get_enforce_mode($1_t) | |
3eaa9939 DW |
1094 | seutil_exec_restorecond($1_t) |
1095 | seutil_read_file_contexts($1_t) | |
1096 | seutil_read_default_contexts($1_t) | |
847937da | 1097 | |
93c49bdb CP |
1098 | xserver_restricted_role($1_r, $1_t) |
1099 | ||
847937da | 1100 | optional_policy(` |
3eaa9939 | 1101 | alsa_read_rw_config($1_usertype) |
847937da CP |
1102 | ') |
1103 | ||
a8183914 MG |
1104 | # cjp: needed by KDE apps |
1105 | # bug: #682499 | |
1106 | optional_policy(` | |
1107 | gnome_read_usr_config($1_usertype) | |
ac7085d0 | 1108 | gnome_role_gkeyringd($1, $1_r, $1_usertype) |
3a7aacc9 | 1109 | # cjp: telepathy F15 bugs |
2aa4540b | 1110 | telepathy_role($1_r, $1_t, $1) |
a8183914 MG |
1111 | ') |
1112 | ||
847937da | 1113 | optional_policy(` |
3eaa9939 DW |
1114 | dbus_role_template($1, $1_r, $1_usertype) |
1115 | dbus_system_bus_client($1_usertype) | |
1116 | allow $1_usertype $1_usertype:dbus send_msg; | |
1117 | ||
1118 | optional_policy(` | |
1119 | abrt_dbus_chat($1_usertype) | |
1120 | abrt_run_helper($1_usertype, $1_r) | |
1121 | ') | |
1122 | ||
1123 | optional_policy(` | |
b45aaab9 | 1124 | consolekit_dontaudit_read_log($1_usertype) |
3eaa9939 DW |
1125 | consolekit_dbus_chat($1_usertype) |
1126 | ') | |
1127 | ||
1128 | optional_policy(` | |
1129 | cups_dbus_chat($1_usertype) | |
1130 | cups_dbus_chat_config($1_usertype) | |
1131 | ') | |
847937da CP |
1132 | |
1133 | optional_policy(` | |
3eaa9939 DW |
1134 | devicekit_dbus_chat($1_usertype) |
1135 | devicekit_dbus_chat_disk($1_usertype) | |
1136 | devicekit_dbus_chat_power($1_usertype) | |
847937da CP |
1137 | ') |
1138 | ||
1139 | optional_policy(` | |
3eaa9939 | 1140 | fprintd_dbus_chat($1_t) |
847937da CP |
1141 | ') |
1142 | ') | |
1143 | ||
3eaa9939 DW |
1144 | optional_policy(` |
1145 | policykit_role($1_r, $1_usertype) | |
1146 | ') | |
1147 | ||
1148 | optional_policy(` | |
1149 | pulseaudio_role($1_r, $1_usertype) | |
9bf4902f DG |
1150 | pulseaudio_filetrans_admin_home_content($1_usertype) |
1151 | pulseaudio_filetrans_home_content($1_usertype) | |
3eaa9939 DW |
1152 | ') |
1153 | ||
1154 | optional_policy(` | |
1155 | rtkit_scheduled($1_usertype) | |
847937da CP |
1156 | ') |
1157 | ||
847937da CP |
1158 | optional_policy(` |
1159 | setroubleshoot_dontaudit_stream_connect($1_t) | |
3eaa9939 DW |
1160 | ') |
1161 | ||
1162 | optional_policy(` | |
1163 | udev_read_db($1_usertype) | |
1164 | ') | |
1165 | ||
1166 | optional_policy(` | |
1167 | wm_role_template($1, $1_r, $1_t) | |
847937da CP |
1168 | ') |
1169 | ') | |
1170 | ||
1171 | ####################################### | |
1172 | ## <summary> | |
1173 | ## The template for creating a unprivileged user roughly | |
1174 | ## equivalent to a regular linux user. | |
1175 | ## </summary> | |
1176 | ## <desc> | |
1177 | ## <p> | |
1178 | ## The template for creating a unprivileged user roughly | |
1179 | ## equivalent to a regular linux user. | |
1180 | ## </p> | |
1181 | ## <p> | |
1182 | ## This template creates a user domain, types, and | |
1183 | ## rules for the user's tty, pty, home directories, | |
1184 | ## tmp, and tmpfs files. | |
1185 | ## </p> | |
1186 | ## </desc> | |
1187 | ## <param name="userdomain_prefix"> | |
1188 | ## <summary> | |
1189 | ## The prefix of the user domain (e.g., user | |
1190 | ## is the prefix for user_t). | |
1191 | ## </summary> | |
1192 | ## </param> | |
1193 | # | |
1194 | template(`userdom_unpriv_user_template', ` | |
1195 | ||
1196 | ############################## | |
1197 | # | |
1198 | # Declarations | |
1199 | # | |
1200 | ||
1201 | # Inherit rules for ordinary users. | |
3eaa9939 | 1202 | userdom_restricted_xwindows_user_template($1) |
847937da CP |
1203 | userdom_common_user_template($1) |
1204 | ||
1205 | ############################## | |
1206 | # | |
1207 | # Local policy | |
1208 | # | |
0c73cd25 CP |
1209 | |
1210 | # port access is audited even if dac would not have allowed it, so dontaudit it here | |
3eaa9939 | 1211 | # corenet_dontaudit_tcp_bind_all_reserved_ports($1_t) |
bbcd3c97 CP |
1212 | # Need the following rule to allow users to run vpnc |
1213 | corenet_tcp_bind_xserver_port($1_t) | |
8b456c73 | 1214 | corenet_tcp_bind_generic_node($1_usertype) |
0c73cd25 | 1215 | |
3eaa9939 | 1216 | storage_rw_fuse($1_t) |
a1fcff33 | 1217 | |
e933ac40 MG |
1218 | files_exec_usr_files($1_t) |
1219 | # cjp: why? | |
1220 | files_read_kernel_symbol_table($1_t) | |
1221 | ||
1222 | ifndef(`enable_mls',` | |
1223 | fs_exec_noxattr($1_t) | |
1224 | ||
1225 | tunable_policy(`user_rw_noexattrfile',` | |
1226 | fs_manage_noxattr_fs_files($1_t) | |
1227 | fs_manage_noxattr_fs_dirs($1_t) | |
1228 | # Write floppies | |
1229 | storage_raw_read_removable_device($1_t) | |
1230 | storage_raw_write_removable_device($1_t) | |
1231 | ',` | |
1232 | storage_raw_read_removable_device($1_t) | |
1233 | ') | |
1234 | ') | |
1235 | ||
3eaa9939 | 1236 | miscfiles_read_hwdata($1_usertype) |
0c73cd25 CP |
1237 | |
1238 | # Allow users to run TCP servers (bind to ports and accept connection from | |
6073ea1e | 1239 | # the same domain and outside users) disabling this forces FTP passive mode |
0c73cd25 | 1240 | # and may change other protocols |
40068f3d DW |
1241 | |
1242 | tunable_policy(`user_share_music',` | |
7d5759fd | 1243 | corenet_tcp_bind_daap_port($1_usertype) |
40068f3d DW |
1244 | ') |
1245 | ||
34c8fabe | 1246 | tunable_policy(`user_tcp_server',` |
3eaa9939 DW |
1247 | corenet_tcp_bind_all_unreserved_ports($1_usertype) |
1248 | ') | |
1249 | ||
1250 | tunable_policy(`user_setrlimit',` | |
1251 | allow $1_usertype self:process setrlimit; | |
34c8fabe | 1252 | ') |
0c73cd25 | 1253 | |
bb7170f6 | 1254 | optional_policy(` |
3eaa9939 DW |
1255 | cdrecord_role($1_r, $1_t) |
1256 | ') | |
1257 | ||
1258 | optional_policy(` | |
1259 | cron_role($1_r, $1_t) | |
1260 | ') | |
1261 | ||
1262 | optional_policy(` | |
1263 | games_rw_data($1_usertype) | |
1264 | ') | |
1265 | ||
1266 | optional_policy(` | |
1267 | gpg_role($1_r, $1_usertype) | |
1268 | ') | |
1269 | ||
1270 | optional_policy(` | |
1271 | gnomeclock_dbus_chat($1_t) | |
1272 | ') | |
1273 | ||
1274 | optional_policy(` | |
1275 | gpm_stream_connect($1_usertype) | |
1276 | ') | |
1277 | ||
3eaa9939 DW |
1278 | optional_policy(` |
1279 | mount_run_fusermount($1_t, $1_r) | |
5598732f | 1280 | mount_read_pid_files($1_t) |
3eaa9939 DW |
1281 | ') |
1282 | ||
1283 | optional_policy(` | |
1284 | wine_role_template($1, $1_r, $1_t) | |
1f91e1bf CP |
1285 | ') |
1286 | ||
bb7170f6 | 1287 | optional_policy(` |
3eaa9939 | 1288 | postfix_run_postdrop($1_t, $1_r) |
cbedaf1d | 1289 | postfix_search_spool($1_t) |
e08118a5 CP |
1290 | ') |
1291 | ||
3eaa9939 | 1292 | # Run pppd in pppd_t by default for user |
6b19be33 | 1293 | optional_policy(` |
3eaa9939 | 1294 | ppp_run_cond($1_t, $1_r) |
6b19be33 | 1295 | ') |
31aa991d MG |
1296 | |
1297 | optional_policy(` | |
1298 | vdagent_getattr_log($1_t) | |
1299 | vdagent_getattr_exec($1_t) | |
1300 | vdagent_stream_connect($1_t) | |
1301 | ') | |
b16c6b8c | 1302 | ') |
4d8ddf9a | 1303 | |
8fd36732 CP |
1304 | ####################################### |
1305 | ## <summary> | |
1306 | ## The template for creating an administrative user. | |
1307 | ## </summary> | |
1308 | ## <desc> | |
1309 | ## <p> | |
1310 | ## This template creates a user domain, types, and | |
1311 | ## rules for the user's tty, pty, home directories, | |
1312 | ## tmp, and tmpfs files. | |
1313 | ## </p> | |
2ec4c9d3 | 1314 | ## <p> |
8fd36732 CP |
1315 | ## The privileges given to administrative users are: |
1316 | ## <ul> | |
1317 | ## <li>Raw disk access</li> | |
1318 | ## <li>Set all sysctls</li> | |
1319 | ## <li>All kernel ring buffer controls</li> | |
8fd36732 CP |
1320 | ## <li>Create, read, write, and delete all files but shadow</li> |
1321 | ## <li>Manage source and binary format SELinux policy</li> | |
1322 | ## <li>Run insmod</li> | |
1323 | ## </ul> | |
2ec4c9d3 CP |
1324 | ## </p> |
1325 | ## </desc> | |
8fd36732 | 1326 | ## <param name="userdomain_prefix"> |
885b83ec | 1327 | ## <summary> |
8fd36732 CP |
1328 | ## The prefix of the user domain (e.g., sysadm |
1329 | ## is the prefix for sysadm_t). | |
885b83ec | 1330 | ## </summary> |
8fd36732 | 1331 | ## </param> |
4d8ddf9a | 1332 | # |
bbcd3c97 | 1333 | template(`userdom_admin_user_template',` |
142e9f40 | 1334 | gen_require(` |
0be901ba | 1335 | attribute admindomain; |
3eaa9939 | 1336 | class passwd { passwd chfn chsh rootok crontab }; |
142e9f40 CP |
1337 | ') |
1338 | ||
0c73cd25 CP |
1339 | ############################## |
1340 | # | |
1341 | # Declarations | |
1342 | # | |
1343 | ||
1344 | # Inherit rules for ordinary users. | |
847937da | 1345 | userdom_login_user_template($1) |
bbcd3c97 | 1346 | userdom_common_user_template($1) |
0c73cd25 | 1347 | |
1815bad1 | 1348 | domain_obj_id_change_exemption($1_t) |
0c73cd25 CP |
1349 | role system_r types $1_t; |
1350 | ||
0be901ba | 1351 | typeattribute $1_t admindomain; |
bd75703c | 1352 | |
142e9f40 | 1353 | ifdef(`direct_sysadm_daemon',` |
1815bad1 | 1354 | domain_system_change_exemption($1_t) |
142e9f40 | 1355 | ') |
2a98379a | 1356 | |
0c73cd25 CP |
1357 | ############################## |
1358 | # | |
1359 | # $1_t local policy | |
1360 | # | |
1361 | ||
995bdbb1 | 1362 | allow $1_t self:capability ~{ sys_ptrace sys_module audit_control audit_write }; |
1363 | tunable_policy(`deny_ptrace',`',` | |
1364 | allow $1_t self:capability sys_ptrace; | |
1365 | ') | |
4ba442da | 1366 | allow $1_t self:capability2 syslog; |
0c73cd25 | 1367 | allow $1_t self:process { setexec setfscreate }; |
bd75703c CP |
1368 | allow $1_t self:netlink_audit_socket nlmsg_readpriv; |
1369 | allow $1_t self:tun_socket create; | |
0c73cd25 CP |
1370 | # Set password information for other users. |
1371 | allow $1_t self:passwd { passwd chfn chsh }; | |
0c73cd25 CP |
1372 | # Skip authentication when pam_rootok is specified. |
1373 | allow $1_t self:passwd rootok; | |
1374 | ||
3eaa9939 DW |
1375 | # Manipulate other users crontab. |
1376 | allow $1_t self:passwd crontab; | |
1377 | ||
0c73cd25 | 1378 | kernel_read_software_raid_state($1_t) |
445522dc | 1379 | kernel_getattr_core_if($1_t) |
0fd9dc55 | 1380 | kernel_getattr_message_if($1_t) |
0c73cd25 CP |
1381 | kernel_change_ring_buffer_level($1_t) |
1382 | kernel_clear_ring_buffer($1_t) | |
1383 | kernel_read_ring_buffer($1_t) | |
1384 | kernel_get_sysvipc_info($1_t) | |
445522dc | 1385 | kernel_rw_all_sysctls($1_t) |
8fd36732 CP |
1386 | # signal unlabeled processes: |
1387 | kernel_kill_unlabeled($1_t) | |
1388 | kernel_signal_unlabeled($1_t) | |
1389 | kernel_sigstop_unlabeled($1_t) | |
1390 | kernel_signull_unlabeled($1_t) | |
1391 | kernel_sigchld_unlabeled($1_t) | |
3eaa9939 | 1392 | kernel_signal($1_t) |
2ec4c9d3 CP |
1393 | |
1394 | corenet_tcp_bind_generic_port($1_t) | |
1395 | # allow setting up tunnels | |
5b6ddb98 | 1396 | corenet_rw_tun_tap_dev($1_t) |
2ec4c9d3 | 1397 | |
207c4763 CP |
1398 | dev_getattr_generic_blk_files($1_t) |
1399 | dev_getattr_generic_chr_files($1_t) | |
bbcd3c97 CP |
1400 | # for lsof |
1401 | dev_getattr_mtrr_dev($1_t) | |
1402 | # Allow MAKEDEV to work | |
1403 | dev_create_all_blk_files($1_t) | |
1404 | dev_create_all_chr_files($1_t) | |
1405 | dev_delete_all_blk_files($1_t) | |
1406 | dev_delete_all_chr_files($1_t) | |
1407 | dev_rename_all_blk_files($1_t) | |
1408 | dev_rename_all_chr_files($1_t) | |
1409 | dev_create_generic_symlinks($1_t) | |
bba79b24 DW |
1410 | dev_rw_generic_usb_dev($1_t) |
1411 | dev_rw_usbfs($1_t) | |
0c73cd25 | 1412 | |
c9428d33 CP |
1413 | domain_setpriority_all_domains($1_t) |
1414 | domain_read_all_domains_state($1_t) | |
ccc59782 | 1415 | domain_getattr_all_domains($1_t) |
d79b5476 | 1416 | domain_getcap_all_domains($1_t) |
ccc59782 | 1417 | domain_dontaudit_ptrace_all_domains($1_t) |
0c73cd25 CP |
1418 | # signal all domains: |
1419 | domain_kill_all_domains($1_t) | |
1420 | domain_signal_all_domains($1_t) | |
1421 | domain_signull_all_domains($1_t) | |
1422 | domain_sigstop_all_domains($1_t) | |
1423 | domain_sigstop_all_domains($1_t) | |
1424 | domain_sigchld_all_domains($1_t) | |
2ec4c9d3 CP |
1425 | # for lsof |
1426 | domain_getattr_all_sockets($1_t) | |
3eaa9939 | 1427 | domain_dontaudit_getattr_all_sockets($1_t) |
0c73cd25 | 1428 | |
99505c1c | 1429 | files_exec_usr_src_files($1_t) |
0c73cd25 | 1430 | |
bbcd3c97 | 1431 | fs_getattr_all_fs($1_t) |
3eaa9939 DW |
1432 | fs_getattr_all_files($1_t) |
1433 | fs_list_all($1_t) | |
bbcd3c97 CP |
1434 | fs_set_all_quotas($1_t) |
1435 | fs_exec_noxattr($1_t) | |
1436 | ||
1437 | storage_raw_read_removable_device($1_t) | |
1438 | storage_raw_write_removable_device($1_t) | |
579a217f | 1439 | storage_dontaudit_read_fixed_disk($1_t) |
bbcd3c97 | 1440 | |
af2d8802 | 1441 | term_use_all_inherited_terms($1_t) |
9e6ca004 | 1442 | term_use_unallocated_ttys($1_t) |
bbcd3c97 CP |
1443 | |
1444 | auth_getattr_shadow($1_t) | |
1445 | # Manage almost all files | |
1e7ee442 | 1446 | files_manage_non_security_dirs($1_t) |
df34481f | 1447 | files_manage_non_security_files($1_t) |
bbcd3c97 | 1448 | # Relabel almost all files |
df34481f | 1449 | files_relabel_non_security_files($1_t) |
bbcd3c97 CP |
1450 | |
1451 | init_telinit($1_t) | |
0c73cd25 | 1452 | |
c9428d33 | 1453 | logging_send_syslog_msg($1_t) |
0c73cd25 | 1454 | |
2371d8d8 MG |
1455 | optional_policy(` |
1456 | modutils_domtrans_insmod($1_t) | |
1457 | modutils_domtrans_depmod($1_t) | |
1458 | ') | |
0c73cd25 | 1459 | |
0c73cd25 CP |
1460 | # The following rule is temporary until such time that a complete |
1461 | # policy management infrastructure is in place so that an administrator | |
1462 | # cannot directly manipulate policy files with arbitrary programs. | |
1815bad1 | 1463 | seutil_manage_src_policy($1_t) |
0c73cd25 CP |
1464 | # Violates the goal of limiting write access to checkpolicy. |
1465 | # But presently necessary for installing the file_contexts file. | |
1815bad1 | 1466 | seutil_manage_bin_policy($1_t) |
0c73cd25 | 1467 | |
eedf23b8 DW |
1468 | systemd_config_all_services($1_t) |
1469 | ||
296273a7 CP |
1470 | userdom_manage_user_home_content_dirs($1_t) |
1471 | userdom_manage_user_home_content_files($1_t) | |
1472 | userdom_manage_user_home_content_symlinks($1_t) | |
1473 | userdom_manage_user_home_content_pipes($1_t) | |
1474 | userdom_manage_user_home_content_sockets($1_t) | |
1475 | userdom_user_home_dir_filetrans_user_home_content($1_t, { dir file lnk_file fifo_file sock_file }) | |
1476 | ||
bbcd3c97 CP |
1477 | tunable_policy(`user_rw_noexattrfile',` |
1478 | fs_manage_noxattr_fs_files($1_t) | |
1479 | fs_manage_noxattr_fs_dirs($1_t) | |
1480 | ',` | |
1481 | fs_read_noxattr_fs_files($1_t) | |
1482 | ') | |
1483 | ||
e8cb08ae CP |
1484 | optional_policy(` |
1485 | postgresql_unconfined($1_t) | |
1486 | ') | |
1487 | ||
6b19be33 CP |
1488 | optional_policy(` |
1489 | userhelper_exec($1_t) | |
1490 | ') | |
1491 | ') | |
1492 | ||
1493 | ######################################## | |
1494 | ## <summary> | |
1495 | ## Allow user to run as a secadm | |
1496 | ## </summary> | |
1497 | ## <desc> | |
1498 | ## <p> | |
1499 | ## Create objects in a user home directory | |
1500 | ## with an automatic type transition to | |
1501 | ## a specified private type. | |
1502 | ## </p> | |
1503 | ## <p> | |
1504 | ## This is a templated interface, and should only | |
1505 | ## be called from a per-userdomain template. | |
1506 | ## </p> | |
1507 | ## </desc> | |
6b19be33 CP |
1508 | ## <param name="domain"> |
1509 | ## <summary> | |
1510 | ## Domain allowed access. | |
1511 | ## </summary> | |
1512 | ## </param> | |
1513 | ## <param name="role"> | |
1514 | ## <summary> | |
1515 | ## The role of the object to create. | |
1516 | ## </summary> | |
1517 | ## </param> | |
6b19be33 CP |
1518 | # |
1519 | template(`userdom_security_admin_template',` | |
1520 | allow $1 self:capability { dac_read_search dac_override }; | |
1521 | ||
1522 | corecmd_exec_shell($1) | |
1523 | ||
1524 | domain_obj_id_change_exemption($1) | |
1525 | ||
1526 | dev_relabel_all_dev_nodes($1) | |
1527 | ||
1528 | files_create_boot_flag($1) | |
3eaa9939 DW |
1529 | files_create_default_dir($1) |
1530 | files_root_filetrans_default($1, dir) | |
6b19be33 CP |
1531 | |
1532 | # Necessary for managing /boot/efi | |
1533 | fs_manage_dos_files($1) | |
1534 | ||
1535 | mls_process_read_up($1) | |
f8233ab7 | 1536 | mls_file_read_all_levels($1) |
6b19be33 CP |
1537 | mls_file_upgrade($1) |
1538 | mls_file_downgrade($1) | |
1539 | ||
1540 | selinux_set_enforce_mode($1) | |
f0435b1a | 1541 | selinux_set_all_booleans($1) |
6b19be33 | 1542 | selinux_set_parameters($1) |
4ba442da | 1543 | selinux_read_policy($1) |
6b19be33 | 1544 | |
df34481f | 1545 | files_relabel_all_files($1) |
6b19be33 CP |
1546 | auth_relabel_shadow($1) |
1547 | ||
1548 | init_exec($1) | |
1549 | ||
1550 | logging_send_syslog_msg($1) | |
1551 | logging_read_audit_log($1) | |
1552 | logging_read_generic_logs($1) | |
1553 | logging_read_audit_config($1) | |
1554 | ||
1555 | seutil_manage_bin_policy($1) | |
f362730d DW |
1556 | seutil_manage_default_contexts($1) |
1557 | seutil_manage_file_contexts($1) | |
1558 | seutil_manage_module_store($1) | |
1559 | seutil_manage_config($1) | |
296273a7 | 1560 | seutil_run_checkpolicy($1,$2) |
f4aae210 MG |
1561 | seutil_run_loadpolicy($1,$2) |
1562 | seutil_run_semanage($1,$2) | |
1563 | seutil_run_setsebool($1,$2) | |
296273a7 | 1564 | seutil_run_setfiles($1, $2) |
6b19be33 | 1565 | |
f4aae210 MG |
1566 | seutil_manage_bin_policy($1) |
1567 | seutil_manage_default_contexts($1) | |
1568 | seutil_manage_file_contexts($1) | |
1569 | seutil_manage_module_store($1) | |
1570 | seutil_manage_config($1) | |
1571 | ||
6b19be33 | 1572 | optional_policy(` |
f4aae210 | 1573 | aide_run($1,$2) |
6b19be33 CP |
1574 | ') |
1575 | ||
1576 | optional_policy(` | |
1577 | consoletype_exec($1) | |
1578 | ') | |
1579 | ||
1580 | optional_policy(` | |
1581 | dmesg_exec($1) | |
1582 | ') | |
1583 | ||
f4aae210 MG |
1584 | optional_policy(` |
1585 | ipsec_run_setkey($1,$2) | |
9e8f65c8 CP |
1586 | ') |
1587 | ||
6b19be33 | 1588 | optional_policy(` |
f4aae210 | 1589 | netlabel_run_mgmt($1,$2) |
a1fcff33 | 1590 | ') |
ff449b62 CP |
1591 | |
1592 | optional_policy(` | |
1593 | samhain_run($1, $2) | |
1594 | ') | |
4d8ddf9a | 1595 | ') |
490639cd | 1596 | |
b1bf2f78 CP |
1597 | ######################################## |
1598 | ## <summary> | |
296273a7 CP |
1599 | ## Make the specified type usable in a |
1600 | ## user home directory. | |
b1bf2f78 | 1601 | ## </summary> |
296273a7 | 1602 | ## <param name="type"> |
b1bf2f78 | 1603 | ## <summary> |
296273a7 CP |
1604 | ## Type to be used as a file in the |
1605 | ## user home directory. | |
b1bf2f78 CP |
1606 | ## </summary> |
1607 | ## </param> | |
b1bf2f78 | 1608 | # |
296273a7 CP |
1609 | interface(`userdom_user_home_content',` |
1610 | gen_require(` | |
1611 | type user_home_t; | |
3eaa9939 | 1612 | attribute user_home_type; |
296273a7 CP |
1613 | ') |
1614 | ||
1615 | allow $1 user_home_t:filesystem associate; | |
1616 | files_type($1) | |
1617 | ubac_constrained($1) | |
3eaa9939 DW |
1618 | |
1619 | files_poly_member($1) | |
1620 | typeattribute $1 user_home_type; | |
b1bf2f78 CP |
1621 | ') |
1622 | ||
ca9e8850 DW |
1623 | ######################################## |
1624 | ## <summary> | |
1625 | ## Make the specified type usable in a | |
1626 | ## generic temporary directory. | |
1627 | ## </summary> | |
1628 | ## <param name="type"> | |
1629 | ## <summary> | |
1630 | ## Type to be used as a file in the | |
1631 | ## generic temporary directory. | |
1632 | ## </summary> | |
1633 | ## </param> | |
1634 | # | |
1635 | interface(`userdom_user_tmp_content',` | |
1636 | gen_require(` | |
1637 | attribute user_tmp_type; | |
1638 | ') | |
1639 | ||
1640 | typeattribute $1 user_tmp_type; | |
1641 | ||
1642 | files_tmp_file($1) | |
1643 | ubac_constrained($1) | |
1644 | ') | |
1645 | ||
04b8986d DG |
1646 | ######################################## |
1647 | ## <summary> | |
1648 | ## Make the specified type usable in a | |
1649 | ## generic tmpfs_t directory. | |
1650 | ## </summary> | |
1651 | ## <param name="type"> | |
1652 | ## <summary> | |
1653 | ## Type to be used as a file in the | |
1654 | ## generic temporary directory. | |
1655 | ## </summary> | |
1656 | ## </param> | |
1657 | # | |
1658 | interface(`userdom_user_tmpfs_content',` | |
1659 | gen_require(` | |
1660 | attribute user_tmpfs_type; | |
1661 | ') | |
1662 | ||
1663 | typeattribute $1 user_tmpfs_type; | |
1664 | ||
1665 | files_tmpfs_file($1) | |
1666 | ubac_constrained($1) | |
1667 | ') | |
1668 | ||
bd75703c CP |
1669 | ######################################## |
1670 | ## <summary> | |
1671 | ## Allow domain to attach to TUN devices created by administrative users. | |
1672 | ## </summary> | |
1673 | ## <param name="domain"> | |
1674 | ## <summary> | |
1675 | ## Domain allowed access. | |
1676 | ## </summary> | |
1677 | ## </param> | |
1678 | # | |
1679 | interface(`userdom_attach_admin_tun_iface',` | |
1680 | gen_require(` | |
0be901ba | 1681 | attribute admindomain; |
bd75703c CP |
1682 | ') |
1683 | ||
0be901ba | 1684 | allow $1 admindomain:tun_socket relabelfrom; |
bd75703c CP |
1685 | allow $1 self:tun_socket relabelto; |
1686 | ') | |
1687 | ||
b1bf2f78 CP |
1688 | ######################################## |
1689 | ## <summary> | |
296273a7 | 1690 | ## Set the attributes of a user pty. |
b1bf2f78 | 1691 | ## </summary> |
296273a7 | 1692 | ## <param name="domain"> |
b1bf2f78 | 1693 | ## <summary> |
296273a7 | 1694 | ## Domain allowed access. |
b1bf2f78 CP |
1695 | ## </summary> |
1696 | ## </param> | |
b1bf2f78 | 1697 | # |
296273a7 CP |
1698 | interface(`userdom_setattr_user_ptys',` |
1699 | gen_require(` | |
1700 | type user_devpts_t; | |
1701 | ') | |
1702 | ||
bf530f53 | 1703 | allow $1 user_devpts_t:chr_file setattr_chr_file_perms; |
b1bf2f78 CP |
1704 | ') |
1705 | ||
1706 | ######################################## | |
1707 | ## <summary> | |
296273a7 | 1708 | ## Create a user pty. |
b1bf2f78 | 1709 | ## </summary> |
296273a7 | 1710 | ## <param name="domain"> |
b1bf2f78 | 1711 | ## <summary> |
296273a7 | 1712 | ## Domain allowed access. |
b1bf2f78 CP |
1713 | ## </summary> |
1714 | ## </param> | |
b1bf2f78 | 1715 | # |
296273a7 CP |
1716 | interface(`userdom_create_user_pty',` |
1717 | gen_require(` | |
1718 | type user_devpts_t; | |
1719 | ') | |
1720 | ||
1721 | term_create_pty($1, user_devpts_t) | |
b1bf2f78 CP |
1722 | ') |
1723 | ||
1724 | ######################################## | |
1725 | ## <summary> | |
296273a7 | 1726 | ## Get the attributes of user home directories. |
b1bf2f78 | 1727 | ## </summary> |
296273a7 | 1728 | ## <param name="domain"> |
b1bf2f78 | 1729 | ## <summary> |
296273a7 | 1730 | ## Domain allowed access. |
b1bf2f78 CP |
1731 | ## </summary> |
1732 | ## </param> | |
b1bf2f78 | 1733 | # |
296273a7 CP |
1734 | interface(`userdom_getattr_user_home_dirs',` |
1735 | gen_require(` | |
1736 | type user_home_dir_t; | |
1737 | ') | |
1738 | ||
1739 | allow $1 user_home_dir_t:dir getattr_dir_perms; | |
1740 | files_search_home($1) | |
b1bf2f78 CP |
1741 | ') |
1742 | ||
1743 | ######################################## | |
1744 | ## <summary> | |
296273a7 | 1745 | ## Do not audit attempts to get the attributes of user home directories. |
b1bf2f78 | 1746 | ## </summary> |
296273a7 | 1747 | ## <param name="domain"> |
b1bf2f78 | 1748 | ## <summary> |
a0546c9d | 1749 | ## Domain to not audit. |
b1bf2f78 CP |
1750 | ## </summary> |
1751 | ## </param> | |
b1bf2f78 | 1752 | # |
296273a7 CP |
1753 | interface(`userdom_dontaudit_getattr_user_home_dirs',` |
1754 | gen_require(` | |
1755 | type user_home_dir_t; | |
1756 | ') | |
1757 | ||
1758 | dontaudit $1 user_home_dir_t:dir getattr_dir_perms; | |
b1bf2f78 CP |
1759 | ') |
1760 | ||
1761 | ######################################## | |
1762 | ## <summary> | |
296273a7 | 1763 | ## Search user home directories. |
b1bf2f78 | 1764 | ## </summary> |
296273a7 | 1765 | ## <param name="domain"> |
b1bf2f78 | 1766 | ## <summary> |
296273a7 | 1767 | ## Domain allowed access. |
b1bf2f78 CP |
1768 | ## </summary> |
1769 | ## </param> | |
b1bf2f78 | 1770 | # |
296273a7 CP |
1771 | interface(`userdom_search_user_home_dirs',` |
1772 | gen_require(` | |
1773 | type user_home_dir_t; | |
1774 | ') | |
1775 | ||
1776 | allow $1 user_home_dir_t:dir search_dir_perms; | |
3eaa9939 | 1777 | allow $1 user_home_dir_t:lnk_file read_lnk_file_perms; |
296273a7 | 1778 | files_search_home($1) |
b1bf2f78 CP |
1779 | ') |
1780 | ||
1781 | ######################################## | |
1782 | ## <summary> | |
c46376e6 | 1783 | ## Do not audit attempts to search user home directories. |
b1bf2f78 | 1784 | ## </summary> |
c46376e6 CP |
1785 | ## <desc> |
1786 | ## <p> | |
1787 | ## Do not audit attempts to search user home directories. | |
1788 | ## This will supress SELinux denial messages when the specified | |
1789 | ## domain is denied the permission to search these directories. | |
1790 | ## </p> | |
1791 | ## </desc> | |
296273a7 | 1792 | ## <param name="domain"> |
b1bf2f78 | 1793 | ## <summary> |
c46376e6 | 1794 | ## Domain to not audit. |
b1bf2f78 CP |
1795 | ## </summary> |
1796 | ## </param> | |
c46376e6 | 1797 | ## <infoflow type="none"/> |
b1bf2f78 | 1798 | # |
296273a7 CP |
1799 | interface(`userdom_dontaudit_search_user_home_dirs',` |
1800 | gen_require(` | |
1801 | type user_home_dir_t; | |
1802 | ') | |
1803 | ||
1804 | dontaudit $1 user_home_dir_t:dir search_dir_perms; | |
b1bf2f78 CP |
1805 | ') |
1806 | ||
1807 | ######################################## | |
1808 | ## <summary> | |
ff8f0a63 | 1809 | ## List user home directories. |
b1bf2f78 | 1810 | ## </summary> |
296273a7 | 1811 | ## <param name="domain"> |
b1bf2f78 | 1812 | ## <summary> |
ff8f0a63 | 1813 | ## Domain allowed access. |
b1bf2f78 CP |
1814 | ## </summary> |
1815 | ## </param> | |
b1bf2f78 | 1816 | # |
296273a7 CP |
1817 | interface(`userdom_list_user_home_dirs',` |
1818 | gen_require(` | |
1819 | type user_home_dir_t; | |
1820 | ') | |
b1bf2f78 | 1821 | |
296273a7 CP |
1822 | allow $1 user_home_dir_t:dir list_dir_perms; |
1823 | files_search_home($1) | |
3eaa9939 DW |
1824 | |
1825 | tunable_policy(`use_nfs_home_dirs',` | |
1826 | fs_list_nfs($1) | |
1827 | ') | |
1828 | ||
1829 | tunable_policy(`use_samba_home_dirs',` | |
1830 | fs_list_cifs($1) | |
1831 | ') | |
de8af9dc CP |
1832 | ') |
1833 | ||
7c2f5a82 CP |
1834 | ######################################## |
1835 | ## <summary> | |
296273a7 | 1836 | ## Do not audit attempts to list user home subdirectories. |
7c2f5a82 CP |
1837 | ## </summary> |
1838 | ## <param name="domain"> | |
885b83ec | 1839 | ## <summary> |
a7ee7f81 | 1840 | ## Domain to not audit. |
885b83ec | 1841 | ## </summary> |
7c2f5a82 CP |
1842 | ## </param> |
1843 | # | |
296273a7 | 1844 | interface(`userdom_dontaudit_list_user_home_dirs',` |
7c2f5a82 | 1845 | gen_require(` |
296273a7 | 1846 | type user_home_dir_t; |
3eaa9939 | 1847 | type user_home_t; |
7c2f5a82 CP |
1848 | ') |
1849 | ||
296273a7 | 1850 | dontaudit $1 user_home_dir_t:dir list_dir_perms; |
3eaa9939 | 1851 | dontaudit $1 user_home_t:dir list_dir_perms; |
7c2f5a82 CP |
1852 | ') |
1853 | ||
1854 | ######################################## | |
1855 | ## <summary> | |
296273a7 | 1856 | ## Create user home directories. |
7c2f5a82 CP |
1857 | ## </summary> |
1858 | ## <param name="domain"> | |
885b83ec | 1859 | ## <summary> |
7c2f5a82 | 1860 | ## Domain allowed access. |
885b83ec | 1861 | ## </summary> |
7c2f5a82 CP |
1862 | ## </param> |
1863 | # | |
296273a7 CP |
1864 | interface(`userdom_create_user_home_dirs',` |
1865 | gen_require(` | |
1866 | type user_home_dir_t; | |
1867 | ') | |
1868 | ||
1869 | allow $1 user_home_dir_t:dir create_dir_perms; | |
7c2f5a82 CP |
1870 | ') |
1871 | ||
1872 | ######################################## | |
1873 | ## <summary> | |
296273a7 | 1874 | ## Create user home directories. |
7c2f5a82 CP |
1875 | ## </summary> |
1876 | ## <param name="domain"> | |
885b83ec | 1877 | ## <summary> |
7c2f5a82 | 1878 | ## Domain allowed access. |
885b83ec | 1879 | ## </summary> |
7c2f5a82 CP |
1880 | ## </param> |
1881 | # | |
296273a7 | 1882 | interface(`userdom_manage_user_home_dirs',` |
7c2f5a82 | 1883 | gen_require(` |
296273a7 | 1884 | type user_home_dir_t; |
7c2f5a82 CP |
1885 | ') |
1886 | ||
296273a7 | 1887 | allow $1 user_home_dir_t:dir manage_dir_perms; |
7c2f5a82 CP |
1888 | ') |
1889 | ||
d490eb6b | 1890 | ######################################## |
ab940a4c | 1891 | ## <summary> |
296273a7 | 1892 | ## Relabel to user home directories. |
ab940a4c | 1893 | ## </summary> |
414e4151 | 1894 | ## <param name="domain"> |
885b83ec | 1895 | ## <summary> |
725926c5 | 1896 | ## Domain allowed access. |
885b83ec | 1897 | ## </summary> |
414e4151 | 1898 | ## </param> |
d490eb6b | 1899 | # |
296273a7 CP |
1900 | interface(`userdom_relabelto_user_home_dirs',` |
1901 | gen_require(` | |
1902 | type user_home_dir_t; | |
1903 | ') | |
d490eb6b | 1904 | |
296273a7 | 1905 | allow $1 user_home_dir_t:dir relabelto; |
7c2f5a82 CP |
1906 | ') |
1907 | ||
3eaa9939 DW |
1908 | |
1909 | ######################################## | |
1910 | ## <summary> | |
1911 | ## Relabel to user home files. | |
1912 | ## </summary> | |
1913 | ## <param name="domain"> | |
1914 | ## <summary> | |
1915 | ## Domain allowed access. | |
1916 | ## </summary> | |
1917 | ## </param> | |
1918 | # | |
1919 | interface(`userdom_relabelto_user_home_files',` | |
1920 | gen_require(` | |
1921 | type user_home_t; | |
1922 | ') | |
1923 | ||
1924 | allow $1 user_home_t:file relabelto; | |
1925 | ') | |
1926 | ######################################## | |
1927 | ## <summary> | |
1928 | ## Relabel user home files. | |
1929 | ## </summary> | |
1930 | ## <param name="domain"> | |
1931 | ## <summary> | |
1932 | ## Domain allowed access. | |
1933 | ## </summary> | |
1934 | ## </param> | |
1935 | # | |
1936 | interface(`userdom_relabel_user_home_files',` | |
1937 | gen_require(` | |
1938 | type user_home_t; | |
1939 | ') | |
1940 | ||
83029ff3 | 1941 | allow $1 user_home_t:file relabel_file_perms; |
3eaa9939 DW |
1942 | ') |
1943 | ||
7c2f5a82 CP |
1944 | ######################################## |
1945 | ## <summary> | |
296273a7 CP |
1946 | ## Create directories in the home dir root with |
1947 | ## the user home directory type. | |
7c2f5a82 CP |
1948 | ## </summary> |
1949 | ## <param name="domain"> | |
885b83ec | 1950 | ## <summary> |
7c2f5a82 | 1951 | ## Domain allowed access. |
885b83ec | 1952 | ## </summary> |
7c2f5a82 CP |
1953 | ## </param> |
1954 | # | |
296273a7 CP |
1955 | interface(`userdom_home_filetrans_user_home_dir',` |
1956 | gen_require(` | |
1957 | type user_home_dir_t; | |
1958 | ') | |
7c2f5a82 | 1959 | |
296273a7 | 1960 | files_home_filetrans($1, user_home_dir_t, dir) |
7c2f5a82 CP |
1961 | ') |
1962 | ||
d42c7ede CP |
1963 | ######################################## |
1964 | ## <summary> | |
296273a7 CP |
1965 | ## Do a domain transition to the specified |
1966 | ## domain when executing a program in the | |
1967 | ## user home directory. | |
d42c7ede CP |
1968 | ## </summary> |
1969 | ## <desc> | |
1970 | ## <p> | |
296273a7 CP |
1971 | ## Do a domain transition to the specified |
1972 | ## domain when executing a program in the | |
1973 | ## user home directory. | |
d42c7ede CP |
1974 | ## </p> |
1975 | ## <p> | |
296273a7 CP |
1976 | ## No interprocess communication (signals, pipes, |
1977 | ## etc.) is provided by this interface since | |
1978 | ## the domains are not owned by this module. | |
d42c7ede CP |
1979 | ## </p> |
1980 | ## </desc> | |
296273a7 | 1981 | ## <param name="source_domain"> |
d42c7ede | 1982 | ## <summary> |
a0546c9d | 1983 | ## Domain allowed to transition. |
d42c7ede CP |
1984 | ## </summary> |
1985 | ## </param> | |
296273a7 | 1986 | ## <param name="target_domain"> |
d42c7ede | 1987 | ## <summary> |
296273a7 | 1988 | ## Domain to transition to. |
d42c7ede CP |
1989 | ## </summary> |
1990 | ## </param> | |
1991 | # | |
296273a7 CP |
1992 | interface(`userdom_user_home_domtrans',` |
1993 | gen_require(` | |
1994 | type user_home_dir_t, user_home_t; | |
1995 | ') | |
d42c7ede | 1996 | |
296273a7 CP |
1997 | domain_auto_trans($1, user_home_t, $2) |
1998 | allow $1 user_home_dir_t:dir search_dir_perms; | |
1999 | files_search_home($1) | |
d42c7ede CP |
2000 | ') |
2001 | ||
ae9e2716 CP |
2002 | ######################################## |
2003 | ## <summary> | |
296273a7 | 2004 | ## Do not audit attempts to search user home content directories. |
ae9e2716 CP |
2005 | ## </summary> |
2006 | ## <param name="domain"> | |
885b83ec | 2007 | ## <summary> |
a7ee7f81 | 2008 | ## Domain to not audit. |
885b83ec | 2009 | ## </summary> |
ae9e2716 CP |
2010 | ## </param> |
2011 | # | |
296273a7 CP |
2012 | interface(`userdom_dontaudit_search_user_home_content',` |
2013 | gen_require(` | |
2014 | type user_home_t; | |
2015 | ') | |
ae9e2716 | 2016 | |
296273a7 | 2017 | dontaudit $1 user_home_t:dir search_dir_perms; |
3eaa9939 DW |
2018 | fs_dontaudit_list_nfs($1) |
2019 | fs_dontaudit_list_cifs($1) | |
ae9e2716 CP |
2020 | ') |
2021 | ||
2d743657 CP |
2022 | ######################################## |
2023 | ## <summary> | |
2024 | ## List contents of users home directory. | |
2025 | ## </summary> | |
2026 | ## <param name="domain"> | |
2027 | ## <summary> | |
2028 | ## Domain allowed access. | |
2029 | ## </summary> | |
2030 | ## </param> | |
2031 | # | |
2032 | interface(`userdom_list_user_home_content',` | |
2033 | gen_require(` | |
3eaa9939 DW |
2034 | type user_home_dir_t; |
2035 | attribute user_home_type; | |
2d743657 CP |
2036 | ') |
2037 | ||
3eaa9939 DW |
2038 | files_list_home($1) |
2039 | allow $1 { user_home_dir_t user_home_type }:dir list_dir_perms; | |
2d743657 CP |
2040 | ') |
2041 | ||
cdc86ee5 CP |
2042 | ######################################## |
2043 | ## <summary> | |
296273a7 CP |
2044 | ## Create, read, write, and delete directories |
2045 | ## in a user home subdirectory. | |
cdc86ee5 CP |
2046 | ## </summary> |
2047 | ## <param name="domain"> | |
2048 | ## <summary> | |
2049 | ## Domain allowed access. | |
2050 | ## </summary> | |
2051 | ## </param> | |
2052 | # | |
296273a7 CP |
2053 | interface(`userdom_manage_user_home_content_dirs',` |
2054 | gen_require(` | |
2055 | type user_home_dir_t, user_home_t; | |
2056 | ') | |
2057 | ||
2058 | manage_dirs_pattern($1, { user_home_dir_t user_home_t }, user_home_t) | |
2059 | files_search_home($1) | |
cdc86ee5 CP |
2060 | ') |
2061 | ||
4083191c CP |
2062 | ######################################## |
2063 | ## <summary> | |
2064 | ## Delete directories in a user home subdirectory. | |
2065 | ## </summary> | |
2066 | ## <param name="domain"> | |
2067 | ## <summary> | |
2068 | ## Domain allowed access. | |
2069 | ## </summary> | |
2070 | ## </param> | |
2071 | # | |
2072 | interface(`userdom_delete_user_home_content_dirs',` | |
2073 | gen_require(` | |
2074 | type user_home_t; | |
2075 | ') | |
2076 | ||
2077 | allow $1 user_home_t:dir delete_dir_perms; | |
2078 | ') | |
2079 | ||
a6687c87 DG |
2080 | ######################################## |
2081 | ## <summary> | |
2082 | ## Delete all directories in a user home subdirectory. | |
2083 | ## </summary> | |
2084 | ## <param name="domain"> | |
2085 | ## <summary> | |
2086 | ## Domain allowed access. | |
2087 | ## </summary> | |
2088 | ## </param> | |
2089 | # | |
2090 | interface(`userdom_delete_all_user_home_content_dirs',` | |
2091 | gen_require(` | |
2092 | attribute user_home_type; | |
2093 | ') | |
2094 | ||
2095 | allow $1 user_home_type:dir delete_dir_perms; | |
2096 | ') | |
2097 | ||
3eaa9939 DW |
2098 | ######################################## |
2099 | ## <summary> | |
2100 | ## Set the attributes of user home files. | |
2101 | ## </summary> | |
2102 | ## <param name="domain"> | |
2103 | ## <summary> | |
2104 | ## Domain allowed access. | |
2105 | ## </summary> | |
2106 | ## </param> | |
2107 | ## <rolecap/> | |
2108 | # | |
2109 | interface(`userdom_setattr_user_home_content_files',` | |
2110 | gen_require(` | |
2111 | type user_home_t; | |
2112 | ') | |
2113 | ||
2114 | allow $1 user_home_t:file setattr; | |
2115 | ') | |
2116 | ||
d6d16b97 CP |
2117 | ######################################## |
2118 | ## <summary> | |
296273a7 CP |
2119 | ## Do not audit attempts to set the |
2120 | ## attributes of user home files. | |
d6d16b97 CP |
2121 | ## </summary> |
2122 | ## <param name="domain"> | |
2123 | ## <summary> | |
a0546c9d | 2124 | ## Domain to not audit. |
d6d16b97 CP |
2125 | ## </summary> |
2126 | ## </param> | |
2127 | # | |
296273a7 CP |
2128 | interface(`userdom_dontaudit_setattr_user_home_content_files',` |
2129 | gen_require(` | |
2130 | type user_home_t; | |
2131 | ') | |
d6d16b97 | 2132 | |
bf530f53 | 2133 | dontaudit $1 user_home_t:file setattr_file_perms; |
b0d2243c CP |
2134 | ') |
2135 | ||
a6687c87 DG |
2136 | ######################################## |
2137 | ## <summary> | |
2138 | ## Set the attributes of all user home directories. | |
2139 | ## </summary> | |
2140 | ## <param name="domain"> | |
2141 | ## <summary> | |
2142 | ## Domain allowed access. | |
2143 | ## </summary> | |
2144 | ## </param> | |
2145 | ## <rolecap/> | |
2146 | # | |
2147 | interface(`userdom_setattr_all_user_home_content_dirs',` | |
2148 | gen_require(` | |
2149 | attribute user_home_type; | |
2150 | ') | |
2151 | ||
2152 | allow $1 user_home_type:dir setattr_dir_perms; | |
2153 | ') | |
2154 | ||
fd89e19f CP |
2155 | ######################################## |
2156 | ## <summary> | |
296273a7 | 2157 | ## Mmap user home files. |
fd89e19f CP |
2158 | ## </summary> |
2159 | ## <param name="domain"> | |
885b83ec | 2160 | ## <summary> |
725926c5 | 2161 | ## Domain allowed access. |
885b83ec | 2162 | ## </summary> |
fd89e19f CP |
2163 | ## </param> |
2164 | # | |
296273a7 CP |
2165 | interface(`userdom_mmap_user_home_content_files',` |
2166 | gen_require(` | |
2167 | type user_home_dir_t, user_home_t; | |
2168 | ') | |
fd89e19f | 2169 | |
296273a7 CP |
2170 | mmap_files_pattern($1, { user_home_dir_t user_home_t }, user_home_t) |
2171 | files_search_home($1) | |
1f91e1bf CP |
2172 | ') |
2173 | ||
725926c5 CP |
2174 | ######################################## |
2175 | ## <summary> | |
296273a7 | 2176 | ## Read user home files. |
725926c5 CP |
2177 | ## </summary> |
2178 | ## <param name="domain"> | |
885b83ec | 2179 | ## <summary> |
725926c5 | 2180 | ## Domain allowed access. |
885b83ec | 2181 | ## </summary> |
725926c5 CP |
2182 | ## </param> |
2183 | # | |
296273a7 CP |
2184 | interface(`userdom_read_user_home_content_files',` |
2185 | gen_require(` | |
2186 | type user_home_dir_t, user_home_t; | |
2187 | ') | |
2188 | ||
3eaa9939 | 2189 | list_dirs_pattern($1, { user_home_dir_t user_home_t }, { user_home_dir_t user_home_t }) |
296273a7 CP |
2190 | read_files_pattern($1, { user_home_dir_t user_home_t }, user_home_t) |
2191 | files_search_home($1) | |
725926c5 CP |
2192 | ') |
2193 | ||
daa0e0b0 | 2194 | ######################################## |
ab940a4c | 2195 | ## <summary> |
3eaa9939 | 2196 | ## Do not audit attempts to getattr user home files. |
ab940a4c | 2197 | ## </summary> |
414e4151 | 2198 | ## <param name="domain"> |
885b83ec | 2199 | ## <summary> |
296273a7 | 2200 | ## Domain to not audit. |
885b83ec | 2201 | ## </summary> |
414e4151 | 2202 | ## </param> |
490639cd | 2203 | # |
3eaa9939 | 2204 | interface(`userdom_dontaudit_getattr_user_home_content',` |
296273a7 | 2205 | gen_require(` |
3eaa9939 | 2206 | attribute user_home_type; |
296273a7 CP |
2207 | ') |
2208 | ||
3eaa9939 DW |
2209 | dontaudit $1 user_home_type:dir getattr; |
2210 | dontaudit $1 user_home_type:file getattr; | |
2211 | ') | |
2212 | ||
2213 | ######################################## | |
2214 | ## <summary> | |
2215 | ## Do not audit attempts to read user home files. | |
2216 | ## </summary> | |
2217 | ## <param name="domain"> | |
2218 | ## <summary> | |
2219 | ## Domain to not audit. | |
2220 | ## </summary> | |
2221 | ## </param> | |
2222 | # | |
2223 | interface(`userdom_dontaudit_read_user_home_content_files',` | |
2224 | gen_require(` | |
2225 | attribute user_home_type; | |
2226 | type user_home_dir_t; | |
2227 | ') | |
2228 | ||
2229 | dontaudit $1 user_home_dir_t:dir list_dir_perms; | |
2230 | dontaudit $1 user_home_type:dir list_dir_perms; | |
2231 | dontaudit $1 user_home_type:file read_file_perms; | |
2232 | dontaudit $1 user_home_type:lnk_file read_lnk_file_perms; | |
fd89e19f CP |
2233 | ') |
2234 | ||
50aca6d2 CP |
2235 | ######################################## |
2236 | ## <summary> | |
296273a7 | 2237 | ## Do not audit attempts to append user home files. |
50aca6d2 CP |
2238 | ## </summary> |
2239 | ## <param name="domain"> | |
885b83ec | 2240 | ## <summary> |
50aca6d2 | 2241 | ## Domain to not audit. |
885b83ec | 2242 | ## </summary> |
50aca6d2 CP |
2243 | ## </param> |
2244 | # | |
296273a7 CP |
2245 | interface(`userdom_dontaudit_append_user_home_content_files',` |
2246 | gen_require(` | |
2247 | type user_home_t; | |
2248 | ') | |
2249 | ||
bf530f53 | 2250 | dontaudit $1 user_home_t:file append_file_perms; |
50aca6d2 CP |
2251 | ') |
2252 | ||
fd89e19f CP |
2253 | ######################################## |
2254 | ## <summary> | |
296273a7 | 2255 | ## Do not audit attempts to write user home files. |
fd89e19f CP |
2256 | ## </summary> |
2257 | ## <param name="domain"> | |
885b83ec | 2258 | ## <summary> |
296273a7 | 2259 | ## Domain to not audit. |
885b83ec | 2260 | ## </summary> |
fd89e19f CP |
2261 | ## </param> |
2262 | # | |
296273a7 CP |
2263 | interface(`userdom_dontaudit_write_user_home_content_files',` |
2264 | gen_require(` | |
2265 | type user_home_t; | |
2266 | ') | |
2267 | ||
bf530f53 | 2268 | dontaudit $1 user_home_t:file write_file_perms; |
daa0e0b0 CP |
2269 | ') |
2270 | ||
4083191c CP |
2271 | ######################################## |
2272 | ## <summary> | |
2273 | ## Delete files in a user home subdirectory. | |
2274 | ## </summary> | |
2275 | ## <param name="domain"> | |
2276 | ## <summary> | |
2277 | ## Domain allowed access. | |
2278 | ## </summary> | |
2279 | ## </param> | |
2280 | # | |
2281 | interface(`userdom_delete_user_home_content_files',` | |
2282 | gen_require(` | |
2283 | type user_home_t; | |
2284 | ') | |
2285 | ||
2286 | allow $1 user_home_t:file delete_file_perms; | |
2287 | ') | |
2288 | ||
a6687c87 DG |
2289 | ######################################## |
2290 | ## <summary> | |
2291 | ## Delete all files in a user home subdirectory. | |
2292 | ## </summary> | |
2293 | ## <param name="domain"> | |
2294 | ## <summary> | |
2295 | ## Domain allowed access. | |
2296 | ## </summary> | |
2297 | ## </param> | |
2298 | # | |
2299 | interface(`userdom_delete_all_user_home_content_files',` | |
2300 | gen_require(` | |
2301 | attribute user_home_type; | |
2302 | ') | |
2303 | ||
2304 | allow $1 user_home_type:file delete_file_perms; | |
2305 | ') | |
2306 | ||
d4dca585 | 2307 | ######################################## |
ae841c05 DW |
2308 | ## <summary> |
2309 | ## Delete sock files in a user home subdirectory. | |
2310 | ## </summary> | |
2311 | ## <param name="domain"> | |
2312 | ## <summary> | |
2313 | ## Domain allowed access. | |
2314 | ## </summary> | |
2315 | ## </param> | |
2316 | # | |
2317 | interface(`userdom_delete_user_home_content_sock_files',` | |
2318 | gen_require(` | |
2319 | type user_home_t; | |
2320 | ') | |
2321 | ||
2322 | allow $1 user_home_t:sock_file delete_file_perms; | |
2323 | ') | |
2324 | ||
a6687c87 DG |
2325 | ######################################## |
2326 | ## <summary> | |
2327 | ## Delete all sock files in a user home subdirectory. | |
2328 | ## </summary> | |
2329 | ## <param name="domain"> | |
2330 | ## <summary> | |
2331 | ## Domain allowed access. | |
2332 | ## </summary> | |
2333 | ## </param> | |
2334 | # | |
2335 | interface(`userdom_delete_all_user_home_content_sock_files',` | |
2336 | gen_require(` | |
2337 | attribute user_home_type; | |
2338 | ') | |
2339 | ||
2340 | allow $1 user_home_type:sock_file delete_file_perms; | |
2341 | ') | |
2342 | ||
d4dca585 CP |
2343 | ######################################## |
2344 | ## <summary> | |
296273a7 | 2345 | ## Do not audit attempts to write user home files. |
d4dca585 CP |
2346 | ## </summary> |
2347 | ## <param name="domain"> | |
885b83ec | 2348 | ## <summary> |
d4dca585 | 2349 | ## Domain to not audit. |
885b83ec | 2350 | ## </summary> |
d4dca585 CP |
2351 | ## </param> |
2352 | # | |
296273a7 CP |
2353 | interface(`userdom_dontaudit_relabel_user_home_content_files',` |
2354 | gen_require(` | |
2355 | type user_home_t; | |
2356 | ') | |
2357 | ||
2358 | dontaudit $1 user_home_t:file relabel_file_perms; | |
d4dca585 CP |
2359 | ') |
2360 | ||
0404a390 | 2361 | ######################################## |
ab940a4c | 2362 | ## <summary> |
296273a7 | 2363 | ## Read user home subdirectory symbolic links. |
ab940a4c | 2364 | ## </summary> |
414e4151 | 2365 | ## <param name="domain"> |
885b83ec | 2366 | ## <summary> |
725926c5 | 2367 | ## Domain allowed access. |
885b83ec | 2368 | ## </summary> |
414e4151 | 2369 | ## </param> |
0404a390 | 2370 | # |
296273a7 CP |
2371 | interface(`userdom_read_user_home_content_symlinks',` |
2372 | gen_require(` | |
2373 | type user_home_dir_t, user_home_t; | |
2374 | ') | |
2375 | ||
3eaa9939 | 2376 | allow $1 { user_home_dir_t user_home_t }:lnk_file read_lnk_file_perms; |
daa0e0b0 CP |
2377 | ') |
2378 | ||
763c441e | 2379 | ######################################## |
ab940a4c | 2380 | ## <summary> |
296273a7 | 2381 | ## Execute user home files. |
ab940a4c | 2382 | ## </summary> |
414e4151 | 2383 | ## <param name="domain"> |
885b83ec | 2384 | ## <summary> |
296273a7 | 2385 | ## Domain allowed access. |
885b83ec | 2386 | ## </summary> |
414e4151 | 2387 | ## </param> |
296273a7 | 2388 | ## <rolecap/> |
763c441e | 2389 | # |
296273a7 CP |
2390 | interface(`userdom_exec_user_home_content_files',` |
2391 | gen_require(` | |
3eaa9939 DW |
2392 | type user_home_dir_t; |
2393 | attribute user_home_type; | |
296273a7 CP |
2394 | ') |
2395 | ||
2396 | files_search_home($1) | |
3eaa9939 DW |
2397 | exec_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type) |
2398 | dontaudit $1 user_home_type:sock_file execute; | |
296273a7 | 2399 | ') |
763c441e | 2400 | |
fd89e19f CP |
2401 | ######################################## |
2402 | ## <summary> | |
296273a7 | 2403 | ## Do not audit attempts to execute user home files. |
fd89e19f CP |
2404 | ## </summary> |
2405 | ## <param name="domain"> | |
885b83ec | 2406 | ## <summary> |
a0546c9d | 2407 | ## Domain to not audit. |
885b83ec | 2408 | ## </summary> |
fd89e19f CP |
2409 | ## </param> |
2410 | # | |
296273a7 CP |
2411 | interface(`userdom_dontaudit_exec_user_home_content_files',` |
2412 | gen_require(` | |
2413 | type user_home_t; | |
2414 | ') | |
2415 | ||
bf530f53 | 2416 | dontaudit $1 user_home_t:file exec_file_perms; |
fd89e19f CP |
2417 | ') |
2418 | ||
2419 | ######################################## | |
2420 | ## <summary> | |
296273a7 CP |
2421 | ## Create, read, write, and delete files |
2422 | ## in a user home subdirectory. | |
fd89e19f CP |
2423 | ## </summary> |
2424 | ## <param name="domain"> | |
885b83ec | 2425 | ## <summary> |
725926c5 | 2426 | ## Domain allowed access. |
885b83ec | 2427 | ## </summary> |
fd89e19f CP |
2428 | ## </param> |
2429 | # | |
296273a7 CP |
2430 | interface(`userdom_manage_user_home_content_files',` |
2431 | gen_require(` | |
2432 | type user_home_dir_t, user_home_t; | |
2433 | ') | |
2434 | ||
2435 | manage_files_pattern($1, user_home_t, user_home_t) | |
2436 | allow $1 user_home_dir_t:dir search_dir_perms; | |
2437 | files_search_home($1) | |
fd89e19f CP |
2438 | ') |
2439 | ||
799a0b43 CP |
2440 | ######################################## |
2441 | ## <summary> | |
296273a7 CP |
2442 | ## Do not audit attempts to create, read, write, and delete directories |
2443 | ## in a user home subdirectory. | |
799a0b43 CP |
2444 | ## </summary> |
2445 | ## <param name="domain"> | |
885b83ec | 2446 | ## <summary> |
a0546c9d | 2447 | ## Domain to not audit. |
885b83ec | 2448 | ## </summary> |
799a0b43 CP |
2449 | ## </param> |
2450 | # | |
296273a7 CP |
2451 | interface(`userdom_dontaudit_manage_user_home_content_dirs',` |
2452 | gen_require(` | |
2453 | type user_home_dir_t, user_home_t; | |
2454 | ') | |
2455 | ||
2456 | dontaudit $1 user_home_t:dir manage_dir_perms; | |
799a0b43 CP |
2457 | ') |
2458 | ||
44fc06b0 CP |
2459 | ######################################## |
2460 | ## <summary> | |
296273a7 CP |
2461 | ## Create, read, write, and delete symbolic links |
2462 | ## in a user home subdirectory. | |
44fc06b0 CP |
2463 | ## </summary> |
2464 | ## <param name="domain"> | |
885b83ec | 2465 | ## <summary> |
296273a7 | 2466 | ## Domain allowed access. |
885b83ec | 2467 | ## </summary> |
44fc06b0 CP |
2468 | ## </param> |
2469 | # | |
296273a7 CP |
2470 | interface(`userdom_manage_user_home_content_symlinks',` |
2471 | gen_require(` | |
2472 | type user_home_dir_t, user_home_t; | |
2473 | ') | |
2474 | ||
2475 | manage_lnk_files_pattern($1, user_home_t, user_home_t) | |
2476 | allow $1 user_home_dir_t:dir search_dir_perms; | |
2477 | files_search_home($1) | |
44fc06b0 CP |
2478 | ') |
2479 | ||
4083191c CP |
2480 | ######################################## |
2481 | ## <summary> | |
2482 | ## Delete symbolic links in a user home directory. | |
2483 | ## </summary> | |
2484 | ## <param name="domain"> | |
2485 | ## <summary> | |
2486 | ## Domain allowed access. | |
2487 | ## </summary> | |
2488 | ## </param> | |
2489 | # | |
2490 | interface(`userdom_delete_user_home_content_symlinks',` | |
2491 | gen_require(` | |
2492 | type user_home_t; | |
2493 | ') | |
2494 | ||
2495 | allow $1 user_home_t:lnk_file delete_lnk_file_perms; | |
2496 | ') | |
2497 | ||
a6687c87 DG |
2498 | ######################################## |
2499 | ## <summary> | |
2500 | ## Delete all symbolic links in a user home directory. | |
2501 | ## </summary> | |
2502 | ## <param name="domain"> | |
2503 | ## <summary> | |
2504 | ## Domain allowed access. | |
2505 | ## </summary> | |
2506 | ## </param> | |
2507 | # | |
2508 | interface(`userdom_delete_all_user_home_content_symlinks',` | |
2509 | gen_require(` | |
2510 | attribute user_home_type; | |
2511 | ') | |
2512 | ||
2513 | allow $1 user_home_type:lnk_file delete_lnk_file_perms; | |
2514 | ') | |
2515 | ||
ae9e2716 CP |
2516 | ######################################## |
2517 | ## <summary> | |
296273a7 CP |
2518 | ## Create, read, write, and delete named pipes |
2519 | ## in a user home subdirectory. | |
ae9e2716 CP |
2520 | ## </summary> |
2521 | ## <param name="domain"> | |
885b83ec | 2522 | ## <summary> |
296273a7 | 2523 | ## Domain allowed access. |
885b83ec | 2524 | ## </summary> |
ae9e2716 CP |
2525 | ## </param> |
2526 | # | |
296273a7 CP |
2527 | interface(`userdom_manage_user_home_content_pipes',` |
2528 | gen_require(` | |
2529 | type user_home_dir_t, user_home_t; | |
2530 | ') | |
2531 | ||
2532 | manage_fifo_files_pattern($1, user_home_t, user_home_t) | |
2533 | allow $1 user_home_dir_t:dir search_dir_perms; | |
2534 | files_search_home($1) | |
ae9e2716 CP |
2535 | ') |
2536 | ||
2537 | ######################################## | |
2538 | ## <summary> | |
296273a7 CP |
2539 | ## Create, read, write, and delete named sockets |
2540 | ## in a user home subdirectory. | |
ae9e2716 CP |
2541 | ## </summary> |
2542 | ## <param name="domain"> | |
885b83ec | 2543 | ## <summary> |
296273a7 | 2544 | ## Domain allowed access. |
885b83ec | 2545 | ## </summary> |
ae9e2716 CP |
2546 | ## </param> |
2547 | # | |
296273a7 CP |
2548 | interface(`userdom_manage_user_home_content_sockets',` |
2549 | gen_require(` | |
2550 | type user_home_dir_t, user_home_t; | |
2551 | ') | |
2552 | ||
2553 | allow $1 user_home_dir_t:dir search_dir_perms; | |
2554 | manage_sock_files_pattern($1, user_home_t, user_home_t) | |
2555 | files_search_home($1) | |
ae9e2716 CP |
2556 | ') |
2557 | ||
725926c5 CP |
2558 | ######################################## |
2559 | ## <summary> | |
296273a7 CP |
2560 | ## Create objects in a user home directory |
2561 | ## with an automatic type transition to | |
2562 | ## a specified private type. | |
725926c5 CP |
2563 | ## </summary> |
2564 | ## <param name="domain"> | |
885b83ec | 2565 | ## <summary> |
725926c5 | 2566 | ## Domain allowed access. |
885b83ec | 2567 | ## </summary> |
725926c5 | 2568 | ## </param> |
296273a7 | 2569 | ## <param name="private_type"> |
885b83ec | 2570 | ## <summary> |
296273a7 | 2571 | ## The type of the object to create. |
885b83ec | 2572 | ## </summary> |
b11a75a5 | 2573 | ## </param> |
296273a7 | 2574 | ## <param name="object_class"> |
885b83ec | 2575 | ## <summary> |
296273a7 | 2576 | ## The class of the object to be created. |
885b83ec | 2577 | ## </summary> |
e1c41428 CP |
2578 | ## </param> |
2579 | # | |
296273a7 CP |
2580 | interface(`userdom_user_home_dir_filetrans',` |
2581 | gen_require(` | |
2582 | type user_home_dir_t; | |
2583 | ') | |
2584 | ||
ae4832c7 | 2585 | filetrans_pattern($1, user_home_dir_t, $2, $3, $4) |
296273a7 | 2586 | files_search_home($1) |
e1c41428 CP |
2587 | ') |
2588 | ||
10b1f324 CP |
2589 | ######################################## |
2590 | ## <summary> | |
296273a7 CP |
2591 | ## Create objects in a user home directory |
2592 | ## with an automatic type transition to | |
2593 | ## a specified private type. | |
10b1f324 CP |
2594 | ## </summary> |
2595 | ## <param name="domain"> | |
885b83ec | 2596 | ## <summary> |
10b1f324 | 2597 | ## Domain allowed access. |
885b83ec | 2598 | ## </summary> |
10b1f324 | 2599 | ## </param> |
296273a7 | 2600 | ## <param name="private_type"> |
885b83ec | 2601 | ## <summary> |
296273a7 | 2602 | ## The type of the object to create. |
885b83ec | 2603 | ## </summary> |
ee9500ec CP |
2604 | ## </param> |
2605 | ## <param name="object_class"> | |
885b83ec | 2606 | ## <summary> |
10b1f324 | 2607 | ## The class of the object to be created. |
885b83ec | 2608 | ## </summary> |
10b1f324 CP |
2609 | ## </param> |
2610 | # | |
296273a7 CP |
2611 | interface(`userdom_user_home_content_filetrans',` |
2612 | gen_require(` | |
2613 | type user_home_dir_t, user_home_t; | |
2614 | ') | |
2615 | ||
44fec3e4 | 2616 | filetrans_pattern($1, user_home_t, $2, $3, $4) |
296273a7 CP |
2617 | allow $1 user_home_dir_t:dir search_dir_perms; |
2618 | files_search_home($1) | |
10b1f324 CP |
2619 | ') |
2620 | ||
2621 | ######################################## | |
2622 | ## <summary> | |
296273a7 CP |
2623 | ## Create objects in a user home directory |
2624 | ## with an automatic type transition to | |
2625 | ## the user home file type. | |
10b1f324 CP |
2626 | ## </summary> |
2627 | ## <param name="domain"> | |
885b83ec | 2628 | ## <summary> |
296273a7 CP |
2629 | ## Domain allowed access. |
2630 | ## </summary> | |
2631 | ## </param> | |
2632 | ## <param name="object_class"> | |
2633 | ## <summary> | |
2634 | ## The class of the object to be created. | |
885b83ec | 2635 | ## </summary> |
10b1f324 CP |
2636 | ## </param> |
2637 | # | |
296273a7 CP |
2638 | interface(`userdom_user_home_dir_filetrans_user_home_content',` |
2639 | gen_require(` | |
2640 | type user_home_dir_t, user_home_t; | |
2641 | ') | |
2642 | ||
2643 | filetrans_pattern($1, user_home_dir_t, user_home_t, $2) | |
2644 | files_search_home($1) | |
10b1f324 CP |
2645 | ') |
2646 | ||
fd89e19f CP |
2647 | ######################################## |
2648 | ## <summary> | |
ff8f0a63 | 2649 | ## Write to user temporary named sockets. |
fd89e19f CP |
2650 | ## </summary> |
2651 | ## <param name="domain"> | |
885b83ec | 2652 | ## <summary> |
ff8f0a63 | 2653 | ## Domain allowed access. |
885b83ec | 2654 | ## </summary> |
fd89e19f CP |
2655 | ## </param> |
2656 | # | |
296273a7 CP |
2657 | interface(`userdom_write_user_tmp_sockets',` |
2658 | gen_require(` | |
2659 | type user_tmp_t; | |
2660 | ') | |
2661 | ||
4cb24aed | 2662 | allow $1 user_tmp_t:sock_file write_sock_file_perms; |
296273a7 | 2663 | files_search_tmp($1) |
ed38ca9f | 2664 | ') |
fd89e19f | 2665 | |
ed38ca9f CP |
2666 | ######################################## |
2667 | ## <summary> | |
296273a7 | 2668 | ## List user temporary directories. |
ed38ca9f CP |
2669 | ## </summary> |
2670 | ## <param name="domain"> | |
2671 | ## <summary> | |
2672 | ## Domain allowed access. | |
2673 | ## </summary> | |
2674 | ## </param> | |
2675 | # | |
296273a7 CP |
2676 | interface(`userdom_list_user_tmp',` |
2677 | gen_require(` | |
2678 | type user_tmp_t; | |
2679 | ') | |
2680 | ||
2681 | allow $1 user_tmp_t:dir list_dir_perms; | |
2682 | files_search_tmp($1) | |
fd89e19f CP |
2683 | ') |
2684 | ||
1786478c CP |
2685 | ######################################## |
2686 | ## <summary> | |
296273a7 CP |
2687 | ## Do not audit attempts to list user |
2688 | ## temporary directories. | |
1786478c CP |
2689 | ## </summary> |
2690 | ## <param name="domain"> | |
2691 | ## <summary> | |
296273a7 | 2692 | ## Domain to not audit. |
1786478c CP |
2693 | ## </summary> |
2694 | ## </param> | |
2695 | # | |
296273a7 | 2696 | interface(`userdom_dontaudit_list_user_tmp',` |
1786478c | 2697 | gen_require(` |
296273a7 | 2698 | type user_tmp_t; |
1786478c CP |
2699 | ') |
2700 | ||
296273a7 | 2701 | dontaudit $1 user_tmp_t:dir list_dir_perms; |
1786478c CP |
2702 | ') |
2703 | ||
9778406f CP |
2704 | ######################################## |
2705 | ## <summary> | |
296273a7 CP |
2706 | ## Do not audit attempts to manage users |
2707 | ## temporary directories. | |
9778406f CP |
2708 | ## </summary> |
2709 | ## <param name="domain"> | |
885b83ec | 2710 | ## <summary> |
296273a7 | 2711 | ## Domain to not audit. |
885b83ec | 2712 | ## </summary> |
9778406f CP |
2713 | ## </param> |
2714 | # | |
296273a7 | 2715 | interface(`userdom_dontaudit_manage_user_tmp_dirs',` |
9778406f | 2716 | gen_require(` |
296273a7 | 2717 | type user_tmp_t; |
9778406f CP |
2718 | ') |
2719 | ||
296273a7 | 2720 | dontaudit $1 user_tmp_t:dir manage_dir_perms; |
9778406f CP |
2721 | ') |
2722 | ||
4bf4ed9e | 2723 | ######################################## |
ab940a4c | 2724 | ## <summary> |
296273a7 | 2725 | ## Read user temporary files. |
ab940a4c | 2726 | ## </summary> |
414e4151 | 2727 | ## <param name="domain"> |
885b83ec | 2728 | ## <summary> |
725926c5 | 2729 | ## Domain allowed access. |
885b83ec | 2730 | ## </summary> |
414e4151 | 2731 | ## </param> |
4bf4ed9e | 2732 | # |
296273a7 | 2733 | interface(`userdom_read_user_tmp_files',` |
0404a390 | 2734 | gen_require(` |
296273a7 | 2735 | type user_tmp_t; |
0404a390 | 2736 | ') |
0c73cd25 | 2737 | |
296273a7 CP |
2738 | read_files_pattern($1, user_tmp_t, user_tmp_t) |
2739 | allow $1 user_tmp_t:dir list_dir_perms; | |
2740 | files_search_tmp($1) | |
4bf4ed9e CP |
2741 | ') |
2742 | ||
ae9e2716 CP |
2743 | ######################################## |
2744 | ## <summary> | |
296273a7 CP |
2745 | ## Do not audit attempts to read users |
2746 | ## temporary files. | |
ae9e2716 CP |
2747 | ## </summary> |
2748 | ## <param name="domain"> | |
885b83ec | 2749 | ## <summary> |
ae9e2716 | 2750 | ## Domain to not audit. |
885b83ec | 2751 | ## </summary> |
ae9e2716 CP |
2752 | ## </param> |
2753 | # | |
296273a7 | 2754 | interface(`userdom_dontaudit_read_user_tmp_files',` |
ae9e2716 | 2755 | gen_require(` |
296273a7 | 2756 | type user_tmp_t; |
ae9e2716 CP |
2757 | ') |
2758 | ||
3eaa9939 | 2759 | dontaudit $1 user_tmp_t:file read_inherited_file_perms; |
ae9e2716 CP |
2760 | ') |
2761 | ||
daa0e0b0 | 2762 | ######################################## |
ab940a4c | 2763 | ## <summary> |
296273a7 CP |
2764 | ## Do not audit attempts to append users |
2765 | ## temporary files. | |
ab940a4c | 2766 | ## </summary> |
414e4151 | 2767 | ## <param name="domain"> |
885b83ec | 2768 | ## <summary> |
296273a7 | 2769 | ## Domain to not audit. |
885b83ec | 2770 | ## </summary> |
414e4151 | 2771 | ## </param> |
daa0e0b0 | 2772 | # |
296273a7 | 2773 | interface(`userdom_dontaudit_append_user_tmp_files',` |
0404a390 | 2774 | gen_require(` |
296273a7 | 2775 | type user_tmp_t; |
0404a390 | 2776 | ') |
0c73cd25 | 2777 | |
bf530f53 | 2778 | dontaudit $1 user_tmp_t:file append_file_perms; |
daa0e0b0 CP |
2779 | ') |
2780 | ||
fc6524d7 CP |
2781 | ######################################## |
2782 | ## <summary> | |
296273a7 | 2783 | ## Read and write user temporary files. |
fc6524d7 CP |
2784 | ## </summary> |
2785 | ## <param name="domain"> | |
885b83ec | 2786 | ## <summary> |
725926c5 | 2787 | ## Domain allowed access. |
885b83ec | 2788 | ## </summary> |
fc6524d7 CP |
2789 | ## </param> |
2790 | # | |
296273a7 | 2791 | interface(`userdom_rw_user_tmp_files',` |
fc6524d7 | 2792 | gen_require(` |
296273a7 | 2793 | type user_tmp_t; |
fc6524d7 CP |
2794 | ') |
2795 | ||
296273a7 CP |
2796 | allow $1 user_tmp_t:dir list_dir_perms; |
2797 | rw_files_pattern($1, user_tmp_t, user_tmp_t) | |
2798 | files_search_tmp($1) | |
fc6524d7 CP |
2799 | ') |
2800 | ||
2801 | ######################################## | |
2802 | ## <summary> | |
296273a7 CP |
2803 | ## Do not audit attempts to manage users |
2804 | ## temporary files. | |
fc6524d7 CP |
2805 | ## </summary> |
2806 | ## <param name="domain"> | |
885b83ec | 2807 | ## <summary> |
296273a7 | 2808 | ## Domain to not audit. |
885b83ec | 2809 | ## </summary> |
fc6524d7 CP |
2810 | ## </param> |
2811 | # | |
296273a7 | 2812 | interface(`userdom_dontaudit_manage_user_tmp_files',` |
fc6524d7 | 2813 | gen_require(` |
296273a7 | 2814 | type user_tmp_t; |
fc6524d7 CP |
2815 | ') |
2816 | ||
296273a7 | 2817 | dontaudit $1 user_tmp_t:file manage_file_perms; |
fc6524d7 CP |
2818 | ') |
2819 | ||
2820 | ######################################## | |
2821 | ## <summary> | |
296273a7 | 2822 | ## Read user temporary symbolic links. |
fc6524d7 CP |
2823 | ## </summary> |
2824 | ## <param name="domain"> | |
885b83ec | 2825 | ## <summary> |
725926c5 | 2826 | ## Domain allowed access. |
885b83ec | 2827 | ## </summary> |
fc6524d7 CP |
2828 | ## </param> |
2829 | # | |
296273a7 | 2830 | interface(`userdom_read_user_tmp_symlinks',` |
fc6524d7 | 2831 | gen_require(` |
296273a7 | 2832 | type user_tmp_t; |
fc6524d7 CP |
2833 | ') |
2834 | ||
296273a7 CP |
2835 | read_lnk_files_pattern($1, user_tmp_t, user_tmp_t) |
2836 | allow $1 user_tmp_t:dir list_dir_perms; | |
2837 | files_search_tmp($1) | |
fc6524d7 CP |
2838 | ') |
2839 | ||
784a3bbc CP |
2840 | ######################################## |
2841 | ## <summary> | |
296273a7 CP |
2842 | ## Create, read, write, and delete user |
2843 | ## temporary directories. | |
784a3bbc | 2844 | ## </summary> |
784a3bbc | 2845 | ## <param name="domain"> |
885b83ec | 2846 | ## <summary> |
725926c5 | 2847 | ## Domain allowed access. |
885b83ec | 2848 | ## </summary> |
784a3bbc CP |
2849 | ## </param> |
2850 | # | |
296273a7 | 2851 | interface(`userdom_manage_user_tmp_dirs',` |
784a3bbc | 2852 | gen_require(` |
296273a7 | 2853 | type user_tmp_t; |
784a3bbc CP |
2854 | ') |
2855 | ||
296273a7 CP |
2856 | manage_dirs_pattern($1, user_tmp_t, user_tmp_t) |
2857 | files_search_tmp($1) | |
784a3bbc CP |
2858 | ') |
2859 | ||
daa0e0b0 | 2860 | ######################################## |
ab940a4c | 2861 | ## <summary> |
296273a7 CP |
2862 | ## Create, read, write, and delete user |
2863 | ## temporary files. | |
ab940a4c CP |
2864 | ## </summary> |
2865 | ## <param name="domain"> | |
885b83ec | 2866 | ## <summary> |
725926c5 | 2867 | ## Domain allowed access. |
885b83ec | 2868 | ## </summary> |
ab940a4c CP |
2869 | ## </param> |
2870 | # | |
296273a7 | 2871 | interface(`userdom_manage_user_tmp_files',` |
ab940a4c | 2872 | gen_require(` |
296273a7 | 2873 | type user_tmp_t; |
ab940a4c CP |
2874 | ') |
2875 | ||
296273a7 CP |
2876 | manage_files_pattern($1, user_tmp_t, user_tmp_t) |
2877 | files_search_tmp($1) | |
ab940a4c CP |
2878 | ') |
2879 | ||
2880 | ######################################## | |
2881 | ## <summary> | |
296273a7 CP |
2882 | ## Create, read, write, and delete user |
2883 | ## temporary symbolic links. | |
ab940a4c | 2884 | ## </summary> |
414e4151 | 2885 | ## <param name="domain"> |
885b83ec | 2886 | ## <summary> |
725926c5 | 2887 | ## Domain allowed access. |
885b83ec | 2888 | ## </summary> |
414e4151 | 2889 | ## </param> |
490639cd | 2890 | # |
296273a7 | 2891 | interface(`userdom_manage_user_tmp_symlinks',` |
0404a390 | 2892 | gen_require(` |
296273a7 | 2893 | type user_tmp_t; |
0404a390 | 2894 | ') |
0c73cd25 | 2895 | |
296273a7 CP |
2896 | manage_lnk_files_pattern($1, user_tmp_t, user_tmp_t) |
2897 | files_search_tmp($1) | |
490639cd CP |
2898 | ') |
2899 | ||
4bf4ed9e | 2900 | ######################################## |
ab940a4c | 2901 | ## <summary> |
296273a7 CP |
2902 | ## Create, read, write, and delete user |
2903 | ## temporary named pipes. | |
ab940a4c | 2904 | ## </summary> |
414e4151 | 2905 | ## <param name="domain"> |
885b83ec | 2906 | ## <summary> |
725926c5 | 2907 | ## Domain allowed access. |
885b83ec | 2908 | ## </summary> |
414e4151 | 2909 | ## </param> |
4bf4ed9e | 2910 | # |
296273a7 | 2911 | interface(`userdom_manage_user_tmp_pipes',` |
0404a390 | 2912 | gen_require(` |
296273a7 | 2913 | type user_tmp_t; |
0404a390 | 2914 | ') |
0c73cd25 | 2915 | |
296273a7 CP |
2916 | manage_fifo_files_pattern($1, user_tmp_t, user_tmp_t) |
2917 | files_search_tmp($1) | |
4bf4ed9e CP |
2918 | ') |
2919 | ||
0404a390 | 2920 | ######################################## |
ab940a4c | 2921 | ## <summary> |
296273a7 CP |
2922 | ## Create, read, write, and delete user |
2923 | ## temporary named sockets. | |
ab940a4c | 2924 | ## </summary> |
414e4151 | 2925 | ## <param name="domain"> |
885b83ec | 2926 | ## <summary> |
57a96cbd | 2927 | ## Domain allowed access. |
885b83ec | 2928 | ## </summary> |
414e4151 | 2929 | ## </param> |
0404a390 | 2930 | # |
296273a7 CP |
2931 | interface(`userdom_manage_user_tmp_sockets',` |
2932 | gen_require(` | |
2933 | type user_tmp_t; | |
2934 | ') | |
2935 | ||
2936 | manage_sock_files_pattern($1, user_tmp_t, user_tmp_t) | |
2937 | files_search_tmp($1) | |
4bf4ed9e CP |
2938 | ') |
2939 | ||
4614e83f CP |
2940 | ######################################## |
2941 | ## <summary> | |
296273a7 CP |
2942 | ## Create objects in a user temporary directory |
2943 | ## with an automatic type transition to | |
2944 | ## a specified private type. | |
4614e83f CP |
2945 | ## </summary> |
2946 | ## <param name="domain"> | |
885b83ec | 2947 | ## <summary> |
4614e83f | 2948 | ## Domain allowed access. |
885b83ec | 2949 | ## </summary> |
4614e83f | 2950 | ## </param> |
296273a7 CP |
2951 | ## <param name="private_type"> |
2952 | ## <summary> | |
2953 | ## The type of the object to create. | |
2954 | ## </summary> | |
2955 | ## </param> | |
2956 | ## <param name="object_class"> | |
2957 | ## <summary> | |
2958 | ## The class of the object to be created. | |
2959 | ## </summary> | |
2960 | ## </param> | |
4614e83f | 2961 | # |
296273a7 CP |
2962 | interface(`userdom_user_tmp_filetrans',` |
2963 | gen_require(` | |
2964 | type user_tmp_t; | |
2965 | ') | |
2966 | ||
06264551 | 2967 | filetrans_pattern($1, user_tmp_t, $2, $3, $4) |
296273a7 | 2968 | files_search_tmp($1) |
4614e83f CP |
2969 | ') |
2970 | ||
daa0e0b0 | 2971 | ######################################## |
ab940a4c | 2972 | ## <summary> |
296273a7 CP |
2973 | ## Create objects in the temporary directory |
2974 | ## with an automatic type transition to | |
2975 | ## the user temporary type. | |
57a96cbd CP |
2976 | ## </summary> |
2977 | ## <param name="domain"> | |
885b83ec | 2978 | ## <summary> |
57a96cbd | 2979 | ## Domain allowed access. |
885b83ec | 2980 | ## </summary> |
57a96cbd | 2981 | ## </param> |
1c1ac67f | 2982 | ## <param name="object_class"> |
885b83ec | 2983 | ## <summary> |
57a96cbd | 2984 | ## The class of the object to be created. |
885b83ec | 2985 | ## </summary> |
57a96cbd CP |
2986 | ## </param> |
2987 | # | |
296273a7 CP |
2988 | interface(`userdom_tmp_filetrans_user_tmp',` |
2989 | gen_require(` | |
2990 | type user_tmp_t; | |
2991 | ') | |
2992 | ||
2993 | files_tmp_filetrans($1, user_tmp_t, $2) | |
57a96cbd CP |
2994 | ') |
2995 | ||
797c5797 MG |
2996 | ####################################### |
2997 | ## <summary> | |
2998 | ## Getattr user tmpfs files. | |
2999 | ## </summary> | |
3000 | ## <param name="domain"> | |
3001 | ## <summary> | |
3002 | ## Domain allowed access. | |
3003 | ## </summary> | |
3004 | ## </param> | |
3005 | # | |
3006 | interface(`userdom_getattr_user_tmpfs_files',` | |
3007 | gen_require(` | |
3008 | type user_tmpfs_t; | |
3009 | ') | |
3010 | ||
3011 | getattr_files_pattern($1, user_tmpfs_t, user_tmpfs_t) | |
3012 | fs_search_tmpfs($1) | |
3013 | ') | |
3014 | ||
a9e9678f CP |
3015 | ######################################## |
3016 | ## <summary> | |
3017 | ## Read user tmpfs files. | |
3018 | ## </summary> | |
3019 | ## <param name="domain"> | |
3020 | ## <summary> | |
3021 | ## Domain allowed access. | |
3022 | ## </summary> | |
3023 | ## </param> | |
3024 | # | |
3025 | interface(`userdom_read_user_tmpfs_files',` | |
3026 | gen_require(` | |
3027 | type user_tmpfs_t; | |
3028 | ') | |
3029 | ||
3030 | read_files_pattern($1, user_tmpfs_t, user_tmpfs_t) | |
3eaa9939 | 3031 | read_lnk_files_pattern($1, user_tmpfs_t, user_tmpfs_t) |
a9e9678f CP |
3032 | allow $1 user_tmpfs_t:dir list_dir_perms; |
3033 | fs_search_tmpfs($1) | |
3034 | ') | |
3035 | ||
d4dca585 CP |
3036 | ######################################## |
3037 | ## <summary> | |
3eaa9939 | 3038 | ## Read/Write user tmpfs files. |
d4dca585 CP |
3039 | ## </summary> |
3040 | ## <param name="domain"> | |
885b83ec | 3041 | ## <summary> |
d4dca585 | 3042 | ## Domain allowed access. |
885b83ec | 3043 | ## </summary> |
d4dca585 CP |
3044 | ## </param> |
3045 | # | |
296273a7 CP |
3046 | interface(`userdom_rw_user_tmpfs_files',` |
3047 | gen_require(` | |
3048 | type user_tmpfs_t; | |
3049 | ') | |
3050 | ||
3051 | rw_files_pattern($1, user_tmpfs_t, user_tmpfs_t) | |
3052 | read_lnk_files_pattern($1, user_tmpfs_t, user_tmpfs_t) | |
3053 | allow $1 user_tmpfs_t:dir list_dir_perms; | |
3054 | fs_search_tmpfs($1) | |
d4dca585 CP |
3055 | ') |
3056 | ||
c14aaaac DW |
3057 | ######################################## |
3058 | ## <summary> | |
3059 | ## Read/Write inherited user tmpfs files. | |
3060 | ## </summary> | |
3061 | ## <param name="domain"> | |
3062 | ## <summary> | |
3063 | ## Domain allowed access. | |
3064 | ## </summary> | |
3065 | ## </param> | |
3066 | # | |
3067 | interface(`userdom_rw_inherited_user_tmpfs_files',` | |
3068 | gen_require(` | |
3069 | type user_tmpfs_t; | |
3070 | ') | |
3071 | ||
3072 | allow $1 user_tmpfs_t:file rw_inherited_file_perms; | |
3073 | ') | |
3074 | ||
3075 | ######################################## | |
3076 | ## <summary> | |
3077 | ## Execute user tmpfs files. | |
3078 | ## </summary> | |
3079 | ## <param name="domain"> | |
3080 | ## <summary> | |
3081 | ## Domain allowed access. | |
3082 | ## </summary> | |
3083 | ## </param> | |
3084 | # | |
3085 | interface(`userdom_execute_user_tmpfs_files',` | |
3086 | gen_require(` | |
3087 | type user_tmpfs_t; | |
3088 | ') | |
3089 | ||
3090 | allow $1 user_tmpfs_t:file execute; | |
3091 | ') | |
3092 | ||
d9845ae9 CP |
3093 | ######################################## |
3094 | ## <summary> | |
296273a7 | 3095 | ## Get the attributes of a user domain tty. |
d9845ae9 CP |
3096 | ## </summary> |
3097 | ## <param name="domain"> | |
3098 | ## <summary> | |
3099 | ## Domain allowed access. | |
3100 | ## </summary> | |
3101 | ## </param> | |
3102 | # | |
296273a7 CP |
3103 | interface(`userdom_getattr_user_ttys',` |
3104 | gen_require(` | |
3105 | type user_tty_device_t; | |
3106 | ') | |
3107 | ||
bf530f53 | 3108 | allow $1 user_tty_device_t:chr_file getattr_chr_file_perms; |
d9845ae9 CP |
3109 | ') |
3110 | ||
57a96cbd CP |
3111 | ######################################## |
3112 | ## <summary> | |
296273a7 | 3113 | ## Do not audit attempts to get the attributes of a user domain tty. |
57a96cbd CP |
3114 | ## </summary> |
3115 | ## <param name="domain"> | |
885b83ec | 3116 | ## <summary> |
a0546c9d | 3117 | ## Domain to not audit. |
885b83ec | 3118 | ## </summary> |
57a96cbd CP |
3119 | ## </param> |
3120 | # | |
296273a7 CP |
3121 | interface(`userdom_dontaudit_getattr_user_ttys',` |
3122 | gen_require(` | |
3123 | type user_tty_device_t; | |
3124 | ') | |
3125 | ||
bf530f53 | 3126 | dontaudit $1 user_tty_device_t:chr_file getattr_chr_file_perms; |
57a96cbd CP |
3127 | ') |
3128 | ||
d6d16b97 CP |
3129 | ######################################## |
3130 | ## <summary> | |
296273a7 | 3131 | ## Set the attributes of a user domain tty. |
d6d16b97 CP |
3132 | ## </summary> |
3133 | ## <param name="domain"> | |
3134 | ## <summary> | |
3135 | ## Domain allowed access. | |
3136 | ## </summary> | |
3137 | ## </param> | |
3138 | # | |
296273a7 CP |
3139 | interface(`userdom_setattr_user_ttys',` |
3140 | gen_require(` | |
3141 | type user_tty_device_t; | |
3142 | ') | |
3143 | ||
bf530f53 | 3144 | allow $1 user_tty_device_t:chr_file setattr_chr_file_perms; |
d6d16b97 CP |
3145 | ') |
3146 | ||
165b42d2 CP |
3147 | ######################################## |
3148 | ## <summary> | |
296273a7 | 3149 | ## Do not audit attempts to set the attributes of a user domain tty. |
165b42d2 CP |
3150 | ## </summary> |
3151 | ## <param name="domain"> | |
3152 | ## <summary> | |
a0546c9d | 3153 | ## Domain to not audit. |
165b42d2 CP |
3154 | ## </summary> |
3155 | ## </param> | |
3156 | # | |
296273a7 CP |
3157 | interface(`userdom_dontaudit_setattr_user_ttys',` |
3158 | gen_require(` | |
3159 | type user_tty_device_t; | |
3160 | ') | |
3161 | ||
bf530f53 | 3162 | dontaudit $1 user_tty_device_t:chr_file setattr_chr_file_perms; |
165b42d2 CP |
3163 | ') |
3164 | ||
d6d16b97 CP |
3165 | ######################################## |
3166 | ## <summary> | |
296273a7 | 3167 | ## Read and write a user domain tty. |
d6d16b97 CP |
3168 | ## </summary> |
3169 | ## <param name="domain"> | |
3170 | ## <summary> | |
3171 | ## Domain allowed access. | |
3172 | ## </summary> | |
3173 | ## </param> | |
3174 | # | |
296273a7 CP |
3175 | interface(`userdom_use_user_ttys',` |
3176 | gen_require(` | |
3177 | type user_tty_device_t; | |
3178 | ') | |
3179 | ||
3180 | allow $1 user_tty_device_t:chr_file rw_term_perms; | |
d6d16b97 CP |
3181 | ') |
3182 | ||
af2d8802 MG |
3183 | ######################################## |
3184 | ## <summary> | |
3185 | ## Read and write a inherited user domain tty. | |
3186 | ## </summary> | |
3187 | ## <param name="domain"> | |
3188 | ## <summary> | |
3189 | ## Domain allowed access. | |
3190 | ## </summary> | |
3191 | ## </param> | |
3192 | # | |
3193 | interface(`userdom_use_inherited_user_ttys',` | |
3194 | gen_require(` | |
3195 | type user_tty_device_t; | |
3196 | ') | |
3197 | ||
3198 | allow $1 user_tty_device_t:chr_file rw_inherited_term_perms; | |
3199 | ') | |
3200 | ||
57a96cbd CP |
3201 | ######################################## |
3202 | ## <summary> | |
296273a7 | 3203 | ## Read and write a user domain pty. |
57a96cbd CP |
3204 | ## </summary> |
3205 | ## <param name="domain"> | |
885b83ec | 3206 | ## <summary> |
57a96cbd | 3207 | ## Domain allowed access. |
885b83ec | 3208 | ## </summary> |
57a96cbd CP |
3209 | ## </param> |
3210 | # | |
296273a7 CP |
3211 | interface(`userdom_use_user_ptys',` |
3212 | gen_require(` | |
3213 | type user_devpts_t; | |
3214 | ') | |
3215 | ||
3216 | allow $1 user_devpts_t:chr_file rw_term_perms; | |
57a96cbd CP |
3217 | ') |
3218 | ||
d6d16b97 CP |
3219 | ######################################## |
3220 | ## <summary> | |
af2d8802 MG |
3221 | ## Read and write a inherited user domain pty. |
3222 | ## </summary> | |
3223 | ## <param name="domain"> | |
3224 | ## <summary> | |
3225 | ## Domain allowed access. | |
3226 | ## </summary> | |
3227 | ## </param> | |
3228 | # | |
3229 | interface(`userdom_use_inherited_user_ptys',` | |
3230 | gen_require(` | |
3231 | type user_devpts_t; | |
3232 | ') | |
3233 | ||
3234 | allow $1 user_devpts_t:chr_file rw_inherited_term_perms; | |
3235 | ') | |
3236 | ||
57a96cbd | 3237 | ######################################## |
af2d8802 MG |
3238 | ## <summary> |
3239 | ## Read and write a inherited user TTYs and PTYs. | |
d6d16b97 | 3240 | ## </summary> |
c46376e6 CP |
3241 | ## <desc> |
3242 | ## <p> | |
af2d8802 | 3243 | ## Allow the specified domain to read and write inherited user |
c46376e6 CP |
3244 | ## TTYs and PTYs. This will allow the domain to |
3245 | ## interact with the user via the terminal. Typically | |
3246 | ## all interactive applications will require this | |
3247 | ## access. | |
3248 | ## </p> | |
c46376e6 | 3249 | ## </desc> |
d6d16b97 CP |
3250 | ## <param name="domain"> |
3251 | ## <summary> | |
3252 | ## Domain allowed access. | |
3253 | ## </summary> | |
3254 | ## </param> | |
c46376e6 | 3255 | ## <infoflow type="both" weight="10"/> |
d6d16b97 | 3256 | # |
af2d8802 | 3257 | interface(`userdom_use_inherited_user_terminals',` |
296273a7 CP |
3258 | gen_require(` |
3259 | type user_tty_device_t, user_devpts_t; | |
3260 | ') | |
3261 | ||
af2d8802 MG |
3262 | allow $1 user_tty_device_t:chr_file rw_inherited_term_perms; |
3263 | allow $1 user_devpts_t:chr_file rw_inherited_term_perms; | |
3264 | ') | |
3265 | ||
35afb663 MG |
3266 | ####################################### |
3267 | ## <summary> | |
3268 | ## Allow attempts to read and write | |
3269 | ## a user domain tty and pty. | |
3270 | ## </summary> | |
3271 | ## <param name="domain"> | |
3272 | ## <summary> | |
3273 | ## Domain to not audit. | |
3274 | ## </summary> | |
3275 | ## </param> | |
3276 | # | |
3277 | interface(`userdom_use_user_terminals',` | |
3278 | gen_require(` | |
3279 | type user_tty_device_t, user_devpts_t; | |
3280 | ') | |
3281 | ||
3282 | allow $1 user_tty_device_t:chr_file rw_term_perms; | |
3283 | allow $1 user_devpts_t:chr_file rw_term_perms; | |
d6d16b97 CP |
3284 | ') |
3285 | ||
57a96cbd CP |
3286 | ######################################## |
3287 | ## <summary> | |
296273a7 CP |
3288 | ## Do not audit attempts to read and write |
3289 | ## a user domain tty and pty. | |
57a96cbd CP |
3290 | ## </summary> |
3291 | ## <param name="domain"> | |
885b83ec | 3292 | ## <summary> |
a0546c9d | 3293 | ## Domain to not audit. |
885b83ec | 3294 | ## </summary> |
57a96cbd CP |
3295 | ## </param> |
3296 | # | |
296273a7 CP |
3297 | interface(`userdom_dontaudit_use_user_terminals',` |
3298 | gen_require(` | |
3299 | type user_tty_device_t, user_devpts_t; | |
3300 | ') | |
3301 | ||
6d51b2fc DW |
3302 | dontaudit $1 user_tty_device_t:chr_file rw_inherited_term_perms; |
3303 | dontaudit $1 user_devpts_t:chr_file rw_inherited_term_perms; | |
57a96cbd CP |
3304 | ') |
3305 | ||
8fc060c2 DG |
3306 | |
3307 | ######################################## | |
3308 | ## <summary> | |
3309 | ## Get attributes of user domain tty and pty. | |
3310 | ## </summary> | |
3311 | ## <param name="domain"> | |
3312 | ## <summary> | |
3313 | ## Domain allowed access. | |
3314 | ## </summary> | |
3315 | ## </param> | |
3316 | # | |
3317 | interface(`userdom_getattr_user_terminals',` | |
3318 | gen_require(` | |
3319 | type user_tty_device_t, user_devpts_t; | |
3320 | ') | |
3321 | ||
3322 | allow $1 { user_tty_device_t user_devpts_t }:chr_file getattr_chr_file_perms; | |
3323 | ') | |
3324 | ||
57a96cbd CP |
3325 | ######################################## |
3326 | ## <summary> | |
296273a7 CP |
3327 | ## Execute a shell in all user domains. This |
3328 | ## is an explicit transition, requiring the | |
3329 | ## caller to use setexeccon(). | |
57a96cbd CP |
3330 | ## </summary> |
3331 | ## <param name="domain"> | |
885b83ec | 3332 | ## <summary> |
a0546c9d | 3333 | ## Domain allowed to transition. |
885b83ec | 3334 | ## </summary> |
57a96cbd CP |
3335 | ## </param> |
3336 | # | |
296273a7 CP |
3337 | interface(`userdom_spec_domtrans_all_users',` |
3338 | gen_require(` | |
3339 | attribute userdomain; | |
3340 | ') | |
3341 | ||
3f67f722 | 3342 | corecmd_shell_spec_domtrans($1, userdomain) |
296273a7 CP |
3343 | allow userdomain $1:fd use; |
3344 | allow userdomain $1:fifo_file rw_file_perms; | |
3345 | allow userdomain $1:process sigchld; | |
57a96cbd CP |
3346 | ') |
3347 | ||
3348 | ######################################## | |
3349 | ## <summary> | |
296273a7 CP |
3350 | ## Execute an Xserver session in all unprivileged user domains. This |
3351 | ## is an explicit transition, requiring the | |
3352 | ## caller to use setexeccon(). | |
57a96cbd CP |
3353 | ## </summary> |
3354 | ## <param name="domain"> | |
885b83ec | 3355 | ## <summary> |
a0546c9d | 3356 | ## Domain allowed to transition. |
885b83ec | 3357 | ## </summary> |
57a96cbd CP |
3358 | ## </param> |
3359 | # | |
296273a7 CP |
3360 | interface(`userdom_xsession_spec_domtrans_all_users',` |
3361 | gen_require(` | |
3362 | attribute userdomain; | |
3363 | ') | |
3364 | ||
3f67f722 | 3365 | xserver_xsession_spec_domtrans($1, userdomain) |
296273a7 CP |
3366 | allow userdomain $1:fd use; |
3367 | allow userdomain $1:fifo_file rw_file_perms; | |
3368 | allow userdomain $1:process sigchld; | |
57a96cbd CP |
3369 | ') |
3370 | ||
e08118a5 CP |
3371 | ######################################## |
3372 | ## <summary> | |
296273a7 CP |
3373 | ## Execute a shell in all unprivileged user domains. This |
3374 | ## is an explicit transition, requiring the | |
3375 | ## caller to use setexeccon(). | |
e08118a5 CP |
3376 | ## </summary> |
3377 | ## <param name="domain"> | |
885b83ec | 3378 | ## <summary> |
a0546c9d | 3379 | ## Domain allowed to transition. |
885b83ec | 3380 | ## </summary> |
e08118a5 CP |
3381 | ## </param> |
3382 | # | |
296273a7 | 3383 | interface(`userdom_spec_domtrans_unpriv_users',` |
e08118a5 | 3384 | gen_require(` |
296273a7 | 3385 | attribute unpriv_userdomain; |
e08118a5 CP |
3386 | ') |
3387 | ||
3f67f722 | 3388 | corecmd_shell_spec_domtrans($1, unpriv_userdomain) |
296273a7 CP |
3389 | allow unpriv_userdomain $1:fd use; |
3390 | allow unpriv_userdomain $1:fifo_file rw_file_perms; | |
3391 | allow unpriv_userdomain $1:process sigchld; | |
e08118a5 CP |
3392 | ') |
3393 | ||
ba04e2e9 MG |
3394 | ##################################### |
3395 | ## <summary> | |
3396 | ## Allow domain dyntrans to unpriv userdomain. | |
3397 | ## </summary> | |
3398 | ## <param name="domain"> | |
3399 | ## <summary> | |
3400 | ## Domain allowed access. | |
3401 | ## </summary> | |
3402 | ## </param> | |
3403 | # | |
3404 | interface(`userdom_dyntransition_unpriv_users',` | |
3405 | gen_require(` | |
3406 | attribute unpriv_userdomain; | |
3407 | ') | |
3408 | ||
3409 | allow $1 unpriv_userdomain:process dyntransition; | |
3410 | ') | |
3411 | ||
d4dca585 CP |
3412 | ######################################## |
3413 | ## <summary> | |
296273a7 CP |
3414 | ## Execute an Xserver session in all unprivileged user domains. This |
3415 | ## is an explicit transition, requiring the | |
3416 | ## caller to use setexeccon(). | |
d4dca585 CP |
3417 | ## </summary> |
3418 | ## <param name="domain"> | |
885b83ec | 3419 | ## <summary> |
a0546c9d | 3420 | ## Domain allowed to transition. |
885b83ec | 3421 | ## </summary> |
d4dca585 CP |
3422 | ## </param> |
3423 | # | |
296273a7 | 3424 | interface(`userdom_xsession_spec_domtrans_unpriv_users',` |
d4dca585 | 3425 | gen_require(` |
296273a7 | 3426 | attribute unpriv_userdomain; |
d4dca585 CP |
3427 | ') |
3428 | ||
3f67f722 | 3429 | xserver_xsession_spec_domtrans($1, unpriv_userdomain) |
296273a7 CP |
3430 | allow unpriv_userdomain $1:fd use; |
3431 | allow unpriv_userdomain $1:fifo_file rw_file_perms; | |
3432 | allow unpriv_userdomain $1:process sigchld; | |
d4dca585 CP |
3433 | ') |
3434 | ||
6f8cda96 CP |
3435 | ######################################## |
3436 | ## <summary> | |
296273a7 | 3437 | ## Manage unpriviledged user SysV sempaphores. |
6f8cda96 CP |
3438 | ## </summary> |
3439 | ## <param name="domain"> | |
3440 | ## <summary> | |
3441 | ## Domain allowed access. | |
3442 | ## </summary> | |
3443 | ## </param> | |
3444 | # | |
296273a7 | 3445 | interface(`userdom_manage_unpriv_user_semaphores',` |
6f8cda96 | 3446 | gen_require(` |
296273a7 | 3447 | attribute unpriv_userdomain; |
6f8cda96 CP |
3448 | ') |
3449 | ||
296273a7 | 3450 | allow $1 unpriv_userdomain:sem create_sem_perms; |
6f8cda96 CP |
3451 | ') |
3452 | ||
3453 | ######################################## | |
3454 | ## <summary> | |
296273a7 CP |
3455 | ## Manage unpriviledged user SysV shared |
3456 | ## memory segments. | |
6f8cda96 CP |
3457 | ## </summary> |
3458 | ## <param name="domain"> | |
3459 | ## <summary> | |
3460 | ## Domain allowed access. | |
3461 | ## </summary> | |
3462 | ## </param> | |
3463 | # | |
296273a7 | 3464 | interface(`userdom_manage_unpriv_user_shared_mem',` |
6f8cda96 | 3465 | gen_require(` |
296273a7 | 3466 | attribute unpriv_userdomain; |
6f8cda96 CP |
3467 | ') |
3468 | ||
296273a7 | 3469 | allow $1 unpriv_userdomain:shm create_shm_perms; |
6f8cda96 CP |
3470 | ') |
3471 | ||
43989f82 CP |
3472 | ######################################## |
3473 | ## <summary> | |
296273a7 CP |
3474 | ## Execute bin_t in the unprivileged user domains. This |
3475 | ## is an explicit transition, requiring the | |
3476 | ## caller to use setexeccon(). | |
43989f82 CP |
3477 | ## </summary> |
3478 | ## <param name="domain"> | |
885b83ec | 3479 | ## <summary> |
a0546c9d | 3480 | ## Domain allowed to transition. |
885b83ec | 3481 | ## </summary> |
43989f82 CP |
3482 | ## </param> |
3483 | # | |
296273a7 | 3484 | interface(`userdom_bin_spec_domtrans_unpriv_users',` |
43989f82 | 3485 | gen_require(` |
296273a7 | 3486 | attribute unpriv_userdomain; |
43989f82 CP |
3487 | ') |
3488 | ||
3f67f722 | 3489 | corecmd_bin_spec_domtrans($1, unpriv_userdomain) |
296273a7 CP |
3490 | allow unpriv_userdomain $1:fd use; |
3491 | allow unpriv_userdomain $1:fifo_file rw_file_perms; | |
3492 | allow unpriv_userdomain $1:process sigchld; | |
725926c5 CP |
3493 | ') |
3494 | ||
6820a398 CP |
3495 | ######################################## |
3496 | ## <summary> | |
296273a7 CP |
3497 | ## Execute all entrypoint files in unprivileged user |
3498 | ## domains. This is an explicit transition, requiring the | |
3499 | ## caller to use setexeccon(). | |
6820a398 CP |
3500 | ## </summary> |
3501 | ## <param name="domain"> | |
885b83ec | 3502 | ## <summary> |
6820a398 | 3503 | ## Domain allowed access. |
885b83ec | 3504 | ## </summary> |
6820a398 CP |
3505 | ## </param> |
3506 | # | |
296273a7 | 3507 | interface(`userdom_entry_spec_domtrans_unpriv_users',` |
350b6ab7 | 3508 | gen_require(` |
296273a7 | 3509 | attribute unpriv_userdomain; |
6820a398 | 3510 | ') |
350b6ab7 | 3511 | |
3f67f722 | 3512 | domain_entry_file_spec_domtrans($1, unpriv_userdomain) |
296273a7 | 3513 | allow unpriv_userdomain $1:fd use; |
3eaa9939 | 3514 | allow unpriv_userdomain $1:fifo_file rw_fifo_file_perms; |
296273a7 | 3515 | allow unpriv_userdomain $1:process sigchld; |
6820a398 CP |
3516 | ') |
3517 | ||
1504ff3e CP |
3518 | ######################################## |
3519 | ## <summary> | |
296273a7 | 3520 | ## Search users home directories. |
1504ff3e CP |
3521 | ## </summary> |
3522 | ## <param name="domain"> | |
885b83ec | 3523 | ## <summary> |
296273a7 | 3524 | ## Domain allowed access. |
885b83ec | 3525 | ## </summary> |
1504ff3e CP |
3526 | ## </param> |
3527 | # | |
296273a7 | 3528 | interface(`userdom_search_user_home_content',` |
350b6ab7 | 3529 | gen_require(` |
3eaa9939 DW |
3530 | type user_home_dir_t; |
3531 | attribute user_home_type; | |
1504ff3e | 3532 | ') |
350b6ab7 | 3533 | |
296273a7 | 3534 | files_list_home($1) |
3eaa9939 DW |
3535 | allow $1 { user_home_dir_t user_home_type }:dir search_dir_perms; |
3536 | allow $1 { user_home_dir_t user_home_type }:lnk_file read_lnk_file_perms; | |
1504ff3e CP |
3537 | ') |
3538 | ||
f6abfdb8 CP |
3539 | ######################################## |
3540 | ## <summary> | |
296273a7 | 3541 | ## Send general signals to unprivileged user domains. |
f6abfdb8 CP |
3542 | ## </summary> |
3543 | ## <param name="domain"> | |
885b83ec | 3544 | ## <summary> |
f6abfdb8 | 3545 | ## Domain allowed access. |
885b83ec | 3546 | ## </summary> |
f6abfdb8 CP |
3547 | ## </param> |
3548 | # | |
296273a7 | 3549 | interface(`userdom_signal_unpriv_users',` |
f6abfdb8 | 3550 | gen_require(` |
296273a7 | 3551 | attribute unpriv_userdomain; |
f6abfdb8 CP |
3552 | ') |
3553 | ||
296273a7 | 3554 | allow $1 unpriv_userdomain:process signal; |
f6abfdb8 CP |
3555 | ') |
3556 | ||
3557 | ######################################## | |
3558 | ## <summary> | |
296273a7 | 3559 | ## Inherit the file descriptors from unprivileged user domains. |
f6abfdb8 CP |
3560 | ## </summary> |
3561 | ## <param name="domain"> | |
885b83ec | 3562 | ## <summary> |
f6abfdb8 | 3563 | ## Domain allowed access. |
885b83ec | 3564 | ## </summary> |
f6abfdb8 CP |
3565 | ## </param> |
3566 | # | |
296273a7 | 3567 | interface(`userdom_use_unpriv_users_fds',` |
f6abfdb8 | 3568 | gen_require(` |
296273a7 | 3569 | attribute unpriv_userdomain; |
f6abfdb8 CP |
3570 | ') |
3571 | ||
296273a7 | 3572 | allow $1 unpriv_userdomain:fd use; |
f6abfdb8 CP |
3573 | ') |
3574 | ||
725926c5 CP |
3575 | ######################################## |
3576 | ## <summary> | |
c46376e6 CP |
3577 | ## Do not audit attempts to inherit the file descriptors |
3578 | ## from unprivileged user domains. | |
725926c5 | 3579 | ## </summary> |
c46376e6 CP |
3580 | ## <desc> |
3581 | ## <p> | |
3582 | ## Do not audit attempts to inherit the file descriptors | |
3583 | ## from unprivileged user domains. This will supress | |
3584 | ## SELinux denial messages when the specified domain is denied | |
3585 | ## the permission to inherit these file descriptors. | |
3586 | ## </p> | |
3587 | ## </desc> | |
725926c5 | 3588 | ## <param name="domain"> |
885b83ec | 3589 | ## <summary> |
c46376e6 | 3590 | ## Domain to not audit. |
885b83ec | 3591 | ## </summary> |
725926c5 | 3592 | ## </param> |
c46376e6 | 3593 | ## <infoflow type="none"/> |
725926c5 | 3594 | # |
296273a7 | 3595 | interface(`userdom_dontaudit_use_unpriv_user_fds',` |
350b6ab7 | 3596 | gen_require(` |
296273a7 | 3597 | attribute unpriv_userdomain; |
725926c5 | 3598 | ') |
350b6ab7 | 3599 | |
296273a7 | 3600 | dontaudit $1 unpriv_userdomain:fd use; |
43989f82 CP |
3601 | ') |
3602 | ||
3603 | ######################################## | |
3604 | ## <summary> | |
296273a7 | 3605 | ## Do not audit attempts to use user ptys. |
43989f82 CP |
3606 | ## </summary> |
3607 | ## <param name="domain"> | |
885b83ec | 3608 | ## <summary> |
296273a7 | 3609 | ## Domain to not audit. |
885b83ec | 3610 | ## </summary> |
43989f82 CP |
3611 | ## </param> |
3612 | # | |
296273a7 | 3613 | interface(`userdom_dontaudit_use_user_ptys',` |
350b6ab7 | 3614 | gen_require(` |
296273a7 | 3615 | type user_devpts_t; |
725926c5 | 3616 | ') |
350b6ab7 | 3617 | |
f5b49a5e | 3618 | dontaudit $1 user_devpts_t:chr_file rw_inherited_file_perms; |
43989f82 CP |
3619 | ') |
3620 | ||
3621 | ######################################## | |
3622 | ## <summary> | |
296273a7 | 3623 | ## Relabel files to unprivileged user pty types. |
43989f82 CP |
3624 | ## </summary> |
3625 | ## <param name="domain"> | |
885b83ec | 3626 | ## <summary> |
43989f82 | 3627 | ## Domain allowed access. |
885b83ec | 3628 | ## </summary> |
43989f82 CP |
3629 | ## </param> |
3630 | # | |
296273a7 | 3631 | interface(`userdom_relabelto_user_ptys',` |
350b6ab7 | 3632 | gen_require(` |
296273a7 | 3633 | type user_devpts_t; |
725926c5 | 3634 | ') |
350b6ab7 | 3635 | |
296273a7 | 3636 | allow $1 user_devpts_t:chr_file relabelto; |
43989f82 CP |
3637 | ') |
3638 | ||
57a96cbd CP |
3639 | ######################################## |
3640 | ## <summary> | |
296273a7 CP |
3641 | ## Do not audit attempts to relabel files from |
3642 | ## user pty types. | |
ab940a4c | 3643 | ## </summary> |
414e4151 | 3644 | ## <param name="domain"> |
885b83ec | 3645 | ## <summary> |
a0546c9d | 3646 | ## Domain to not audit. |
885b83ec | 3647 | ## </summary> |
414e4151 | 3648 | ## </param> |
daa0e0b0 | 3649 | # |
296273a7 | 3650 | interface(`userdom_dontaudit_relabelfrom_user_ptys',` |
0404a390 | 3651 | gen_require(` |
296273a7 | 3652 | type user_devpts_t; |
0404a390 | 3653 | ') |
0c73cd25 | 3654 | |
296273a7 | 3655 | dontaudit $1 user_devpts_t:chr_file relabelfrom; |
daa0e0b0 CP |
3656 | ') |
3657 | ||
693d4aed CP |
3658 | ######################################## |
3659 | ## <summary> | |
296273a7 | 3660 | ## Write all users files in /tmp |
693d4aed CP |
3661 | ## </summary> |
3662 | ## <param name="domain"> | |
3663 | ## <summary> | |
3664 | ## Domain allowed access. | |
3665 | ## </summary> | |
3666 | ## </param> | |
3667 | # | |
296273a7 | 3668 | interface(`userdom_write_user_tmp_files',` |
350b6ab7 | 3669 | gen_require(` |
296273a7 | 3670 | type user_tmp_t; |
693d4aed | 3671 | ') |
350b6ab7 | 3672 | |
3eaa9939 DW |
3673 | write_files_pattern($1, user_tmp_t, user_tmp_t) |
3674 | ') | |
3675 | ||
3676 | ######################################## | |
3677 | ## <summary> | |
3678 | ## Do not audit attempts to write users | |
3679 | ## temporary files. | |
3680 | ## </summary> | |
3681 | ## <param name="domain"> | |
3682 | ## <summary> | |
3683 | ## Domain to not audit. | |
3684 | ## </summary> | |
3685 | ## </param> | |
3686 | # | |
3687 | interface(`userdom_dontaudit_write_user_tmp_files',` | |
3688 | gen_require(` | |
3689 | type user_tmp_t; | |
3690 | ') | |
3691 | ||
3692 | dontaudit $1 user_tmp_t:file write; | |
3693 | ') | |
3694 | ||
3695 | ######################################## | |
3696 | ## <summary> | |
3697 | ## Do not audit attempts to read/write users | |
3698 | ## temporary fifo files. | |
3699 | ## </summary> | |
3700 | ## <param name="domain"> | |
3701 | ## <summary> | |
3702 | ## Domain to not audit. | |
3703 | ## </summary> | |
3704 | ## </param> | |
3705 | # | |
3706 | interface(`userdom_dontaudit_rw_user_tmp_pipes',` | |
3707 | gen_require(` | |
3708 | type user_tmp_t; | |
3709 | ') | |
3710 | ||
3711 | dontaudit $1 user_tmp_t:fifo_file rw_inherited_fifo_file_perms; | |
693d4aed CP |
3712 | ') |
3713 | ||
ebdc3b79 CP |
3714 | ######################################## |
3715 | ## <summary> | |
296273a7 | 3716 | ## Do not audit attempts to use user ttys. |
ebdc3b79 CP |
3717 | ## </summary> |
3718 | ## <param name="domain"> | |
885b83ec | 3719 | ## <summary> |
a0546c9d | 3720 | ## Domain to not audit. |
885b83ec | 3721 | ## </summary> |
ebdc3b79 CP |
3722 | ## </param> |
3723 | # | |
296273a7 | 3724 | interface(`userdom_dontaudit_use_user_ttys',` |
350b6ab7 | 3725 | gen_require(` |
296273a7 | 3726 | type user_tty_device_t; |
9cc2ccc4 | 3727 | ') |
350b6ab7 | 3728 | |
6d51b2fc | 3729 | dontaudit $1 user_tty_device_t:chr_file rw_inherited_file_perms; |
ebdc3b79 | 3730 | ') |
c98340cf | 3731 | |
2629c659 CP |
3732 | ######################################## |
3733 | ## <summary> | |
3734 | ## Read the process state of all user domains. | |
3735 | ## </summary> | |
3736 | ## <param name="domain"> | |
885b83ec | 3737 | ## <summary> |
2629c659 | 3738 | ## Domain allowed access. |
885b83ec | 3739 | ## </summary> |
2629c659 CP |
3740 | ## </param> |
3741 | # | |
1815bad1 | 3742 | interface(`userdom_read_all_users_state',` |
2629c659 CP |
3743 | gen_require(` |
3744 | attribute userdomain; | |
3745 | ') | |
3746 | ||
3f67f722 | 3747 | read_files_pattern($1, userdomain, userdomain) |
3eaa9939 | 3748 | read_lnk_files_pattern($1,userdomain,userdomain) |
2629c659 CP |
3749 | kernel_search_proc($1) |
3750 | ') | |
3751 | ||
3752 | ######################################## | |
3753 | ## <summary> | |
3754 | ## Get the attributes of all user domains. | |
3755 | ## </summary> | |
3756 | ## <param name="domain"> | |
885b83ec | 3757 | ## <summary> |
2629c659 | 3758 | ## Domain allowed access. |
885b83ec | 3759 | ## </summary> |
2629c659 CP |
3760 | ## </param> |
3761 | # | |
15722ec9 | 3762 | interface(`userdom_getattr_all_users',` |
2629c659 CP |
3763 | gen_require(` |
3764 | attribute userdomain; | |
3765 | ') | |
3766 | ||
3767 | allow $1 userdomain:process getattr; | |
3768 | ') | |
3769 | ||
57a96cbd CP |
3770 | ######################################## |
3771 | ## <summary> | |
3772 | ## Inherit the file descriptors from all user domains | |
3773 | ## </summary> | |
3774 | ## <param name="domain"> | |
885b83ec | 3775 | ## <summary> |
725926c5 | 3776 | ## Domain allowed access. |
885b83ec | 3777 | ## </summary> |
57a96cbd CP |
3778 | ## </param> |
3779 | # | |
15722ec9 | 3780 | interface(`userdom_use_all_users_fds',` |
57a96cbd CP |
3781 | gen_require(` |
3782 | attribute userdomain; | |
57a96cbd CP |
3783 | ') |
3784 | ||
3785 | allow $1 userdomain:fd use; | |
3786 | ') | |
3787 | ||
3788 | ######################################## | |
eb3cb682 CP |
3789 | ## <summary> |
3790 | ## Do not audit attempts to inherit the file | |
3791 | ## descriptors from any user domains. | |
3792 | ## </summary> | |
3793 | ## <param name="domain"> | |
885b83ec | 3794 | ## <summary> |
eb3cb682 | 3795 | ## Domain to not audit. |
885b83ec | 3796 | ## </summary> |
eb3cb682 CP |
3797 | ## </param> |
3798 | # | |
15722ec9 | 3799 | interface(`userdom_dontaudit_use_all_users_fds',` |
eb3cb682 CP |
3800 | gen_require(` |
3801 | attribute userdomain; | |
eb3cb682 CP |
3802 | ') |
3803 | ||
3804 | dontaudit $1 userdomain:fd use; | |
3805 | ') | |
3806 | ||
3807 | ######################################## | |
57a96cbd CP |
3808 | ## <summary> |
3809 | ## Send general signals to all user domains. | |
3810 | ## </summary> | |
3811 | ## <param name="domain"> | |
885b83ec | 3812 | ## <summary> |
725926c5 | 3813 | ## Domain allowed access. |
885b83ec | 3814 | ## </summary> |
57a96cbd CP |
3815 | ## </param> |
3816 | # | |
3817 | interface(`userdom_signal_all_users',` | |
3818 | gen_require(` | |
3819 | attribute userdomain; | |
57a96cbd CP |
3820 | ') |
3821 | ||
3822 | allow $1 userdomain:process signal; | |
3823 | ') | |
3824 | ||
4f115e10 DW |
3825 | ######################################## |
3826 | ## <summary> | |
3827 | ## Send kill signals to all user domains. | |
3828 | ## </summary> | |
3829 | ## <param name="domain"> | |
3830 | ## <summary> | |
3831 | ## Domain allowed access. | |
3832 | ## </summary> | |
3833 | ## </param> | |
3834 | # | |
3835 | interface(`userdom_kill_all_users',` | |
3836 | gen_require(` | |
3837 | attribute userdomain; | |
3838 | ') | |
3839 | ||
3840 | allow $1 userdomain:process sigkill; | |
3841 | ') | |
3842 | ||
246839f3 CP |
3843 | ######################################## |
3844 | ## <summary> | |
3845 | ## Send a SIGCHLD signal to all user domains. | |
3846 | ## </summary> | |
3847 | ## <param name="domain"> | |
885b83ec | 3848 | ## <summary> |
246839f3 | 3849 | ## Domain allowed access. |
885b83ec | 3850 | ## </summary> |
246839f3 CP |
3851 | ## </param> |
3852 | # | |
9fd4b818 | 3853 | interface(`userdom_sigchld_all_users',` |
246839f3 CP |
3854 | gen_require(` |
3855 | attribute userdomain; | |
246839f3 CP |
3856 | ') |
3857 | ||
a1fcff33 | 3858 | allow $1 userdomain:process sigchld; |
246839f3 CP |
3859 | ') |
3860 | ||
5be1b61a DW |
3861 | ######################################## |
3862 | ## <summary> | |
3863 | ## Read keys for all user domains. | |
3864 | ## </summary> | |
3865 | ## <param name="domain"> | |
3866 | ## <summary> | |
3867 | ## Domain allowed access. | |
3868 | ## </summary> | |
3869 | ## </param> | |
3870 | # | |
3871 | interface(`userdom_read_all_users_keys',` | |
3872 | gen_require(` | |
3873 | attribute userdomain; | |
3874 | ') | |
3875 | ||
3876 | allow $1 userdomain:key read; | |
3877 | ') | |
3878 | ||
fe3a1eb8 CP |
3879 | ######################################## |
3880 | ## <summary> | |
3881 | ## Create keys for all user domains. | |
3882 | ## </summary> | |
3883 | ## <param name="domain"> | |
3884 | ## <summary> | |
3885 | ## Domain allowed access. | |
3886 | ## </summary> | |
3887 | ## </param> | |
3888 | # | |
3889 | interface(`userdom_create_all_users_keys',` | |
350b6ab7 CP |
3890 | gen_require(` |
3891 | attribute userdomain; | |
fe3a1eb8 | 3892 | ') |
350b6ab7 CP |
3893 | |
3894 | allow $1 userdomain:key create; | |
fe3a1eb8 CP |
3895 | ') |
3896 | ||
9fd4b818 CP |
3897 | ######################################## |
3898 | ## <summary> | |
3899 | ## Send a dbus message to all user domains. | |
3900 | ## </summary> | |
3901 | ## <param name="domain"> | |
885b83ec | 3902 | ## <summary> |
9fd4b818 | 3903 | ## Domain allowed access. |
885b83ec | 3904 | ## </summary> |
9fd4b818 CP |
3905 | ## </param> |
3906 | # | |
3907 | interface(`userdom_dbus_send_all_users',` | |
3908 | gen_require(` | |
3909 | attribute userdomain; | |
3910 | class dbus send_msg; | |
3911 | ') | |
3912 | ||
3913 | allow $1 userdomain:dbus send_msg; | |
3914 | ') | |
3eaa9939 DW |
3915 | |
3916 | ######################################## | |
3917 | ## <summary> | |
3918 | ## Allow apps to set rlimits on userdomain | |
3919 | ## </summary> | |
3920 | ## <param name="domain"> | |
3921 | ## <summary> | |
3922 | ## Domain allowed access. | |
3923 | ## </summary> | |
3924 | ## </param> | |
3925 | # | |
3926 | interface(`userdom_set_rlimitnh',` | |
3927 | gen_require(` | |
3928 | attribute userdomain; | |
3929 | ') | |
3930 | ||
3931 | allow $1 userdomain:process rlimitinh; | |
3932 | ') | |
3933 | ||
3934 | ######################################## | |
3935 | ## <summary> | |
3936 | ## Define this type as a Allow apps to set rlimits on userdomain | |
3937 | ## </summary> | |
3938 | ## <param name="domain"> | |
3939 | ## <summary> | |
3940 | ## Domain allowed access. | |
3941 | ## </summary> | |
3942 | ## </param> | |
3943 | ## <param name="userdomain_prefix"> | |
3944 | ## <summary> | |
3945 | ## The prefix of the user domain (e.g., user | |
3946 | ## is the prefix for user_t). | |
3947 | ## </summary> | |
3948 | ## </param> | |
3949 | ## <param name="domain"> | |
3950 | ## <summary> | |
3951 | ## Domain allowed access. | |
3952 | ## </summary> | |
3953 | ## </param> | |
3954 | # | |
3955 | template(`userdom_unpriv_usertype',` | |
3956 | gen_require(` | |
3957 | attribute unpriv_userdomain, userdomain; | |
3958 | attribute $1_usertype; | |
3959 | ') | |
3960 | typeattribute $2 $1_usertype; | |
3961 | typeattribute $2 unpriv_userdomain; | |
3962 | typeattribute $2 userdomain; | |
ae68f77d DW |
3963 | |
3964 | auth_use_nsswitch($2) | |
3eaa9939 DW |
3965 | ubac_constrained($2) |
3966 | ') | |
3967 | ||
3968 | ######################################## | |
3969 | ## <summary> | |
3970 | ## Connect to users over an unix stream socket. | |
3971 | ## </summary> | |
3972 | ## <param name="domain"> | |
3973 | ## <summary> | |
3974 | ## Domain allowed access. | |
3975 | ## </summary> | |
3976 | ## </param> | |
3977 | # | |
3978 | interface(`userdom_stream_connect',` | |
3979 | gen_require(` | |
3980 | type user_tmp_t; | |
3981 | attribute userdomain; | |
3982 | ') | |
3983 | ||
3984 | stream_connect_pattern($1, user_tmp_t, user_tmp_t, userdomain) | |
3985 | ') | |
3986 | ||
3987 | ######################################## | |
3988 | ## <summary> | |
3989 | ## Ptrace user domains. | |
3990 | ## </summary> | |
3991 | ## <param name="domain"> | |
3992 | ## <summary> | |
3993 | ## Domain allowed access. | |
3994 | ## </summary> | |
3995 | ## </param> | |
3996 | # | |
3997 | interface(`userdom_ptrace_all_users',` | |
3998 | gen_require(` | |
3999 | attribute userdomain; | |
4000 | ') | |
4001 | ||
995bdbb1 | 4002 | tunable_policy(`deny_ptrace',`',` |
4003 | allow $1 userdomain:process ptrace; | |
4004 | ') | |
3eaa9939 DW |
4005 | ') |
4006 | ||
4007 | ######################################## | |
4008 | ## <summary> | |
4009 | ## dontaudit Search /root | |
4010 | ## </summary> | |
4011 | ## <param name="domain"> | |
4012 | ## <summary> | |
24280f35 | 4013 | ## Domain to not audit. |
3eaa9939 DW |
4014 | ## </summary> |
4015 | ## </param> | |
4016 | # | |
4017 | interface(`userdom_dontaudit_search_admin_dir',` | |
4018 | gen_require(` | |
4019 | type admin_home_t; | |
4020 | ') | |
4021 | ||
4022 | dontaudit $1 admin_home_t:dir search_dir_perms; | |
4023 | ') | |
4024 | ||
4025 | ######################################## | |
4026 | ## <summary> | |
4027 | ## dontaudit list /root | |
4028 | ## </summary> | |
4029 | ## <param name="domain"> | |
4030 | ## <summary> | |
24280f35 | 4031 | ## Domain to not audit. |
3eaa9939 DW |
4032 | ## </summary> |
4033 | ## </param> | |
4034 | # | |
4035 | interface(`userdom_dontaudit_list_admin_dir',` | |
4036 | gen_require(` | |
4037 | type admin_home_t; | |
4038 | ') | |
4039 | ||
4040 | dontaudit $1 admin_home_t:dir list_dir_perms; | |
4041 | ') | |
4042 | ||
4043 | ######################################## | |
4044 | ## <summary> | |
4045 | ## Allow domain to list /root | |
4046 | ## </summary> | |
4047 | ## <param name="domain"> | |
4048 | ## <summary> | |
4049 | ## Domain allowed access. | |
4050 | ## </summary> | |
4051 | ## </param> | |
4052 | # | |
4053 | interface(`userdom_list_admin_dir',` | |
4054 | gen_require(` | |
4055 | type admin_home_t; | |
4056 | ') | |
4057 | ||
4058 | allow $1 admin_home_t:dir list_dir_perms; | |
4059 | ') | |
4060 | ||
4061 | ######################################## | |
4062 | ## <summary> | |
4063 | ## Allow Search /root | |
4064 | ## </summary> | |
4065 | ## <param name="domain"> | |
4066 | ## <summary> | |
4067 | ## Domain allowed access. | |
4068 | ## </summary> | |
4069 | ## </param> | |
4070 | # | |
4071 | interface(`userdom_search_admin_dir',` | |
4072 | gen_require(` | |
4073 | type admin_home_t; | |
4074 | ') | |
4075 | ||
4076 | allow $1 admin_home_t:dir search_dir_perms; | |
4077 | ') | |
4078 | ||
4079 | ######################################## | |
4080 | ## <summary> | |
4081 | ## RW unpriviledged user SysV sempaphores. | |
4082 | ## </summary> | |
4083 | ## <param name="domain"> | |
4084 | ## <summary> | |
4085 | ## Domain allowed access. | |
4086 | ## </summary> | |
4087 | ## </param> | |
4088 | # | |
4089 | interface(`userdom_rw_semaphores',` | |
4090 | gen_require(` | |
4091 | attribute unpriv_userdomain; | |
4092 | ') | |
4093 | ||
4094 | allow $1 unpriv_userdomain:sem rw_sem_perms; | |
4095 | ') | |
4096 | ||
4097 | ######################################## | |
4098 | ## <summary> | |
4099 | ## Send a message to unpriv users over a unix domain | |
4100 | ## datagram socket. | |
4101 | ## </summary> | |
4102 | ## <param name="domain"> | |
4103 | ## <summary> | |
4104 | ## Domain allowed access. | |
4105 | ## </summary> | |
4106 | ## </param> | |
4107 | # | |
4108 | interface(`userdom_dgram_send',` | |
4109 | gen_require(` | |
4110 | attribute unpriv_userdomain; | |
4111 | ') | |
4112 | ||
4113 | allow $1 unpriv_userdomain:unix_dgram_socket sendto; | |
4114 | ') | |
4115 | ||
4116 | ###################################### | |
4117 | ## <summary> | |
4118 | ## Send a message to users over a unix domain | |
4119 | ## datagram socket. | |
4120 | ## </summary> | |
4121 | ## <param name="domain"> | |
4122 | ## <summary> | |
4123 | ## Domain allowed access. | |
4124 | ## </summary> | |
4125 | ## </param> | |
4126 | # | |
4127 | interface(`userdom_users_dgram_send',` | |
4128 | gen_require(` | |
4129 | attribute userdomain; | |
4130 | ') | |
4131 | ||
4132 | allow $1 userdomain:unix_dgram_socket sendto; | |
4133 | ') | |
4134 | ||
4135 | ####################################### | |
4136 | ## <summary> | |
4137 | ## Allow execmod on files in homedirectory | |
4138 | ## </summary> | |
4139 | ## <param name="domain"> | |
4140 | ## <summary> | |
4141 | ## Domain allowed access. | |
4142 | ## </summary> | |
4143 | ## </param> | |
4144 | ## <rolebase/> | |
4145 | # | |
4146 | interface(`userdom_execmod_user_home_files',` | |
4147 | gen_require(` | |
4148 | type user_home_type; | |
4149 | ') | |
4150 | ||
4151 | allow $1 user_home_type:file execmod; | |
4152 | ') | |
4153 | ||
4154 | ######################################## | |
4155 | ## <summary> | |
4156 | ## Read admin home files. | |
4157 | ## </summary> | |
4158 | ## <param name="domain"> | |
4159 | ## <summary> | |
4160 | ## Domain allowed access. | |
4161 | ## </summary> | |
4162 | ## </param> | |
4163 | ## <rolecap/> | |
4164 | # | |
4165 | interface(`userdom_read_admin_home_files',` | |
4166 | gen_require(` | |
4167 | type admin_home_t; | |
4168 | ') | |
4169 | ||
4170 | read_files_pattern($1, admin_home_t, admin_home_t) | |
4171 | ') | |
4172 | ||
4173 | ######################################## | |
4174 | ## <summary> | |
4175 | ## Execute admin home files. | |
4176 | ## </summary> | |
4177 | ## <param name="domain"> | |
4178 | ## <summary> | |
4179 | ## Domain allowed access. | |
4180 | ## </summary> | |
4181 | ## </param> | |
4182 | ## <rolecap/> | |
4183 | # | |
4184 | interface(`userdom_exec_admin_home_files',` | |
4185 | gen_require(` | |
4186 | type admin_home_t; | |
4187 | ') | |
4188 | ||
4189 | exec_files_pattern($1, admin_home_t, admin_home_t) | |
4190 | ') | |
4191 | ||
4192 | ######################################## | |
4193 | ## <summary> | |
4194 | ## Append files inherited | |
4195 | ## in the /root directory. | |
4196 | ## </summary> | |
4197 | ## <param name="domain"> | |
4198 | ## <summary> | |
4199 | ## Domain allowed access. | |
4200 | ## </summary> | |
4201 | ## </param> | |
4202 | # | |
4203 | interface(`userdom_inherit_append_admin_home_files',` | |
4204 | gen_require(` | |
4205 | type admin_home_t; | |
4206 | ') | |
4207 | ||
4208 | allow $1 admin_home_t:file { getattr append }; | |
4209 | ') | |
4210 | ||
4211 | ||
4212 | ####################################### | |
4213 | ## <summary> | |
4214 | ## Manage all files/directories in the homedir | |
4215 | ## </summary> | |
4216 | ## <param name="userdomain"> | |
4217 | ## <summary> | |
4218 | ## The user domain | |
4219 | ## </summary> | |
4220 | ## </param> | |
4221 | ## <rolebase/> | |
4222 | # | |
4223 | interface(`userdom_manage_user_home_content',` | |
4224 | gen_require(` | |
4225 | type user_home_dir_t, user_home_t; | |
4226 | attribute user_home_type; | |
4227 | ') | |
4228 | ||
4229 | files_list_home($1) | |
4230 | manage_dirs_pattern($1, { user_home_dir_t user_home_type }, user_home_type) | |
4231 | manage_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type) | |
4232 | manage_lnk_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type) | |
4233 | manage_sock_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type) | |
4234 | manage_fifo_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type) | |
4235 | filetrans_pattern($1, user_home_dir_t, user_home_t, { dir file lnk_file sock_file fifo_file }) | |
4236 | ||
4237 | ') | |
4238 | ||
4239 | ||
4240 | ######################################## | |
4241 | ## <summary> | |
4242 | ## Create objects in a user home directory | |
4243 | ## with an automatic type transition to | |
4244 | ## the user home file type. | |
4245 | ## </summary> | |
4246 | ## <param name="domain"> | |
4247 | ## <summary> | |
4248 | ## Domain allowed access. | |
4249 | ## </summary> | |
4250 | ## </param> | |
4251 | ## <param name="object_class"> | |
4252 | ## <summary> | |
4253 | ## The class of the object to be created. | |
4254 | ## </summary> | |
4255 | ## </param> | |
4256 | # | |
4257 | interface(`userdom_user_home_dir_filetrans_pattern',` | |
4258 | gen_require(` | |
4259 | type user_home_dir_t, user_home_t; | |
4260 | ') | |
4261 | ||
4262 | type_transition $1 user_home_dir_t:$2 user_home_t; | |
4263 | ') | |
4264 | ||
4265 | ######################################## | |
4266 | ## <summary> | |
4267 | ## Create objects in the /root directory | |
4268 | ## with an automatic type transition to | |
4269 | ## a specified private type. | |
4270 | ## </summary> | |
4271 | ## <param name="domain"> | |
4272 | ## <summary> | |
4273 | ## Domain allowed access. | |
4274 | ## </summary> | |
4275 | ## </param> | |
4276 | ## <param name="private_type"> | |
4277 | ## <summary> | |
4278 | ## The type of the object to create. | |
4279 | ## </summary> | |
4280 | ## </param> | |
4281 | ## <param name="object_class"> | |
4282 | ## <summary> | |
4283 | ## The class of the object to be created. | |
4284 | ## </summary> | |
4285 | ## </param> | |
4286 | # | |
4287 | interface(`userdom_admin_home_dir_filetrans',` | |
4288 | gen_require(` | |
4289 | type admin_home_t; | |
4290 | ') | |
4291 | ||
ae4832c7 | 4292 | filetrans_pattern($1, admin_home_t, $2, $3, $4) |
3eaa9939 DW |
4293 | ') |
4294 | ||
4295 | ######################################## | |
4296 | ## <summary> | |
4297 | ## Send signull to unprivileged user domains. | |
4298 | ## </summary> | |
4299 | ## <param name="domain"> | |
4300 | ## <summary> | |
4301 | ## Domain allowed access. | |
4302 | ## </summary> | |
4303 | ## </param> | |
4304 | # | |
4305 | interface(`userdom_signull_unpriv_users',` | |
4306 | gen_require(` | |
4307 | attribute unpriv_userdomain; | |
4308 | ') | |
4309 | ||
4310 | allow $1 unpriv_userdomain:process signull; | |
4311 | ') | |
4312 | ||
4313 | ######################################## | |
4314 | ## <summary> | |
4315 | ## Write all users files in /tmp | |
4316 | ## </summary> | |
4317 | ## <param name="domain"> | |
4318 | ## <summary> | |
4319 | ## Domain allowed access. | |
4320 | ## </summary> | |
4321 | ## </param> | |
4322 | # | |
4323 | interface(`userdom_write_user_tmp_dirs',` | |
4324 | gen_require(` | |
4325 | type user_tmp_t; | |
4326 | ') | |
4327 | ||
4328 | write_files_pattern($1, user_tmp_t, user_tmp_t) | |
4329 | ') | |
4330 | ||
4331 | ######################################## | |
4332 | ## <summary> | |
4333 | ## Manage keys for all user domains. | |
4334 | ## </summary> | |
4335 | ## <param name="domain"> | |
4336 | ## <summary> | |
4337 | ## Domain allowed access. | |
4338 | ## </summary> | |
4339 | ## </param> | |
4340 | # | |
4341 | interface(`userdom_manage_all_users_keys',` | |
4342 | gen_require(` | |
4343 | attribute userdomain; | |
4344 | ') | |
4345 | ||
4346 | allow $1 userdomain:key manage_key_perms; | |
4347 | ') | |
4348 | ||
4349 | ||
4350 | ######################################## | |
4351 | ## <summary> | |
4352 | ## Do not audit attempts to read and write | |
4353 | ## unserdomain stream. | |
4354 | ## </summary> | |
4355 | ## <param name="domain"> | |
4356 | ## <summary> | |
4357 | ## Domain to not audit. | |
4358 | ## </summary> | |
4359 | ## </param> | |
4360 | # | |
4361 | interface(`userdom_dontaudit_rw_stream',` | |
4362 | gen_require(` | |
4363 | attribute userdomain; | |
4364 | ') | |
4365 | ||
4366 | dontaudit $1 userdomain:unix_stream_socket rw_socket_perms; | |
4367 | ') | |
4368 | ||
3d3d47e4 DW |
4369 | ######################################## |
4370 | ## <summary> | |
4371 | ## Do not audit attempts to read and write | |
4372 | ## unserdomain datagram socket. | |
4373 | ## </summary> | |
4374 | ## <param name="domain"> | |
4375 | ## <summary> | |
4376 | ## Domain to not audit. | |
4377 | ## </summary> | |
4378 | ## </param> | |
4379 | # | |
4380 | interface(`userdom_dontaudit_rw_dgram_socket',` | |
4381 | gen_require(` | |
4382 | attribute userdomain; | |
4383 | ') | |
4384 | ||
6a074ab5 | 4385 | dontaudit $1 userdomain:unix_dgram_socket { read write }; |
3d3d47e4 DW |
4386 | ') |
4387 | ||
3eaa9939 DW |
4388 | ######################################## |
4389 | ## <summary> | |
4390 | ## Append files | |
4391 | ## in a user home subdirectory. | |
4392 | ## </summary> | |
4393 | ## <param name="domain"> | |
4394 | ## <summary> | |
4395 | ## Domain allowed access. | |
4396 | ## </summary> | |
4397 | ## </param> | |
4398 | # | |
4399 | interface(`userdom_append_user_home_content_files',` | |
4400 | gen_require(` | |
4401 | type user_home_dir_t, user_home_t; | |
4402 | ') | |
4403 | ||
4404 | append_files_pattern($1, user_home_t, user_home_t) | |
4405 | allow $1 user_home_dir_t:dir search_dir_perms; | |
4406 | files_search_home($1) | |
4407 | ') | |
4408 | ||
4409 | ######################################## | |
4410 | ## <summary> | |
4411 | ## Read files inherited | |
4412 | ## in a user home subdirectory. | |
4413 | ## </summary> | |
4414 | ## <param name="domain"> | |
4415 | ## <summary> | |
4416 | ## Domain allowed access. | |
4417 | ## </summary> | |
4418 | ## </param> | |
4419 | # | |
4420 | interface(`userdom_read_inherited_user_home_content_files',` | |
4421 | gen_require(` | |
4422 | attribute user_home_type; | |
4423 | ') | |
4424 | ||
4425 | allow $1 user_home_type:file { getattr read }; | |
4426 | ') | |
4427 | ||
4428 | ######################################## | |
4429 | ## <summary> | |
4430 | ## Append files inherited | |
4431 | ## in a user home subdirectory. | |
4432 | ## </summary> | |
4433 | ## <param name="domain"> | |
4434 | ## <summary> | |
4435 | ## Domain allowed access. | |
4436 | ## </summary> | |
4437 | ## </param> | |
4438 | # | |
4439 | interface(`userdom_inherit_append_user_home_content_files',` | |
4440 | gen_require(` | |
4441 | type user_home_t; | |
4442 | ') | |
4443 | ||
4444 | allow $1 user_home_t:file { getattr append }; | |
4445 | ') | |
4446 | ||
4447 | ######################################## | |
4448 | ## <summary> | |
4449 | ## Append files inherited | |
4450 | ## in a user tmp files. | |
4451 | ## </summary> | |
4452 | ## <param name="domain"> | |
4453 | ## <summary> | |
4454 | ## Domain allowed access. | |
4455 | ## </summary> | |
4456 | ## </param> | |
4457 | # | |
4458 | interface(`userdom_inherit_append_user_tmp_files',` | |
4459 | gen_require(` | |
4460 | type user_tmp_t; | |
4461 | ') | |
4462 | ||
4463 | allow $1 user_tmp_t:file { getattr append }; | |
4464 | ') | |
4465 | ||
4466 | ###################################### | |
4467 | ## <summary> | |
4468 | ## Read audio files in the users homedir. | |
4469 | ## </summary> | |
4470 | ## <param name="domain"> | |
4471 | ## <summary> | |
4472 | ## Domain allowed access. | |
4473 | ## </summary> | |
4474 | ## </param> | |
4475 | ## <rolecap/> | |
4476 | # | |
4477 | interface(`userdom_read_home_audio_files',` | |
4478 | gen_require(` | |
4479 | type audio_home_t; | |
4480 | ') | |
4481 | ||
4482 | userdom_search_user_home_dirs($1) | |
4483 | allow $1 audio_home_t:dir list_dir_perms; | |
4484 | read_files_pattern($1, audio_home_t, audio_home_t) | |
4485 | read_lnk_files_pattern($1, audio_home_t, audio_home_t) | |
4486 | ') | |
4487 | ||
ca9e8850 DW |
4488 | ######################################## |
4489 | ## <summary> | |
4490 | ## Do not audit attempts to write all user home content files. | |
4491 | ## </summary> | |
4492 | ## <param name="domain"> | |
4493 | ## <summary> | |
4494 | ## Domain to not audit. | |
4495 | ## </summary> | |
4496 | ## </param> | |
4497 | # | |
4498 | interface(`userdom_dontaudit_write_all_user_home_content_files',` | |
4499 | gen_require(` | |
4500 | attribute user_home_type; | |
4501 | ') | |
4502 | ||
4503 | dontaudit $1 user_home_type:file write_file_perms; | |
4504 | ') | |
4505 | ||
4506 | ######################################## | |
4507 | ## <summary> | |
4508 | ## Do not audit attempts to write all user tmp content files. | |
4509 | ## </summary> | |
4510 | ## <param name="domain"> | |
4511 | ## <summary> | |
4512 | ## Domain to not audit. | |
4513 | ## </summary> | |
4514 | ## </param> | |
4515 | # | |
4516 | interface(`userdom_dontaudit_write_all_user_tmp_content_files',` | |
4517 | gen_require(` | |
4518 | attribute user_tmp_type; | |
4519 | ') | |
4520 | ||
4521 | dontaudit $1 user_tmp_type:file write_file_perms; | |
4522 | ') | |
4523 | ||
4524 | ######################################## | |
4525 | ## <summary> | |
4526 | ## Manage all user temporary content. | |
4527 | ## </summary> | |
4528 | ## <param name="domain"> | |
4529 | ## <summary> | |
4530 | ## Domain allowed access. | |
4531 | ## </summary> | |
4532 | ## </param> | |
4533 | # | |
4534 | interface(`userdom_manage_all_user_tmp_content',` | |
4535 | gen_require(` | |
4536 | attribute user_tmp_type; | |
4537 | ') | |
4538 | ||
4539 | manage_dirs_pattern($1, user_tmp_type, user_tmp_type) | |
4540 | manage_files_pattern($1, user_tmp_type, user_tmp_type) | |
4541 | manage_lnk_files_pattern($1, user_tmp_type, user_tmp_type) | |
4542 | manage_sock_files_pattern($1, user_tmp_type, user_tmp_type) | |
4543 | manage_fifo_files_pattern($1, user_tmp_type, user_tmp_type) | |
4544 | files_search_tmp($1) | |
4545 | ') | |
4546 | ||
4547 | ######################################## | |
4548 | ## <summary> | |
4549 | ## List all user temporary content. | |
4550 | ## </summary> | |
4551 | ## <param name="domain"> | |
4552 | ## <summary> | |
4553 | ## Domain allowed access. | |
4554 | ## </summary> | |
4555 | ## </param> | |
4556 | # | |
4557 | interface(`userdom_list_all_user_tmp_content',` | |
4558 | gen_require(` | |
4559 | attribute user_tmp_type; | |
4560 | ') | |
4561 | ||
4562 | list_dirs_pattern($1, user_tmp_type, user_tmp_type) | |
4563 | getattr_files_pattern($1, user_tmp_type, user_tmp_type) | |
4564 | read_lnk_files_pattern($1, user_tmp_type, user_tmp_type) | |
4565 | getattr_sock_files_pattern($1, user_tmp_type, user_tmp_type) | |
4566 | getattr_fifo_files_pattern($1, user_tmp_type, user_tmp_type) | |
4567 | files_search_var($1) | |
4568 | files_search_tmp($1) | |
4569 | ') | |
4570 | ||
4571 | ######################################## | |
4572 | ## <summary> | |
4573 | ## Manage all user tmpfs content. | |
4574 | ## </summary> | |
4575 | ## <param name="domain"> | |
4576 | ## <summary> | |
4577 | ## Domain allowed access. | |
4578 | ## </summary> | |
4579 | ## </param> | |
4580 | # | |
4581 | interface(`userdom_manage_all_user_tmpfs_content',` | |
4582 | gen_require(` | |
4583 | attribute user_tmpfs_type; | |
4584 | ') | |
4585 | ||
4586 | manage_dirs_pattern($1, user_tmpfs_type, user_tmpfs_type) | |
4587 | manage_files_pattern($1, user_tmpfs_type, user_tmpfs_type) | |
4588 | manage_lnk_files_pattern($1, user_tmpfs_type, user_tmpfs_type) | |
4589 | manage_sock_files_pattern($1, user_tmpfs_type, user_tmpfs_type) | |
4590 | manage_fifo_files_pattern($1, user_tmpfs_type, user_tmpfs_type) | |
4591 | fs_search_tmpfs($1) | |
4592 | ') | |
4593 | ||
4594 | ######################################## | |
4595 | ## <summary> | |
4596 | ## Delete all user temporary content. | |
4597 | ## </summary> | |
4598 | ## <param name="domain"> | |
4599 | ## <summary> | |
4600 | ## Domain allowed access. | |
4601 | ## </summary> | |
4602 | ## </param> | |
4603 | # | |
4604 | interface(`userdom_delete_all_user_tmp_content',` | |
4605 | gen_require(` | |
4606 | attribute user_tmp_type; | |
4607 | ') | |
4608 | ||
4609 | delete_dirs_pattern($1, user_tmp_type, user_tmp_type) | |
4610 | delete_files_pattern($1, user_tmp_type, user_tmp_type) | |
4611 | delete_lnk_files_pattern($1, user_tmp_type, user_tmp_type) | |
4612 | delete_sock_files_pattern($1, user_tmp_type, user_tmp_type) | |
4613 | delete_fifo_files_pattern($1, user_tmp_type, user_tmp_type) | |
4614 | # /var/tmp | |
4615 | files_search_var($1) | |
4616 | files_delete_tmp_dir_entry($1) | |
4617 | ') | |
4618 | ||
3eaa9939 DW |
4619 | ######################################## |
4620 | ## <summary> | |
4621 | ## Read system SSL certificates in the users homedir. | |
4622 | ## </summary> | |
4623 | ## <param name="domain"> | |
4624 | ## <summary> | |
4625 | ## Domain allowed access. | |
4626 | ## </summary> | |
4627 | ## </param> | |
3eaa9939 DW |
4628 | # |
4629 | interface(`userdom_read_home_certs',` | |
4630 | gen_require(` | |
4631 | type home_cert_t; | |
4632 | ') | |
4633 | ||
4982766c | 4634 | userdom_search_user_home_content($1) |
3eaa9939 DW |
4635 | allow $1 home_cert_t:dir list_dir_perms; |
4636 | read_files_pattern($1, home_cert_t, home_cert_t) | |
4637 | read_lnk_files_pattern($1, home_cert_t, home_cert_t) | |
4638 | ') | |
4639 | ||
55a7fd92 | 4640 | ######################################## |
4641 | ## <summary> | |
4642 | ## Manage system SSL certificates in the users homedir. | |
4643 | ## </summary> | |
4644 | ## <param name="domain"> | |
4645 | ## <summary> | |
4646 | ## Domain allowed access. | |
4647 | ## </summary> | |
4648 | ## </param> | |
4649 | # | |
4650 | interface(`userdom_manage_home_certs',` | |
4651 | gen_require(` | |
4652 | type home_cert_t; | |
4653 | ') | |
4654 | ||
4655 | allow $1 home_cert_t:dir list_dir_perms; | |
4656 | manage_files_pattern($1, home_cert_t, home_cert_t) | |
4657 | manage_lnk_files_pattern($1, home_cert_t, home_cert_t) | |
4658 | ||
4659 | userdom_user_home_dir_filetrans($1, home_cert_t, dir, ".cert") | |
4660 | userdom_user_home_dir_filetrans($1, home_cert_t, dir, ".pki") | |
4661 | ') | |
4662 | ||
f06e4c22 MG |
4663 | ####################################### |
4664 | ## <summary> | |
4665 | ## Dontaudit Write system SSL certificates in the users homedir. | |
4666 | ## </summary> | |
4667 | ## <param name="domain"> | |
4668 | ## <summary> | |
24280f35 | 4669 | ## Domain to not audit. |
f06e4c22 MG |
4670 | ## </summary> |
4671 | ## </param> | |
4672 | # | |
4673 | interface(`userdom_dontaudit_write_home_certs',` | |
4674 | gen_require(` | |
4675 | type home_cert_t; | |
4676 | ') | |
4677 | ||
4678 | dontaudit $1 home_cert_t:file write; | |
4679 | ') | |
4680 | ||
3eaa9939 DW |
4681 | ######################################## |
4682 | ## <summary> | |
4683 | ## dontaudit Search getatrr /root files | |
4684 | ## </summary> | |
4685 | ## <param name="domain"> | |
4686 | ## <summary> | |
24280f35 | 4687 | ## Domain to not audit. |
3eaa9939 DW |
4688 | ## </summary> |
4689 | ## </param> | |
4690 | # | |
4691 | interface(`userdom_dontaudit_getattr_admin_home_files',` | |
4692 | gen_require(` | |
4693 | type admin_home_t; | |
4694 | ') | |
4695 | ||
4696 | dontaudit $1 admin_home_t:file getattr; | |
4697 | ') | |
4698 | ||
4699 | ######################################## | |
4700 | ## <summary> | |
4701 | ## dontaudit read /root lnk files | |
4702 | ## </summary> | |
4703 | ## <param name="domain"> | |
4704 | ## <summary> | |
24280f35 | 4705 | ## Domain to not audit. |
3eaa9939 DW |
4706 | ## </summary> |
4707 | ## </param> | |
4708 | # | |
4709 | interface(`userdom_dontaudit_read_admin_home_lnk_files',` | |
4710 | gen_require(` | |
4711 | type admin_home_t; | |
4712 | ') | |
4713 | ||
4714 | dontaudit $1 admin_home_t:lnk_file read; | |
4715 | ') | |
4716 | ||
4717 | ######################################## | |
4718 | ## <summary> | |
4719 | ## dontaudit read /root files | |
4720 | ## </summary> | |
4721 | ## <param name="domain"> | |
4722 | ## <summary> | |
24280f35 | 4723 | ## Domain to not audit. |
3eaa9939 DW |
4724 | ## </summary> |
4725 | ## </param> | |
4726 | # | |
4727 | interface(`userdom_dontaudit_read_admin_home_files',` | |
4728 | gen_require(` | |
4729 | type admin_home_t; | |
4730 | ') | |
4731 | ||
4732 | dontaudit $1 admin_home_t:file read_file_perms; | |
4733 | ') | |
4734 | ||
4735 | ######################################## | |
4736 | ## <summary> | |
4737 | ## Create, read, write, and delete user | |
4738 | ## temporary chr files. | |
4739 | ## </summary> | |
4740 | ## <param name="domain"> | |
4741 | ## <summary> | |
4742 | ## Domain allowed access. | |
4743 | ## </summary> | |
4744 | ## </param> | |
4745 | # | |
4746 | interface(`userdom_manage_user_tmp_chr_files',` | |
4747 | gen_require(` | |
4748 | type user_tmp_t; | |
4749 | ') | |
4750 | ||
4751 | manage_chr_files_pattern($1, user_tmp_t, user_tmp_t) | |
4752 | files_search_tmp($1) | |
4753 | ') | |
4754 | ||
4755 | ######################################## | |
4756 | ## <summary> | |
4757 | ## Create, read, write, and delete user | |
4758 | ## temporary blk files. | |
4759 | ## </summary> | |
4760 | ## <param name="domain"> | |
4761 | ## <summary> | |
4762 | ## Domain allowed access. | |
4763 | ## </summary> | |
4764 | ## </param> | |
4765 | # | |
4766 | interface(`userdom_manage_user_tmp_blk_files',` | |
4767 | gen_require(` | |
4768 | type user_tmp_t; | |
4769 | ') | |
4770 | ||
4771 | manage_blk_files_pattern($1, user_tmp_t, user_tmp_t) | |
4772 | files_search_tmp($1) | |
4773 | ') | |
4774 | ||
4775 | ######################################## | |
4776 | ## <summary> | |
4777 | ## Dontaudit attempt to set attributes on user temporary directories. | |
4778 | ## </summary> | |
4779 | ## <param name="domain"> | |
4780 | ## <summary> | |
24280f35 | 4781 | ## Domain to not audit. |
3eaa9939 DW |
4782 | ## </summary> |
4783 | ## </param> | |
4784 | # | |
4785 | interface(`userdom_dontaudit_setattr_user_tmp',` | |
4786 | gen_require(` | |
4787 | type user_tmp_t; | |
4788 | ') | |
4789 | ||
4790 | dontaudit $1 user_tmp_t:dir setattr; | |
4791 | ') | |
4792 | ||
fd455670 DW |
4793 | ######################################## |
4794 | ## <summary> | |
4795 | ## Read all inherited users files in /tmp | |
4796 | ## </summary> | |
4797 | ## <param name="domain"> | |
4798 | ## <summary> | |
4799 | ## Domain allowed access. | |
4800 | ## </summary> | |
4801 | ## </param> | |
4802 | # | |
4803 | interface(`userdom_read_inherited_user_tmp_files',` | |
4804 | gen_require(` | |
4805 | type user_tmp_t; | |
4806 | ') | |
4807 | ||
4808 | allow $1 user_tmp_t:file read_inherited_file_perms; | |
4809 | ') | |
4810 | ||
3eaa9939 DW |
4811 | ######################################## |
4812 | ## <summary> | |
4813 | ## Write all inherited users files in /tmp | |
4814 | ## </summary> | |
4815 | ## <param name="domain"> | |
4816 | ## <summary> | |
4817 | ## Domain allowed access. | |
4818 | ## </summary> | |
4819 | ## </param> | |
4820 | # | |
4821 | interface(`userdom_write_inherited_user_tmp_files',` | |
4822 | gen_require(` | |
4823 | type user_tmp_t; | |
4824 | ') | |
4825 | ||
4826 | allow $1 user_tmp_t:file write; | |
4827 | ') | |
4828 | ||
4829 | ######################################## | |
4830 | ## <summary> | |
4831 | ## Delete all users files in /tmp | |
4832 | ## </summary> | |
4833 | ## <param name="domain"> | |
4834 | ## <summary> | |
4835 | ## Domain allowed access. | |
4836 | ## </summary> | |
4837 | ## </param> | |
4838 | # | |
4839 | interface(`userdom_delete_user_tmp_files',` | |
4840 | gen_require(` | |
4841 | type user_tmp_t; | |
4842 | ') | |
4843 | ||
4844 | allow $1 user_tmp_t:file delete_file_perms; | |
4845 | ') | |
4846 | ||
4847 | ######################################## | |
4848 | ## <summary> | |
4849 | ## Delete user tmpfs files. | |
4850 | ## </summary> | |
4851 | ## <param name="domain"> | |
4852 | ## <summary> | |
4853 | ## Domain allowed access. | |
4854 | ## </summary> | |
4855 | ## </param> | |
4856 | # | |
4857 | interface(`userdom_delete_user_tmpfs_files',` | |
4858 | gen_require(` | |
4859 | type user_tmpfs_t; | |
4860 | ') | |
4861 | ||
4862 | allow $1 user_tmpfs_t:file delete_file_perms; | |
4863 | ') | |
4864 | ||
4865 | ######################################## | |
4866 | ## <summary> | |
4867 | ## Read/Write unpriviledged user SysV shared | |
4868 | ## memory segments. | |
4869 | ## </summary> | |
4870 | ## <param name="domain"> | |
4871 | ## <summary> | |
4872 | ## Domain allowed access. | |
4873 | ## </summary> | |
4874 | ## </param> | |
4875 | # | |
4876 | interface(`userdom_rw_unpriv_user_shared_mem',` | |
4877 | gen_require(` | |
4878 | attribute unpriv_userdomain; | |
4879 | ') | |
4880 | ||
4881 | allow $1 unpriv_userdomain:shm rw_shm_perms; | |
4882 | ') | |
4883 | ||
4884 | ######################################## | |
4885 | ## <summary> | |
4886 | ## Do not audit attempts to search user | |
4887 | ## temporary directories. | |
4888 | ## </summary> | |
4889 | ## <param name="domain"> | |
4890 | ## <summary> | |
4891 | ## Domain to not audit. | |
4892 | ## </summary> | |
4893 | ## </param> | |
4894 | # | |
4895 | interface(`userdom_dontaudit_search_user_tmp',` | |
4896 | gen_require(` | |
4897 | type user_tmp_t; | |
4898 | ') | |
4899 | ||
4900 | dontaudit $1 user_tmp_t:dir search_dir_perms; | |
4901 | ') | |
4902 | ||
4903 | ######################################## | |
4904 | ## <summary> | |
4905 | ## Execute a file in a user home directory | |
4906 | ## in the specified domain. | |
4907 | ## </summary> | |
4908 | ## <desc> | |
4909 | ## <p> | |
4910 | ## Execute a file in a user home directory | |
4911 | ## in the specified domain. | |
4912 | ## </p> | |
4913 | ## <p> | |
4914 | ## No interprocess communication (signals, pipes, | |
4915 | ## etc.) is provided by this interface since | |
4916 | ## the domains are not owned by this module. | |
4917 | ## </p> | |
4918 | ## </desc> | |
4919 | ## <param name="domain"> | |
4920 | ## <summary> | |
4921 | ## Domain allowed access. | |
4922 | ## </summary> | |
4923 | ## </param> | |
4924 | ## <param name="target_domain"> | |
4925 | ## <summary> | |
4926 | ## The type of the new process. | |
4927 | ## </summary> | |
4928 | ## </param> | |
4929 | # | |
4930 | interface(`userdom_domtrans_user_home',` | |
4931 | gen_require(` | |
4932 | type user_home_t; | |
4933 | ') | |
4934 | ||
4935 | read_lnk_files_pattern($1, user_home_t, user_home_t) | |
4936 | domain_transition_pattern($1, user_home_t, $2) | |
4937 | type_transition $1 user_home_t:process $2; | |
4938 | ') | |
4939 | ||
4940 | ######################################## | |
4941 | ## <summary> | |
4942 | ## Execute a file in a user tmp directory | |
4943 | ## in the specified domain. | |
4944 | ## </summary> | |
4945 | ## <desc> | |
4946 | ## <p> | |
4947 | ## Execute a file in a user tmp directory | |
4948 | ## in the specified domain. | |
4949 | ## </p> | |
4950 | ## <p> | |
4951 | ## No interprocess communication (signals, pipes, | |
4952 | ## etc.) is provided by this interface since | |
4953 | ## the domains are not owned by this module. | |
4954 | ## </p> | |
4955 | ## </desc> | |
4956 | ## <param name="domain"> | |
4957 | ## <summary> | |
4958 | ## Domain allowed access. | |
4959 | ## </summary> | |
4960 | ## </param> | |
4961 | ## <param name="target_domain"> | |
4962 | ## <summary> | |
4963 | ## The type of the new process. | |
4964 | ## </summary> | |
4965 | ## </param> | |
4966 | # | |
4967 | interface(`userdom_domtrans_user_tmp',` | |
4968 | gen_require(` | |
4969 | type user_tmp_t; | |
4970 | ') | |
4971 | ||
4972 | files_search_tmp($1) | |
4973 | read_lnk_files_pattern($1, user_tmp_t, user_tmp_t) | |
4974 | domain_transition_pattern($1, user_tmp_t, $2) | |
4975 | type_transition $1 user_tmp_t:process $2; | |
4976 | ') | |
ca9e8850 DW |
4977 | |
4978 | ######################################## | |
4979 | ## <summary> | |
4980 | ## Do not audit attempts to read all user home content files. | |
4981 | ## </summary> | |
4982 | ## <param name="domain"> | |
4983 | ## <summary> | |
4984 | ## Domain to not audit. | |
4985 | ## </summary> | |
4986 | ## </param> | |
4987 | # | |
4988 | interface(`userdom_dontaudit_read_all_user_home_content_files',` | |
4989 | gen_require(` | |
4990 | attribute user_home_type; | |
4991 | ') | |
4992 | ||
4993 | dontaudit $1 user_home_type:file read_file_perms; | |
4994 | ') | |
4995 | ||
4996 | ######################################## | |
4997 | ## <summary> | |
4998 | ## Do not audit attempts to read all user tmp content files. | |
4999 | ## </summary> | |
5000 | ## <param name="domain"> | |
5001 | ## <summary> | |
5002 | ## Domain to not audit. | |
5003 | ## </summary> | |
5004 | ## </param> | |
5005 | # | |
5006 | interface(`userdom_dontaudit_read_all_user_tmp_content_files',` | |
5007 | gen_require(` | |
5008 | attribute user_tmp_type; | |
5009 | ') | |
5010 | ||
5011 | dontaudit $1 user_tmp_type:file read_file_perms; | |
5012 | ') | |
5013 | ||
2aa4540b MG |
5014 | ####################################### |
5015 | ## <summary> | |
5016 | ## Read and write unpriviledged user SysV sempaphores. | |
5017 | ## </summary> | |
5018 | ## <param name="domain"> | |
5019 | ## <summary> | |
5020 | ## Domain allowed access. | |
5021 | ## </summary> | |
5022 | ## </param> | |
5023 | # | |
5024 | interface(`userdom_rw_unpriv_user_semaphores',` | |
5025 | gen_require(` | |
5026 | attribute unpriv_userdomain; | |
5027 | ') | |
5028 | ||
5029 | allow $1 unpriv_userdomain:sem rw_sem_perms; | |
5030 | ') | |
55a7fd92 | 5031 | |
5032 | ######################################## | |
5033 | ## <summary> | |
5034 | ## Transition to userdom named content | |
5035 | ## </summary> | |
5036 | ## <param name="domain"> | |
5037 | ## <summary> | |
5038 | ## Domain allowed access. | |
5039 | ## </summary> | |
5040 | ## </param> | |
5041 | # | |
5042 | interface(`userdom_filetrans_home_content',` | |
5043 | gen_require(` | |
5044 | type home_bin_t, home_cert_t; | |
5045 | type audio_home_t; | |
5046 | ') | |
5047 | ||
5048 | userdom_user_home_dir_filetrans($1, home_bin_t, dir, "bin") | |
5049 | userdom_user_home_dir_filetrans($1, audio_home_t, dir, "Audio") | |
5050 | userdom_user_home_dir_filetrans($1, audio_home_t, dir, "Music") | |
5051 | userdom_user_home_dir_filetrans($1, home_cert_t, dir, ".cert") | |
5052 | userdom_user_home_dir_filetrans($1, home_cert_t, dir, ".pki") | |
14c739f0 DW |
5053 | userdom_user_home_dir_filetrans($1, home_cert_t, dir, "certificates") |
5054 | gnome_config_filetrans($1, home_cert_t, dir, "certificates") | |
55a7fd92 | 5055 | |
68ff7d5c MG |
5056 | #optional_policy(` |
5057 | # gnome_admin_home_gconf_filetrans($1, home_bin_t, dir, "bin") | |
5058 | #') | |
55a7fd92 | 5059 | ') |
ed2ac112 DW |
5060 | |
5061 | ######################################## | |
5062 | ## <summary> | |
5063 | ## Make the specified type able to read content in user home dirs | |
5064 | ## </summary> | |
5065 | ## <param name="type"> | |
5066 | ## <summary> | |
5067 | ## Domain allowed access. | |
5068 | ## </summary> | |
5069 | ## </param> | |
5070 | # | |
5071 | interface(`userdom_home_reader',` | |
5072 | gen_require(` | |
5073 | attribute userdom_home_reader_type; | |
5074 | ') | |
5075 | ||
5076 | typeattribute $1 userdom_home_reader_type; | |
5077 | ') | |
5078 | ||
5079 | ||
5080 | ######################################## | |
5081 | ## <summary> | |
5082 | ## Make the specified type able to manage content in user home dirs | |
5083 | ## </summary> | |
5084 | ## <param name="type"> | |
5085 | ## <summary> | |
5086 | ## Domain allowed access. | |
5087 | ## </summary> | |
5088 | ## </param> | |
5089 | # | |
5090 | interface(`userdom_home_manager',` | |
5091 | gen_require(` | |
5092 | attribute userdom_home_manager_type; | |
5093 | ') | |
5094 | ||
5095 | typeattribute $1 userdom_home_manager_type; | |
5096 | ') | |
5097 |