1 ## <summary>Policy for user domains</summary>
3 #######################################
5 ## The template containing the most basic rules common to all users.
9 ## The template containing the most basic rules common to all users.
12 ## This template creates a user domain, types, and
13 ## rules for the user's tty and pty.
16 ## <param name="userdomain_prefix">
18 ## The prefix of the user domain (e.g., user
19 ## is the prefix for user_t).
24 template(`userdom_base_user_template',`
28 type user_devpts_t, user_tty_device_t;
29 class context contains;
32 attribute $1_file_type;
33 attribute $1_usertype;
35 type $1_t, userdomain, $1_usertype;
37 corecmd_shell_entry_type($1_t)
38 corecmd_bin_entry_type($1_t)
39 domain_user_exemption_target($1_t)
40 ubac_constrained($1_t)
44 term_user_pty($1_t, user_devpts_t)
46 term_user_tty($1_t, user_tty_device_t)
47 term_dontaudit_getattr_generic_ptys($1_t)
49 allow $1_usertype $1_usertype:process { ptrace signal_perms getsched setsched share getpgid setpgid getcap setcap getsession getattr };
50 allow $1_usertype $1_usertype:fd use;
51 allow $1_usertype $1_t:key { create view read write search link setattr };
53 allow $1_usertype $1_usertype:fifo_file rw_fifo_file_perms;
54 allow $1_usertype $1_usertype:unix_dgram_socket { create_socket_perms sendto };
55 allow $1_usertype $1_usertype:unix_stream_socket { create_stream_socket_perms connectto };
56 allow $1_usertype $1_usertype:shm create_shm_perms;
57 allow $1_usertype $1_usertype:sem create_sem_perms;
58 allow $1_usertype $1_usertype:msgq create_msgq_perms;
59 allow $1_usertype $1_usertype:msg { send receive };
60 allow $1_usertype $1_usertype:context contains;
61 dontaudit $1_usertype $1_usertype:socket create;
63 allow $1_usertype user_devpts_t:chr_file { setattr rw_chr_file_perms };
64 term_create_pty($1_usertype, user_devpts_t)
65 # avoid annoying messages on terminal hangup on role change
66 dontaudit $1_usertype user_devpts_t:chr_file ioctl;
68 allow $1_usertype user_tty_device_t:chr_file { setattr rw_chr_file_perms };
69 # avoid annoying messages on terminal hangup on role change
70 dontaudit $1_usertype user_tty_device_t:chr_file ioctl;
72 application_exec_all($1_usertype)
74 kernel_read_kernel_sysctls($1_usertype)
75 kernel_read_all_sysctls($1_usertype)
76 kernel_dontaudit_list_unlabeled($1_usertype)
77 kernel_dontaudit_getattr_unlabeled_files($1_usertype)
78 kernel_dontaudit_getattr_unlabeled_symlinks($1_usertype)
79 kernel_dontaudit_getattr_unlabeled_pipes($1_usertype)
80 kernel_dontaudit_getattr_unlabeled_sockets($1_usertype)
81 kernel_dontaudit_getattr_unlabeled_blk_files($1_usertype)
82 kernel_dontaudit_getattr_unlabeled_chr_files($1_usertype)
83 kernel_dontaudit_list_proc($1_usertype)
85 dev_dontaudit_getattr_all_blk_files($1_usertype)
86 dev_dontaudit_getattr_all_chr_files($1_usertype)
87 dev_getattr_mtrr_dev($1_t)
89 # When the user domain runs ps, there will be a number of access
90 # denials when ps tries to search /proc. Do not audit these denials.
91 domain_dontaudit_read_all_domains_state($1_usertype)
92 domain_dontaudit_getattr_all_domains($1_usertype)
93 domain_dontaudit_getsession_all_domains($1_usertype)
94 dev_dontaudit_all_access_check($1_usertype)
96 files_read_etc_files($1_usertype)
97 files_list_mnt($1_usertype)
98 files_read_mnt_files($1_usertype)
99 files_dontaudit_access_check_mnt($1_usertype)
100 files_read_etc_runtime_files($1_usertype)
101 files_read_usr_files($1_usertype)
102 files_read_usr_src_files($1_usertype)
103 # Read directories and files with the readable_t type.
104 # This type is a general type for "world"-readable files.
105 files_list_world_readable($1_usertype)
106 files_read_world_readable_files($1_usertype)
107 files_read_world_readable_symlinks($1_usertype)
108 files_read_world_readable_pipes($1_usertype)
109 files_read_world_readable_sockets($1_usertype)
110 # old broswer_domain():
111 files_dontaudit_getattr_all_dirs($1_usertype)
112 files_dontaudit_list_non_security($1_usertype)
113 files_dontaudit_getattr_all_files($1_usertype)
114 files_dontaudit_getattr_non_security_symlinks($1_usertype)
115 files_dontaudit_getattr_non_security_pipes($1_usertype)
116 files_dontaudit_getattr_non_security_sockets($1_usertype)
117 files_dontaudit_setattr_etc_runtime_files($1_usertype)
119 files_exec_usr_files($1_t)
121 fs_list_cgroup_dirs($1_usertype)
122 fs_dontaudit_rw_cgroup_files($1_usertype)
124 storage_rw_fuse($1_usertype)
126 auth_use_nsswitch($1_usertype)
128 init_stream_connect($1_usertype)
129 # The library functions always try to open read-write first,
130 # then fall back to read-only if it fails.
131 init_dontaudit_rw_utmp($1_usertype)
133 libs_exec_ld_so($1_usertype)
135 logging_send_audit_msgs($1_t)
137 miscfiles_read_localization($1_t)
138 miscfiles_read_generic_certs($1_t)
140 miscfiles_read_all_certs($1_usertype)
141 miscfiles_read_localization($1_usertype)
142 miscfiles_read_man_pages($1_usertype)
143 miscfiles_read_public_files($1_usertype)
145 tunable_policy(`allow_execmem',`
146 # Allow loading DSOs that require executable stack.
147 allow $1_t self:process execmem;
150 tunable_policy(`allow_execmem && allow_execstack',`
151 # Allow making the stack executable via mprotect.
152 allow $1_t self:process execstack;
156 fs_list_cgroup_dirs($1_usertype)
160 ssh_rw_stream_sockets($1_usertype)
166 #######################################
168 ## Allow a home directory for which the
169 ## role has read-only access.
173 ## Allow a home directory for which the
174 ## role has read-only access.
177 ## This does not allow execute access.
180 ## <param name="role">
185 ## <param name="userdomain">
192 interface(`userdom_ro_home_role',`
194 type user_home_t, user_home_dir_t;
197 role $1 types { user_home_t user_home_dir_t };
199 ##############################
201 # Domain access to home dir
204 type_member $2 user_home_dir_t:dir user_home_dir_t;
206 # read-only home directory
207 allow $2 user_home_dir_t:dir list_dir_perms;
208 allow $2 user_home_t:dir list_dir_perms;
209 allow $2 user_home_t:file entrypoint;
210 read_files_pattern($2, { user_home_t user_home_dir_t }, user_home_t)
211 read_lnk_files_pattern($2, { user_home_t user_home_dir_t }, user_home_t)
212 read_fifo_files_pattern($2, { user_home_t user_home_dir_t }, user_home_t)
213 read_sock_files_pattern($2, { user_home_t user_home_dir_t }, user_home_t)
218 #######################################
220 ## Allow a home directory for which the
221 ## role has full access.
225 ## Allow a home directory for which the
226 ## role has full access.
229 ## This does not allow execute access.
232 ## <param name="role">
237 ## <param name="userdomain">
244 interface(`userdom_manage_home_role',`
246 type user_home_t, user_home_dir_t;
247 attribute user_home_type;
250 role $1 types { user_home_type user_home_dir_t };
252 ##############################
254 # Domain access to home dir
257 type_member $2 user_home_dir_t:dir user_home_dir_t;
259 # full control of the home directory
260 allow $2 user_home_t:dir mounton;
261 allow $2 user_home_t:file entrypoint;
263 allow $2 user_home_type:dir_file_class_set { relabelto relabelfrom };
264 allow $2 user_home_dir_t:lnk_file read_lnk_file_perms;
265 manage_dirs_pattern($2, { user_home_dir_t user_home_type }, user_home_type)
266 manage_files_pattern($2, { user_home_dir_t user_home_type }, user_home_type)
267 manage_lnk_files_pattern($2, { user_home_dir_t user_home_type }, user_home_type)
268 manage_sock_files_pattern($2, { user_home_dir_t user_home_type }, user_home_type)
269 manage_fifo_files_pattern($2, { user_home_dir_t user_home_type }, user_home_type)
270 relabel_dirs_pattern($2, { user_home_dir_t user_home_type }, user_home_type)
271 relabel_files_pattern($2, { user_home_dir_t user_home_type }, user_home_type)
272 relabel_lnk_files_pattern($2, { user_home_dir_t user_home_type }, user_home_type)
273 relabel_sock_files_pattern($2, { user_home_dir_t user_home_type }, user_home_type)
274 relabel_fifo_files_pattern($2, { user_home_dir_t user_home_type }, user_home_type)
275 filetrans_pattern($2, user_home_dir_t, user_home_t, { dir file lnk_file sock_file fifo_file })
278 # cjp: this should probably be removed:
279 allow $2 user_home_dir_t:dir { manage_dir_perms relabel_dir_perms };
281 tunable_policy(`use_nfs_home_dirs',`
284 fs_manage_nfs_dirs($2)
285 fs_manage_nfs_files($2)
286 fs_manage_nfs_symlinks($2)
287 fs_manage_nfs_named_sockets($2)
288 fs_manage_nfs_named_pipes($2)
291 tunable_policy(`use_samba_home_dirs',`
294 fs_manage_cifs_dirs($2)
295 fs_manage_cifs_files($2)
296 fs_manage_cifs_symlinks($2)
297 fs_manage_cifs_named_sockets($2)
298 fs_manage_cifs_named_pipes($2)
302 #######################################
304 ## Manage user temporary files
306 ## <param name="role">
308 ## Role allowed access.
311 ## <param name="domain">
313 ## Domain allowed access.
318 interface(`userdom_manage_tmp_role',`
323 role $1 types user_tmp_t;
325 files_poly_member_tmp($2, user_tmp_t)
327 manage_dirs_pattern($2, user_tmp_t, user_tmp_t)
328 manage_files_pattern($2, user_tmp_t, user_tmp_t)
329 manage_lnk_files_pattern($2, user_tmp_t, user_tmp_t)
330 manage_sock_files_pattern($2, user_tmp_t, user_tmp_t)
331 manage_fifo_files_pattern($2, user_tmp_t, user_tmp_t)
332 files_tmp_filetrans($2, user_tmp_t, { dir file lnk_file sock_file fifo_file })
333 relabel_files_pattern($2, user_tmp_t, user_tmp_t)
336 #######################################
338 ## Dontaudit search of user bin dirs.
340 ## <param name="domain">
342 ## Domain to not audit.
346 interface(`userdom_dontaudit_search_user_bin_dirs',`
351 dontaudit $1 home_bin_t:dir search_dir_perms;
354 #######################################
356 ## Execute user bin files.
358 ## <param name="domain">
360 ## Domain allowed access.
364 interface(`userdom_exec_user_bin_files',`
366 attribute user_home_type;
367 type home_bin_t, user_home_dir_t;
370 exec_files_pattern($1, { user_home_dir_t user_home_type }, home_bin_t)
371 files_search_home($1)
374 #######################################
376 ## The execute access user temporary files.
378 ## <param name="domain">
380 ## Domain allowed access.
385 interface(`userdom_exec_user_tmp_files',`
390 exec_files_pattern($1, user_tmp_t, user_tmp_t)
391 dontaudit $1 user_tmp_t:sock_file execute;
395 #######################################
397 ## Role access for the user tmpfs type
398 ## that the user has full access.
402 ## Role access for the user tmpfs type
403 ## that the user has full access.
406 ## This does not allow execute access.
409 ## <param name="role">
411 ## Role allowed access.
414 ## <param name="domain">
416 ## Domain allowed access.
421 interface(`userdom_manage_tmpfs_role',`
426 role $1 types user_tmpfs_t;
428 manage_dirs_pattern($2, user_tmpfs_t, user_tmpfs_t)
429 manage_files_pattern($2, user_tmpfs_t, user_tmpfs_t)
430 manage_lnk_files_pattern($2, user_tmpfs_t, user_tmpfs_t)
431 manage_sock_files_pattern($2, user_tmpfs_t, user_tmpfs_t)
432 manage_fifo_files_pattern($2, user_tmpfs_t, user_tmpfs_t)
433 fs_tmpfs_filetrans($2, user_tmpfs_t, { dir file lnk_file sock_file fifo_file })
436 #######################################
438 ## The interface allowing the user basic
439 ## network permissions
441 ## <param name="userdomain">
448 interface(`userdom_basic_networking',`
450 allow $1 self:tcp_socket create_stream_socket_perms;
451 allow $1 self:udp_socket create_socket_perms;
453 corenet_all_recvfrom_unlabeled($1)
454 corenet_all_recvfrom_netlabel($1)
455 corenet_tcp_sendrecv_generic_if($1)
456 corenet_udp_sendrecv_generic_if($1)
457 corenet_tcp_sendrecv_generic_node($1)
458 corenet_udp_sendrecv_generic_node($1)
459 corenet_tcp_sendrecv_all_ports($1)
460 corenet_udp_sendrecv_all_ports($1)
461 corenet_tcp_connect_all_ports($1)
462 corenet_sendrecv_all_client_packets($1)
465 init_tcp_recvfrom_all_daemons($1)
466 init_udp_recvfrom_all_daemons($1)
470 ipsec_match_default_spd($1)
475 #######################################
477 ## The template for creating a user xwindows client. (Deprecated)
479 ## <param name="userdomain_prefix">
481 ## The prefix of the user domain (e.g., user
482 ## is the prefix for user_t).
487 template(`userdom_xwindows_client_template',`
488 refpolicywarn(`$0() has been deprecated, please use xserver_role() instead.')
490 type $1_t, user_tmpfs_t;
493 dev_rw_xserver_misc($1_t)
494 dev_rw_power_management($1_t)
498 # open office is looking for the following
499 dev_getattr_agp_dev($1_t)
500 dev_dontaudit_rw_dri($1_t)
501 # GNOME checks for usb and other devices:
503 dev_rw_generic_usb_dev($1_t)
505 xserver_user_x_domain_template($1, $1_t, user_tmpfs_t)
506 xserver_xsession_entry_type($1_t)
507 xserver_dontaudit_write_log($1_t)
508 xserver_stream_connect_xdm($1_t)
509 # certain apps want to read xdm.pid file
510 xserver_read_xdm_pid($1_t)
511 # gnome-session creates socket under /tmp/.ICE-unix/
512 xserver_create_xdm_tmp_sockets($1_t)
513 # Needed for escd, remove if we get escd policy
514 xserver_manage_xdm_tmp_files($1_t)
517 #######################################
519 ## The template for allowing the user to change passwords.
521 ## <param name="userdomain_prefix">
523 ## The prefix of the user domain (e.g., user
524 ## is the prefix for user_t).
529 template(`userdom_change_password_template',`
536 usermanage_run_chfn($1_t,$1_r)
537 usermanage_run_passwd($1_t,$1_r)
541 #######################################
543 ## The template containing rules common to unprivileged
544 ## users and administrative users.
548 ## This template creates a user domain, types, and
549 ## rules for the user's tty, pty, tmp, and tmpfs files.
552 ## <param name="userdomain_prefix">
554 ## The prefix of the user domain (e.g., user
555 ## is the prefix for user_t).
559 template(`userdom_common_user_template',`
561 attribute unpriv_userdomain;
564 userdom_basic_networking($1_usertype)
566 ##############################
568 # User domain Local policy
571 # evolution and gnome-session try to create a netlink socket
572 dontaudit $1_t self:netlink_socket { create ioctl read getattr write setattr append bind connect getopt setopt shutdown };
573 dontaudit $1_t self:netlink_route_socket { create ioctl read getattr write setattr append bind connect getopt setopt shutdown nlmsg_read nlmsg_write };
574 allow $1_t self:netlink_kobject_uevent_socket create_socket_perms;
575 allow $1_t self:socket create_socket_perms;
577 allow $1_usertype unpriv_userdomain:fd use;
579 kernel_read_system_state($1_usertype)
580 kernel_read_network_state($1_usertype)
581 kernel_read_software_raid_state($1_usertype)
582 kernel_read_net_sysctls($1_usertype)
583 # Very permissive allowing every domain to see every type:
584 kernel_get_sysvipc_info($1_usertype)
585 # Find CDROM devices:
586 kernel_read_device_sysctls($1_usertype)
587 kernel_request_load_module($1_usertype)
589 corenet_udp_bind_generic_node($1_usertype)
590 corenet_udp_bind_generic_port($1_usertype)
592 dev_read_rand($1_usertype)
593 dev_write_sound($1_usertype)
594 dev_read_sound($1_usertype)
595 dev_read_sound_mixer($1_usertype)
596 dev_write_sound_mixer($1_usertype)
598 files_exec_etc_files($1_usertype)
599 files_search_locks($1_usertype)
600 # Check to see if cdrom is mounted
601 files_search_mnt($1_usertype)
602 # cjp: perhaps should cut back on file reads:
603 files_read_var_files($1_usertype)
604 files_read_var_symlinks($1_usertype)
605 files_read_generic_spool($1_usertype)
606 files_read_var_lib_files($1_usertype)
608 files_getattr_lost_found_dirs($1_usertype)
609 files_read_config_files($1_usertype)
610 fs_read_noxattr_fs_files($1_usertype)
611 fs_read_noxattr_fs_symlinks($1_usertype)
612 fs_rw_cgroup_files($1_usertype)
614 application_getattr_socket($1_usertype)
616 logging_send_syslog_msg($1_usertype)
617 logging_send_audit_msgs($1_usertype)
618 selinux_get_enforce_mode($1_usertype)
620 # cjp: some of this probably can be removed
621 selinux_get_fs_mount($1_usertype)
622 selinux_validate_context($1_usertype)
623 selinux_compute_access_vector($1_usertype)
624 selinux_compute_create_context($1_usertype)
625 selinux_compute_relabel_context($1_usertype)
626 selinux_compute_user_contexts($1_usertype)
629 storage_getattr_fixed_disk_dev($1_usertype)
631 auth_read_login_records($1_usertype)
632 auth_run_pam($1_t,$1_r)
633 auth_run_utempter($1_t,$1_r)
635 init_read_utmp($1_usertype)
637 seutil_read_file_contexts($1_usertype)
638 seutil_read_default_contexts($1_usertype)
639 seutil_run_newrole($1_t,$1_r)
640 seutil_exec_checkpolicy($1_t)
641 seutil_exec_setfiles($1_usertype)
642 # for when the network connection is killed
643 # this is needed when a login role can change
645 seutil_dontaudit_signal_newrole($1_t)
647 tunable_policy(`user_direct_mouse',`
648 dev_read_mouse($1_usertype)
651 tunable_policy(`user_ttyfile_stat',`
652 term_getattr_all_ttys($1_t)
656 alsa_read_rw_config($1_usertype)
657 alsa_manage_home_files($1_t)
658 alsa_relabel_home_files($1_t)
662 # Allow graphical boot to check battery lifespan
663 apm_stream_connect($1_usertype)
667 canna_stream_connect($1_usertype)
671 chrome_role($1_r, $1_usertype)
675 colord_read_lib_files($1_usertype)
679 dbus_system_bus_client($1_usertype)
681 allow $1_usertype $1_usertype:dbus send_msg;
684 avahi_dbus_chat($1_usertype)
688 policykit_dbus_chat($1_usertype)
692 bluetooth_dbus_chat($1_usertype)
696 consolekit_dbus_chat($1_usertype)
697 consolekit_read_log($1_usertype)
701 devicekit_dbus_chat($1_usertype)
702 devicekit_dbus_chat_power($1_usertype)
703 devicekit_dbus_chat_disk($1_usertype)
707 evolution_dbus_chat($1_usertype)
708 evolution_alarm_dbus_chat($1_usertype)
712 gnome_dbus_chat_gconfdefault($1_usertype)
716 hal_dbus_chat($1_usertype)
720 kde_dbus_chat_backlighthelper($1_usertype)
724 modemmanager_dbus_chat($1_usertype)
728 networkmanager_dbus_chat($1_usertype)
729 networkmanager_read_lib_files($1_usertype)
733 vpn_dbus_chat($1_usertype)
738 git_session_role($1_r, $1_usertype)
742 inetd_use_fds($1_usertype)
743 inetd_rw_tcp_sockets($1_usertype)
747 inn_read_config($1_usertype)
748 inn_read_news_lib($1_usertype)
749 inn_read_news_spool($1_usertype)
753 lircd_stream_connect($1_usertype)
757 locate_read_lib_files($1_usertype)
760 # for running depmod as part of the kernel packaging process
762 modutils_read_module_config($1_usertype)
766 mta_rw_spool($1_usertype)
767 mta_manage_queue($1_usertype)
768 mta_filetrans_home_content($1_usertype)
772 nsplugin_role($1_r, $1_usertype)
776 tunable_policy(`allow_user_mysql_connect',`
777 mysql_stream_connect($1_t)
782 oident_manage_user_content($1_t)
783 oident_relabel_user_content($1_t)
787 # to allow monitoring of pcmcia status
788 pcmcia_read_pid($1_usertype)
792 pcscd_read_pub_files($1_usertype)
793 pcscd_stream_connect($1_usertype)
797 tunable_policy(`allow_user_postgresql_connect',`
798 postgresql_stream_connect($1_usertype)
799 postgresql_tcp_connect($1_usertype)
804 resmgr_stream_connect($1_usertype)
808 rpc_dontaudit_getattr_exports($1_usertype)
809 rpc_manage_nfs_rw_content($1_usertype)
813 rpcbind_stream_connect($1_usertype)
817 samba_stream_connect_winbind($1_usertype)
821 sandbox_transition($1_usertype, $1_r)
825 seunshare_role_template($1, $1_r, $1_t)
829 slrnpull_search_spool($1_usertype)
834 #######################################
836 ## The template for creating a login user.
840 ## This template creates a user domain, types, and
841 ## rules for the user's tty, pty, home directories,
842 ## tmp, and tmpfs files.
845 ## <param name="userdomain_prefix">
847 ## The prefix of the user domain (e.g., user
848 ## is the prefix for user_t).
852 template(`userdom_login_user_template', `
854 class context contains;
857 userdom_base_user_template($1)
859 userdom_manage_home_role($1_r, $1_usertype)
861 userdom_manage_tmp_role($1_r, $1_usertype)
862 userdom_manage_tmpfs_role($1_r, $1_usertype)
864 ifelse(`$1',`unconfined',`',`
865 gen_tunable(allow_$1_exec_content, true)
867 tunable_policy(`allow_$1_exec_content',`
868 userdom_exec_user_tmp_files($1_usertype)
869 userdom_exec_user_home_content_files($1_usertype)
871 tunable_policy(`allow_$1_exec_content && use_nfs_home_dirs',`
872 fs_exec_nfs_files($1_usertype)
875 tunable_policy(`allow_$1_exec_content && use_samba_home_dirs',`
876 fs_exec_cifs_files($1_usertype)
880 userdom_change_password_template($1)
882 ##############################
884 # User domain Local policy
887 allow $1_t self:capability { setgid chown fowner };
888 dontaudit $1_t self:capability { sys_nice fsetid };
890 allow $1_t self:process ~{ setcurrent setexec setrlimit execmem execstack execheap };
891 dontaudit $1_t self:process setrlimit;
892 dontaudit $1_t self:netlink_route_socket { create ioctl read getattr write setattr append bind connect getopt setopt shutdown nlmsg_read nlmsg_write };
894 allow $1_t self:context contains;
896 kernel_dontaudit_read_system_state($1_usertype)
897 kernel_dontaudit_list_all_proc($1_usertype)
899 dev_read_sysfs($1_usertype)
900 dev_read_urand($1_usertype)
902 domain_use_interactive_fds($1_usertype)
903 # Command completion can fire hundreds of denials
904 domain_dontaudit_exec_all_entry_files($1_usertype)
906 files_dontaudit_list_default($1_usertype)
907 files_dontaudit_read_default_files($1_usertype)
909 files_getattr_lost_found_dirs($1_usertype)
911 fs_get_all_fs_quotas($1_usertype)
912 fs_getattr_all_fs($1_usertype)
913 fs_search_all($1_usertype)
914 fs_list_inotifyfs($1_usertype)
915 fs_rw_anon_inodefs_files($1_usertype)
917 auth_dontaudit_write_login_records($1_t)
920 # Stop warnings about access to /dev/console
921 init_dontaudit_use_fds($1_usertype)
922 init_dontaudit_use_script_fds($1_usertype)
924 libs_exec_lib_files($1_usertype)
926 logging_dontaudit_getattr_all_logs($1_usertype)
928 # for running TeX programs
929 miscfiles_read_tetex_data($1_usertype)
930 miscfiles_exec_tetex_data($1_usertype)
932 seutil_read_config($1_usertype)
935 cups_read_config($1_usertype)
936 cups_stream_connect($1_usertype)
937 cups_stream_connect_ptal($1_usertype)
941 kerberos_use($1_usertype)
942 kerberos_filetrans_home_content($1_usertype)
946 mta_dontaudit_read_spool_symlinks($1_usertype)
950 quota_dontaudit_getattr_db($1_usertype)
954 rpm_read_db($1_usertype)
955 rpm_dontaudit_manage_db($1_usertype)
956 rpm_read_cache($1_usertype)
960 oddjob_run_mkhomedir($1_t, $1_r)
964 #######################################
966 ## The template for creating a unprivileged login user.
970 ## This template creates a user domain, types, and
971 ## rules for the user's tty, pty, home directories,
972 ## tmp, and tmpfs files.
975 ## <param name="userdomain_prefix">
977 ## The prefix of the user domain (e.g., user
978 ## is the prefix for user_t).
982 template(`userdom_restricted_user_template',`
984 attribute unpriv_userdomain;
987 userdom_login_user_template($1)
989 typeattribute $1_t unpriv_userdomain;
990 domain_interactive_fd($1_t)
992 allow $1_usertype self:netlink_kobject_uevent_socket create_socket_perms;
993 dontaudit $1_usertype self:netlink_audit_socket create_socket_perms;
995 ##############################
1001 loadkeys_run($1_t,$1_r)
1005 #######################################
1007 ## The template for creating a unprivileged xwindows login user.
1011 ## The template for creating a unprivileged xwindows login user.
1014 ## This template creates a user domain, types, and
1015 ## rules for the user's tty, pty, home directories,
1016 ## tmp, and tmpfs files.
1019 ## <param name="userdomain_prefix">
1021 ## The prefix of the user domain (e.g., user
1022 ## is the prefix for user_t).
1026 template(`userdom_restricted_xwindows_user_template',`
1028 userdom_restricted_user_template($1)
1030 ##############################
1035 auth_role($1_r, $1_t)
1036 auth_search_pam_console_data($1_usertype)
1037 auth_dontaudit_read_login_records($1_usertype)
1039 dev_read_sound($1_usertype)
1040 dev_write_sound($1_usertype)
1041 # gnome keyring wants to read this.
1042 dev_dontaudit_read_rand($1_usertype)
1043 # temporarily allow since openoffice requires this
1044 dev_read_rand($1_usertype)
1046 dev_read_video_dev($1_usertype)
1047 dev_write_video_dev($1_usertype)
1048 dev_rw_wireless($1_usertype)
1050 libs_dontaudit_setattr_lib_files($1_usertype)
1052 tunable_policy(`user_rw_noexattrfile',`
1054 dev_rw_generic_usb_dev($1_usertype)
1056 fs_manage_noxattr_fs_files($1_usertype)
1057 fs_manage_noxattr_fs_dirs($1_usertype)
1058 fs_manage_dos_dirs($1_usertype)
1059 fs_manage_dos_files($1_usertype)
1060 storage_raw_read_removable_device($1_usertype)
1061 storage_raw_write_removable_device($1_usertype)
1064 logging_send_syslog_msg($1_usertype)
1065 logging_dontaudit_send_audit_msgs($1_t)
1067 # Need to to this just so screensaver will work. Should be moved to screensaver domain
1068 logging_send_audit_msgs($1_t)
1069 selinux_get_enforce_mode($1_t)
1070 seutil_exec_restorecond($1_t)
1071 seutil_read_file_contexts($1_t)
1072 seutil_read_default_contexts($1_t)
1074 xserver_restricted_role($1_r, $1_t)
1077 alsa_read_rw_config($1_usertype)
1080 # cjp: needed by KDE apps
1083 gnome_read_usr_config($1_usertype)
1084 gnome_role_gkeyringd($1, $1_r, $1_t)
1085 # cjp: telepathy F15 bugs
1086 telepathy_dbus_session_role($1_r, $1_t, $1)
1090 dbus_role_template($1, $1_r, $1_usertype)
1091 dbus_system_bus_client($1_usertype)
1092 allow $1_usertype $1_usertype:dbus send_msg;
1095 abrt_dbus_chat($1_usertype)
1096 abrt_run_helper($1_usertype, $1_r)
1100 consolekit_dontaudit_read_log($1_usertype)
1101 consolekit_dbus_chat($1_usertype)
1105 cups_dbus_chat($1_usertype)
1106 cups_dbus_chat_config($1_usertype)
1110 devicekit_dbus_chat($1_usertype)
1111 devicekit_dbus_chat_disk($1_usertype)
1112 devicekit_dbus_chat_power($1_usertype)
1116 fprintd_dbus_chat($1_t)
1121 openoffice_role_template($1, $1_r, $1_usertype)
1125 policykit_role($1_r, $1_usertype)
1129 pulseaudio_role($1_r, $1_usertype)
1133 rtkit_scheduled($1_usertype)
1137 setroubleshoot_dontaudit_stream_connect($1_t)
1141 udev_read_db($1_usertype)
1145 wm_role_template($1, $1_r, $1_t)
1149 #######################################
1151 ## The template for creating a unprivileged user roughly
1152 ## equivalent to a regular linux user.
1156 ## The template for creating a unprivileged user roughly
1157 ## equivalent to a regular linux user.
1160 ## This template creates a user domain, types, and
1161 ## rules for the user's tty, pty, home directories,
1162 ## tmp, and tmpfs files.
1165 ## <param name="userdomain_prefix">
1167 ## The prefix of the user domain (e.g., user
1168 ## is the prefix for user_t).
1172 template(`userdom_unpriv_user_template', `
1174 ##############################
1179 # Inherit rules for ordinary users.
1180 userdom_restricted_xwindows_user_template($1)
1181 userdom_common_user_template($1)
1183 ##############################
1188 # port access is audited even if dac would not have allowed it, so dontaudit it here
1189 # corenet_dontaudit_tcp_bind_all_reserved_ports($1_t)
1190 # Need the following rule to allow users to run vpnc
1191 corenet_tcp_bind_xserver_port($1_t)
1192 corenet_tcp_bind_generic_node($1_usertype)
1194 storage_rw_fuse($1_t)
1196 miscfiles_read_hwdata($1_usertype)
1198 # Allow users to run TCP servers (bind to ports and accept connection from
1199 # the same domain and outside users) disabling this forces FTP passive mode
1200 # and may change other protocols
1202 tunable_policy(`user_share_music',`
1203 corenet_tcp_bind_daap_port($1_usertype)
1206 tunable_policy(`user_tcp_server',`
1207 corenet_tcp_bind_all_unreserved_ports($1_usertype)
1210 tunable_policy(`user_setrlimit',`
1211 allow $1_usertype self:process setrlimit;
1215 cdrecord_role($1_r, $1_t)
1219 cron_role($1_r, $1_t)
1223 games_rw_data($1_usertype)
1227 gpg_role($1_r, $1_usertype)
1231 gnomeclock_dbus_chat($1_t)
1235 gpm_stream_connect($1_usertype)
1239 execmem_role_template($1, $1_r, $1_t)
1243 java_role_template($1, $1_r, $1_t)
1247 mono_role_template($1, $1_r, $1_t)
1251 mount_run_fusermount($1_t, $1_r)
1252 mount_read_pid_files($1_t)
1256 wine_role_template($1, $1_r, $1_t)
1260 postfix_run_postdrop($1_t, $1_r)
1263 # Run pppd in pppd_t by default for user
1265 ppp_run_cond($1_t, $1_r)
1269 #######################################
1271 ## The template for creating an administrative user.
1275 ## This template creates a user domain, types, and
1276 ## rules for the user's tty, pty, home directories,
1277 ## tmp, and tmpfs files.
1280 ## The privileges given to administrative users are:
1282 ## <li>Raw disk access</li>
1283 ## <li>Set all sysctls</li>
1284 ## <li>All kernel ring buffer controls</li>
1285 ## <li>Create, read, write, and delete all files but shadow</li>
1286 ## <li>Manage source and binary format SELinux policy</li>
1287 ## <li>Run insmod</li>
1291 ## <param name="userdomain_prefix">
1293 ## The prefix of the user domain (e.g., sysadm
1294 ## is the prefix for sysadm_t).
1298 template(`userdom_admin_user_template',`
1300 attribute admindomain;
1301 class passwd { passwd chfn chsh rootok crontab };
1304 ##############################
1309 # Inherit rules for ordinary users.
1310 userdom_login_user_template($1)
1311 userdom_common_user_template($1)
1313 domain_obj_id_change_exemption($1_t)
1314 role system_r types $1_t;
1316 typeattribute $1_t admindomain;
1318 ifdef(`direct_sysadm_daemon',`
1319 domain_system_change_exemption($1_t)
1322 ##############################
1327 allow $1_t self:capability ~{ sys_module audit_control audit_write };
1328 allow $1_t self:capability2 syslog;
1329 allow $1_t self:process { setexec setfscreate };
1330 allow $1_t self:netlink_audit_socket nlmsg_readpriv;
1331 allow $1_t self:tun_socket create;
1332 # Set password information for other users.
1333 allow $1_t self:passwd { passwd chfn chsh };
1334 # Skip authentication when pam_rootok is specified.
1335 allow $1_t self:passwd rootok;
1337 # Manipulate other users crontab.
1338 allow $1_t self:passwd crontab;
1340 kernel_read_software_raid_state($1_t)
1341 kernel_getattr_core_if($1_t)
1342 kernel_getattr_message_if($1_t)
1343 kernel_change_ring_buffer_level($1_t)
1344 kernel_clear_ring_buffer($1_t)
1345 kernel_read_ring_buffer($1_t)
1346 kernel_get_sysvipc_info($1_t)
1347 kernel_rw_all_sysctls($1_t)
1348 # signal unlabeled processes:
1349 kernel_kill_unlabeled($1_t)
1350 kernel_signal_unlabeled($1_t)
1351 kernel_sigstop_unlabeled($1_t)
1352 kernel_signull_unlabeled($1_t)
1353 kernel_sigchld_unlabeled($1_t)
1356 corenet_tcp_bind_generic_port($1_t)
1357 # allow setting up tunnels
1358 corenet_rw_tun_tap_dev($1_t)
1360 dev_getattr_generic_blk_files($1_t)
1361 dev_getattr_generic_chr_files($1_t)
1363 dev_getattr_mtrr_dev($1_t)
1364 # Allow MAKEDEV to work
1365 dev_create_all_blk_files($1_t)
1366 dev_create_all_chr_files($1_t)
1367 dev_delete_all_blk_files($1_t)
1368 dev_delete_all_chr_files($1_t)
1369 dev_rename_all_blk_files($1_t)
1370 dev_rename_all_chr_files($1_t)
1371 dev_create_generic_symlinks($1_t)
1372 dev_rw_generic_usb_dev($1_t)
1375 domain_setpriority_all_domains($1_t)
1376 domain_read_all_domains_state($1_t)
1377 domain_getattr_all_domains($1_t)
1378 domain_getcap_all_domains($1_t)
1379 domain_dontaudit_ptrace_all_domains($1_t)
1380 # signal all domains:
1381 domain_kill_all_domains($1_t)
1382 domain_signal_all_domains($1_t)
1383 domain_signull_all_domains($1_t)
1384 domain_sigstop_all_domains($1_t)
1385 domain_sigstop_all_domains($1_t)
1386 domain_sigchld_all_domains($1_t)
1388 domain_getattr_all_sockets($1_t)
1389 domain_dontaudit_getattr_all_sockets($1_t)
1391 files_exec_usr_src_files($1_t)
1393 fs_getattr_all_fs($1_t)
1394 fs_getattr_all_files($1_t)
1396 fs_set_all_quotas($1_t)
1397 fs_exec_noxattr($1_t)
1399 storage_raw_read_removable_device($1_t)
1400 storage_raw_write_removable_device($1_t)
1401 storage_dontaudit_read_fixed_disk($1_t)
1403 term_use_all_inherited_terms($1_t)
1405 auth_getattr_shadow($1_t)
1406 # Manage almost all files
1407 auth_manage_all_files_except_shadow($1_t)
1408 # Relabel almost all files
1409 auth_relabel_all_files_except_shadow($1_t)
1413 logging_send_syslog_msg($1_t)
1416 modutils_domtrans_insmod($1_t)
1417 modutils_domtrans_depmod($1_t)
1420 # The following rule is temporary until such time that a complete
1421 # policy management infrastructure is in place so that an administrator
1422 # cannot directly manipulate policy files with arbitrary programs.
1423 seutil_manage_src_policy($1_t)
1424 # Violates the goal of limiting write access to checkpolicy.
1425 # But presently necessary for installing the file_contexts file.
1426 seutil_manage_bin_policy($1_t)
1428 userdom_manage_user_home_content_dirs($1_t)
1429 userdom_manage_user_home_content_files($1_t)
1430 userdom_manage_user_home_content_symlinks($1_t)
1431 userdom_manage_user_home_content_pipes($1_t)
1432 userdom_manage_user_home_content_sockets($1_t)
1433 userdom_user_home_dir_filetrans_user_home_content($1_t, { dir file lnk_file fifo_file sock_file })
1435 tunable_policy(`user_rw_noexattrfile',`
1436 fs_manage_noxattr_fs_files($1_t)
1437 fs_manage_noxattr_fs_dirs($1_t)
1439 fs_read_noxattr_fs_files($1_t)
1443 postgresql_unconfined($1_t)
1447 userhelper_exec($1_t)
1451 ########################################
1453 ## Allow user to run as a secadm
1457 ## Create objects in a user home directory
1458 ## with an automatic type transition to
1459 ## a specified private type.
1462 ## This is a templated interface, and should only
1463 ## be called from a per-userdomain template.
1466 ## <param name="domain">
1468 ## Domain allowed access.
1471 ## <param name="role">
1473 ## The role of the object to create.
1477 template(`userdom_security_admin_template',`
1478 allow $1 self:capability { dac_read_search dac_override };
1480 corecmd_exec_shell($1)
1482 domain_obj_id_change_exemption($1)
1484 dev_relabel_all_dev_nodes($1)
1486 files_create_boot_flag($1)
1487 files_create_default_dir($1)
1488 files_root_filetrans_default($1, dir)
1490 # Necessary for managing /boot/efi
1491 fs_manage_dos_files($1)
1493 mls_process_read_up($1)
1494 mls_file_read_all_levels($1)
1495 mls_file_upgrade($1)
1496 mls_file_downgrade($1)
1498 selinux_set_enforce_mode($1)
1499 selinux_set_all_booleans($1)
1500 selinux_set_parameters($1)
1501 selinux_read_policy($1)
1503 auth_relabel_all_files_except_shadow($1)
1504 auth_relabel_shadow($1)
1508 logging_send_syslog_msg($1)
1509 logging_read_audit_log($1)
1510 logging_read_generic_logs($1)
1511 logging_read_audit_config($1)
1513 seutil_manage_bin_policy($1)
1514 seutil_manage_default_contexts($1)
1515 seutil_manage_file_contexts($1)
1516 seutil_manage_module_store($1)
1517 seutil_manage_config($1)
1518 seutil_run_checkpolicy($1,$2)
1519 seutil_run_loadpolicy($1,$2)
1520 seutil_run_semanage($1,$2)
1521 seutil_run_setsebool($1,$2)
1522 seutil_run_setfiles($1, $2)
1529 consoletype_exec($1)
1537 ipsec_run_setkey($1,$2)
1541 netlabel_run_mgmt($1,$2)
1549 ########################################
1551 ## Make the specified type usable in a
1552 ## user home directory.
1554 ## <param name="type">
1556 ## Type to be used as a file in the
1557 ## user home directory.
1561 interface(`userdom_user_home_content',`
1564 attribute user_home_type;
1567 allow $1 user_home_t:filesystem associate;
1569 ubac_constrained($1)
1571 files_poly_member($1)
1572 typeattribute $1 user_home_type;
1575 ########################################
1577 ## Make the specified type usable in a
1578 ## generic temporary directory.
1580 ## <param name="type">
1582 ## Type to be used as a file in the
1583 ## generic temporary directory.
1587 interface(`userdom_user_tmp_content',`
1589 attribute user_tmp_type;
1592 typeattribute $1 user_tmp_type;
1595 ubac_constrained($1)
1598 ########################################
1600 ## Allow domain to attach to TUN devices created by administrative users.
1602 ## <param name="domain">
1604 ## Domain allowed access.
1608 interface(`userdom_attach_admin_tun_iface',`
1610 attribute admindomain;
1613 allow $1 admindomain:tun_socket relabelfrom;
1614 allow $1 self:tun_socket relabelto;
1617 ########################################
1619 ## Set the attributes of a user pty.
1621 ## <param name="domain">
1623 ## Domain allowed access.
1627 interface(`userdom_setattr_user_ptys',`
1632 allow $1 user_devpts_t:chr_file setattr_chr_file_perms;
1635 ########################################
1637 ## Create a user pty.
1639 ## <param name="domain">
1641 ## Domain allowed access.
1645 interface(`userdom_create_user_pty',`
1650 term_create_pty($1, user_devpts_t)
1653 ########################################
1655 ## Get the attributes of user home directories.
1657 ## <param name="domain">
1659 ## Domain allowed access.
1663 interface(`userdom_getattr_user_home_dirs',`
1665 type user_home_dir_t;
1668 allow $1 user_home_dir_t:dir getattr_dir_perms;
1669 files_search_home($1)
1672 ########################################
1674 ## Do not audit attempts to get the attributes of user home directories.
1676 ## <param name="domain">
1678 ## Domain to not audit.
1682 interface(`userdom_dontaudit_getattr_user_home_dirs',`
1684 type user_home_dir_t;
1687 dontaudit $1 user_home_dir_t:dir getattr_dir_perms;
1690 ########################################
1692 ## Search user home directories.
1694 ## <param name="domain">
1696 ## Domain allowed access.
1700 interface(`userdom_search_user_home_dirs',`
1702 type user_home_dir_t;
1705 allow $1 user_home_dir_t:dir search_dir_perms;
1706 allow $1 user_home_dir_t:lnk_file read_lnk_file_perms;
1707 files_search_home($1)
1710 ########################################
1712 ## Do not audit attempts to search user home directories.
1716 ## Do not audit attempts to search user home directories.
1717 ## This will supress SELinux denial messages when the specified
1718 ## domain is denied the permission to search these directories.
1721 ## <param name="domain">
1723 ## Domain to not audit.
1726 ## <infoflow type="none"/>
1728 interface(`userdom_dontaudit_search_user_home_dirs',`
1730 type user_home_dir_t;
1733 dontaudit $1 user_home_dir_t:dir search_dir_perms;
1736 ########################################
1738 ## List user home directories.
1740 ## <param name="domain">
1742 ## Domain allowed access.
1746 interface(`userdom_list_user_home_dirs',`
1748 type user_home_dir_t;
1751 allow $1 user_home_dir_t:dir list_dir_perms;
1752 files_search_home($1)
1754 tunable_policy(`use_nfs_home_dirs',`
1758 tunable_policy(`use_samba_home_dirs',`
1763 ########################################
1765 ## Do not audit attempts to list user home subdirectories.
1767 ## <param name="domain">
1769 ## Domain to not audit.
1773 interface(`userdom_dontaudit_list_user_home_dirs',`
1775 type user_home_dir_t;
1779 dontaudit $1 user_home_dir_t:dir list_dir_perms;
1780 dontaudit $1 user_home_t:dir list_dir_perms;
1783 ########################################
1785 ## Create user home directories.
1787 ## <param name="domain">
1789 ## Domain allowed access.
1793 interface(`userdom_create_user_home_dirs',`
1795 type user_home_dir_t;
1798 allow $1 user_home_dir_t:dir create_dir_perms;
1801 ########################################
1803 ## Create user home directories.
1805 ## <param name="domain">
1807 ## Domain allowed access.
1811 interface(`userdom_manage_user_home_dirs',`
1813 type user_home_dir_t;
1816 allow $1 user_home_dir_t:dir manage_dir_perms;
1819 ########################################
1821 ## Relabel to user home directories.
1823 ## <param name="domain">
1825 ## Domain allowed access.
1829 interface(`userdom_relabelto_user_home_dirs',`
1831 type user_home_dir_t;
1834 allow $1 user_home_dir_t:dir relabelto;
1838 ########################################
1840 ## Relabel to user home files.
1842 ## <param name="domain">
1844 ## Domain allowed access.
1848 interface(`userdom_relabelto_user_home_files',`
1853 allow $1 user_home_t:file relabelto;
1855 ########################################
1857 ## Relabel user home files.
1859 ## <param name="domain">
1861 ## Domain allowed access.
1865 interface(`userdom_relabel_user_home_files',`
1870 allow $1 user_home_t:file relabel_file_perms;
1873 ########################################
1875 ## Create directories in the home dir root with
1876 ## the user home directory type.
1878 ## <param name="domain">
1880 ## Domain allowed access.
1884 interface(`userdom_home_filetrans_user_home_dir',`
1886 type user_home_dir_t;
1889 files_home_filetrans($1, user_home_dir_t, dir)
1892 ########################################
1894 ## Do a domain transition to the specified
1895 ## domain when executing a program in the
1896 ## user home directory.
1900 ## Do a domain transition to the specified
1901 ## domain when executing a program in the
1902 ## user home directory.
1905 ## No interprocess communication (signals, pipes,
1906 ## etc.) is provided by this interface since
1907 ## the domains are not owned by this module.
1910 ## <param name="source_domain">
1912 ## Domain allowed to transition.
1915 ## <param name="target_domain">
1917 ## Domain to transition to.
1921 interface(`userdom_user_home_domtrans',`
1923 type user_home_dir_t, user_home_t;
1926 domain_auto_trans($1, user_home_t, $2)
1927 allow $1 user_home_dir_t:dir search_dir_perms;
1928 files_search_home($1)
1931 ########################################
1933 ## Do not audit attempts to search user home content directories.
1935 ## <param name="domain">
1937 ## Domain to not audit.
1941 interface(`userdom_dontaudit_search_user_home_content',`
1946 dontaudit $1 user_home_t:dir search_dir_perms;
1947 fs_dontaudit_list_nfs($1)
1948 fs_dontaudit_list_cifs($1)
1951 ########################################
1953 ## List contents of users home directory.
1955 ## <param name="domain">
1957 ## Domain allowed access.
1961 interface(`userdom_list_user_home_content',`
1963 type user_home_dir_t;
1964 attribute user_home_type;
1968 allow $1 { user_home_dir_t user_home_type }:dir list_dir_perms;
1971 ########################################
1973 ## Create, read, write, and delete directories
1974 ## in a user home subdirectory.
1976 ## <param name="domain">
1978 ## Domain allowed access.
1982 interface(`userdom_manage_user_home_content_dirs',`
1984 type user_home_dir_t, user_home_t;
1987 manage_dirs_pattern($1, { user_home_dir_t user_home_t }, user_home_t)
1988 files_search_home($1)
1991 ########################################
1993 ## Delete directories in a user home subdirectory.
1995 ## <param name="domain">
1997 ## Domain allowed access.
2001 interface(`userdom_delete_user_home_content_dirs',`
2006 allow $1 user_home_t:dir delete_dir_perms;
2009 ########################################
2011 ## Set the attributes of user home files.
2013 ## <param name="domain">
2015 ## Domain allowed access.
2020 interface(`userdom_setattr_user_home_content_files',`
2025 allow $1 user_home_t:file setattr;
2028 ########################################
2030 ## Do not audit attempts to set the
2031 ## attributes of user home files.
2033 ## <param name="domain">
2035 ## Domain to not audit.
2039 interface(`userdom_dontaudit_setattr_user_home_content_files',`
2044 dontaudit $1 user_home_t:file setattr_file_perms;
2047 ########################################
2049 ## Mmap user home files.
2051 ## <param name="domain">
2053 ## Domain allowed access.
2057 interface(`userdom_mmap_user_home_content_files',`
2059 type user_home_dir_t, user_home_t;
2062 mmap_files_pattern($1, { user_home_dir_t user_home_t }, user_home_t)
2063 files_search_home($1)
2066 ########################################
2068 ## Read user home files.
2070 ## <param name="domain">
2072 ## Domain allowed access.
2076 interface(`userdom_read_user_home_content_files',`
2078 type user_home_dir_t, user_home_t;
2081 list_dirs_pattern($1, { user_home_dir_t user_home_t }, { user_home_dir_t user_home_t })
2082 read_files_pattern($1, { user_home_dir_t user_home_t }, user_home_t)
2083 files_search_home($1)
2086 ########################################
2088 ## Do not audit attempts to getattr user home files.
2090 ## <param name="domain">
2092 ## Domain to not audit.
2096 interface(`userdom_dontaudit_getattr_user_home_content',`
2098 attribute user_home_type;
2101 dontaudit $1 user_home_type:dir getattr;
2102 dontaudit $1 user_home_type:file getattr;
2105 ########################################
2107 ## Do not audit attempts to read user home files.
2109 ## <param name="domain">
2111 ## Domain to not audit.
2115 interface(`userdom_dontaudit_read_user_home_content_files',`
2117 attribute user_home_type;
2118 type user_home_dir_t;
2121 dontaudit $1 user_home_dir_t:dir list_dir_perms;
2122 dontaudit $1 user_home_type:dir list_dir_perms;
2123 dontaudit $1 user_home_type:file read_file_perms;
2124 dontaudit $1 user_home_type:lnk_file read_lnk_file_perms;
2127 ########################################
2129 ## Do not audit attempts to append user home files.
2131 ## <param name="domain">
2133 ## Domain to not audit.
2137 interface(`userdom_dontaudit_append_user_home_content_files',`
2142 dontaudit $1 user_home_t:file append_file_perms;
2145 ########################################
2147 ## Do not audit attempts to write user home files.
2149 ## <param name="domain">
2151 ## Domain to not audit.
2155 interface(`userdom_dontaudit_write_user_home_content_files',`
2160 dontaudit $1 user_home_t:file write_file_perms;
2163 ########################################
2165 ## Delete files in a user home subdirectory.
2167 ## <param name="domain">
2169 ## Domain allowed access.
2173 interface(`userdom_delete_user_home_content_files',`
2178 allow $1 user_home_t:file delete_file_perms;
2181 ########################################
2183 ## Delete sock files in a user home subdirectory.
2185 ## <param name="domain">
2187 ## Domain allowed access.
2191 interface(`userdom_delete_user_home_content_sock_files',`
2196 allow $1 user_home_t:sock_file delete_file_perms;
2199 ########################################
2201 ## Do not audit attempts to write user home files.
2203 ## <param name="domain">
2205 ## Domain to not audit.
2209 interface(`userdom_dontaudit_relabel_user_home_content_files',`
2214 dontaudit $1 user_home_t:file relabel_file_perms;
2217 ########################################
2219 ## Read user home subdirectory symbolic links.
2221 ## <param name="domain">
2223 ## Domain allowed access.
2227 interface(`userdom_read_user_home_content_symlinks',`
2229 type user_home_dir_t, user_home_t;
2232 allow $1 { user_home_dir_t user_home_t }:lnk_file read_lnk_file_perms;
2235 ########################################
2237 ## Execute user home files.
2239 ## <param name="domain">
2241 ## Domain allowed access.
2246 interface(`userdom_exec_user_home_content_files',`
2248 type user_home_dir_t;
2249 attribute user_home_type;
2252 files_search_home($1)
2253 exec_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
2254 dontaudit $1 user_home_type:sock_file execute;
2257 ########################################
2259 ## Do not audit attempts to execute user home files.
2261 ## <param name="domain">
2263 ## Domain to not audit.
2267 interface(`userdom_dontaudit_exec_user_home_content_files',`
2272 dontaudit $1 user_home_t:file exec_file_perms;
2275 ########################################
2277 ## Create, read, write, and delete files
2278 ## in a user home subdirectory.
2280 ## <param name="domain">
2282 ## Domain allowed access.
2286 interface(`userdom_manage_user_home_content_files',`
2288 type user_home_dir_t, user_home_t;
2291 manage_files_pattern($1, user_home_t, user_home_t)
2292 allow $1 user_home_dir_t:dir search_dir_perms;
2293 files_search_home($1)
2296 ########################################
2298 ## Do not audit attempts to create, read, write, and delete directories
2299 ## in a user home subdirectory.
2301 ## <param name="domain">
2303 ## Domain to not audit.
2307 interface(`userdom_dontaudit_manage_user_home_content_dirs',`
2309 type user_home_dir_t, user_home_t;
2312 dontaudit $1 user_home_t:dir manage_dir_perms;
2315 ########################################
2317 ## Create, read, write, and delete symbolic links
2318 ## in a user home subdirectory.
2320 ## <param name="domain">
2322 ## Domain allowed access.
2326 interface(`userdom_manage_user_home_content_symlinks',`
2328 type user_home_dir_t, user_home_t;
2331 manage_lnk_files_pattern($1, user_home_t, user_home_t)
2332 allow $1 user_home_dir_t:dir search_dir_perms;
2333 files_search_home($1)
2336 ########################################
2338 ## Delete symbolic links in a user home directory.
2340 ## <param name="domain">
2342 ## Domain allowed access.
2346 interface(`userdom_delete_user_home_content_symlinks',`
2351 allow $1 user_home_t:lnk_file delete_lnk_file_perms;
2354 ########################################
2356 ## Create, read, write, and delete named pipes
2357 ## in a user home subdirectory.
2359 ## <param name="domain">
2361 ## Domain allowed access.
2365 interface(`userdom_manage_user_home_content_pipes',`
2367 type user_home_dir_t, user_home_t;
2370 manage_fifo_files_pattern($1, user_home_t, user_home_t)
2371 allow $1 user_home_dir_t:dir search_dir_perms;
2372 files_search_home($1)
2375 ########################################
2377 ## Create, read, write, and delete named sockets
2378 ## in a user home subdirectory.
2380 ## <param name="domain">
2382 ## Domain allowed access.
2386 interface(`userdom_manage_user_home_content_sockets',`
2388 type user_home_dir_t, user_home_t;
2391 allow $1 user_home_dir_t:dir search_dir_perms;
2392 manage_sock_files_pattern($1, user_home_t, user_home_t)
2393 files_search_home($1)
2396 ########################################
2398 ## Create objects in a user home directory
2399 ## with an automatic type transition to
2400 ## a specified private type.
2402 ## <param name="domain">
2404 ## Domain allowed access.
2407 ## <param name="private_type">
2409 ## The type of the object to create.
2412 ## <param name="object_class">
2414 ## The class of the object to be created.
2418 interface(`userdom_user_home_dir_filetrans',`
2420 type user_home_dir_t;
2423 filetrans_pattern($1, user_home_dir_t, $2, $3, $4)
2424 files_search_home($1)
2427 ########################################
2429 ## Create objects in a user home directory
2430 ## with an automatic type transition to
2431 ## a specified private type.
2433 ## <param name="domain">
2435 ## Domain allowed access.
2438 ## <param name="private_type">
2440 ## The type of the object to create.
2443 ## <param name="object_class">
2445 ## The class of the object to be created.
2449 interface(`userdom_user_home_content_filetrans',`
2451 type user_home_dir_t, user_home_t;
2454 filetrans_pattern($1, user_home_t, $2, $3)
2455 allow $1 user_home_dir_t:dir search_dir_perms;
2456 files_search_home($1)
2459 ########################################
2461 ## Create objects in a user home directory
2462 ## with an automatic type transition to
2463 ## the user home file type.
2465 ## <param name="domain">
2467 ## Domain allowed access.
2470 ## <param name="object_class">
2472 ## The class of the object to be created.
2476 interface(`userdom_user_home_dir_filetrans_user_home_content',`
2478 type user_home_dir_t, user_home_t;
2481 filetrans_pattern($1, user_home_dir_t, user_home_t, $2)
2482 files_search_home($1)
2485 ########################################
2487 ## Write to user temporary named sockets.
2489 ## <param name="domain">
2491 ## Domain allowed access.
2495 interface(`userdom_write_user_tmp_sockets',`
2500 allow $1 user_tmp_t:sock_file write_sock_file_perms;
2501 files_search_tmp($1)
2504 ########################################
2506 ## List user temporary directories.
2508 ## <param name="domain">
2510 ## Domain allowed access.
2514 interface(`userdom_list_user_tmp',`
2519 allow $1 user_tmp_t:dir list_dir_perms;
2520 files_search_tmp($1)
2523 ########################################
2525 ## Do not audit attempts to list user
2526 ## temporary directories.
2528 ## <param name="domain">
2530 ## Domain to not audit.
2534 interface(`userdom_dontaudit_list_user_tmp',`
2539 dontaudit $1 user_tmp_t:dir list_dir_perms;
2542 ########################################
2544 ## Do not audit attempts to manage users
2545 ## temporary directories.
2547 ## <param name="domain">
2549 ## Domain to not audit.
2553 interface(`userdom_dontaudit_manage_user_tmp_dirs',`
2558 dontaudit $1 user_tmp_t:dir manage_dir_perms;
2561 ########################################
2563 ## Read user temporary files.
2565 ## <param name="domain">
2567 ## Domain allowed access.
2571 interface(`userdom_read_user_tmp_files',`
2576 read_files_pattern($1, user_tmp_t, user_tmp_t)
2577 allow $1 user_tmp_t:dir list_dir_perms;
2578 files_search_tmp($1)
2581 ########################################
2583 ## Do not audit attempts to read users
2586 ## <param name="domain">
2588 ## Domain to not audit.
2592 interface(`userdom_dontaudit_read_user_tmp_files',`
2597 dontaudit $1 user_tmp_t:file read_inherited_file_perms;
2600 ########################################
2602 ## Do not audit attempts to append users
2605 ## <param name="domain">
2607 ## Domain to not audit.
2611 interface(`userdom_dontaudit_append_user_tmp_files',`
2616 dontaudit $1 user_tmp_t:file append_file_perms;
2619 ########################################
2621 ## Read and write user temporary files.
2623 ## <param name="domain">
2625 ## Domain allowed access.
2629 interface(`userdom_rw_user_tmp_files',`
2634 allow $1 user_tmp_t:dir list_dir_perms;
2635 rw_files_pattern($1, user_tmp_t, user_tmp_t)
2636 files_search_tmp($1)
2639 ########################################
2641 ## Do not audit attempts to manage users
2644 ## <param name="domain">
2646 ## Domain to not audit.
2650 interface(`userdom_dontaudit_manage_user_tmp_files',`
2655 dontaudit $1 user_tmp_t:file manage_file_perms;
2658 ########################################
2660 ## Read user temporary symbolic links.
2662 ## <param name="domain">
2664 ## Domain allowed access.
2668 interface(`userdom_read_user_tmp_symlinks',`
2673 read_lnk_files_pattern($1, user_tmp_t, user_tmp_t)
2674 allow $1 user_tmp_t:dir list_dir_perms;
2675 files_search_tmp($1)
2678 ########################################
2680 ## Create, read, write, and delete user
2681 ## temporary directories.
2683 ## <param name="domain">
2685 ## Domain allowed access.
2689 interface(`userdom_manage_user_tmp_dirs',`
2694 manage_dirs_pattern($1, user_tmp_t, user_tmp_t)
2695 files_search_tmp($1)
2698 ########################################
2700 ## Create, read, write, and delete user
2703 ## <param name="domain">
2705 ## Domain allowed access.
2709 interface(`userdom_manage_user_tmp_files',`
2714 manage_files_pattern($1, user_tmp_t, user_tmp_t)
2715 files_search_tmp($1)
2718 ########################################
2720 ## Create, read, write, and delete user
2721 ## temporary symbolic links.
2723 ## <param name="domain">
2725 ## Domain allowed access.
2729 interface(`userdom_manage_user_tmp_symlinks',`
2734 manage_lnk_files_pattern($1, user_tmp_t, user_tmp_t)
2735 files_search_tmp($1)
2738 ########################################
2740 ## Create, read, write, and delete user
2741 ## temporary named pipes.
2743 ## <param name="domain">
2745 ## Domain allowed access.
2749 interface(`userdom_manage_user_tmp_pipes',`
2754 manage_fifo_files_pattern($1, user_tmp_t, user_tmp_t)
2755 files_search_tmp($1)
2758 ########################################
2760 ## Create, read, write, and delete user
2761 ## temporary named sockets.
2763 ## <param name="domain">
2765 ## Domain allowed access.
2769 interface(`userdom_manage_user_tmp_sockets',`
2774 manage_sock_files_pattern($1, user_tmp_t, user_tmp_t)
2775 files_search_tmp($1)
2778 ########################################
2780 ## Create objects in a user temporary directory
2781 ## with an automatic type transition to
2782 ## a specified private type.
2784 ## <param name="domain">
2786 ## Domain allowed access.
2789 ## <param name="private_type">
2791 ## The type of the object to create.
2794 ## <param name="object_class">
2796 ## The class of the object to be created.
2800 interface(`userdom_user_tmp_filetrans',`
2805 filetrans_pattern($1, user_tmp_t, $2, $3)
2806 files_search_tmp($1)
2809 ########################################
2811 ## Create objects in the temporary directory
2812 ## with an automatic type transition to
2813 ## the user temporary type.
2815 ## <param name="domain">
2817 ## Domain allowed access.
2820 ## <param name="object_class">
2822 ## The class of the object to be created.
2826 interface(`userdom_tmp_filetrans_user_tmp',`
2831 files_tmp_filetrans($1, user_tmp_t, $2)
2834 ########################################
2836 ## Read user tmpfs files.
2838 ## <param name="domain">
2840 ## Domain allowed access.
2844 interface(`userdom_read_user_tmpfs_files',`
2849 read_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
2850 read_lnk_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
2851 allow $1 user_tmpfs_t:dir list_dir_perms;
2855 ########################################
2857 ## Read/Write user tmpfs files.
2859 ## <param name="domain">
2861 ## Domain allowed access.
2865 interface(`userdom_rw_user_tmpfs_files',`
2870 rw_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
2871 read_lnk_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
2872 allow $1 user_tmpfs_t:dir list_dir_perms;
2876 ########################################
2878 ## Get the attributes of a user domain tty.
2880 ## <param name="domain">
2882 ## Domain allowed access.
2886 interface(`userdom_getattr_user_ttys',`
2888 type user_tty_device_t;
2891 allow $1 user_tty_device_t:chr_file getattr_chr_file_perms;
2894 ########################################
2896 ## Do not audit attempts to get the attributes of a user domain tty.
2898 ## <param name="domain">
2900 ## Domain to not audit.
2904 interface(`userdom_dontaudit_getattr_user_ttys',`
2906 type user_tty_device_t;
2909 dontaudit $1 user_tty_device_t:chr_file getattr_chr_file_perms;
2912 ########################################
2914 ## Set the attributes of a user domain tty.
2916 ## <param name="domain">
2918 ## Domain allowed access.
2922 interface(`userdom_setattr_user_ttys',`
2924 type user_tty_device_t;
2927 allow $1 user_tty_device_t:chr_file setattr_chr_file_perms;
2930 ########################################
2932 ## Do not audit attempts to set the attributes of a user domain tty.
2934 ## <param name="domain">
2936 ## Domain to not audit.
2940 interface(`userdom_dontaudit_setattr_user_ttys',`
2942 type user_tty_device_t;
2945 dontaudit $1 user_tty_device_t:chr_file setattr_chr_file_perms;
2948 ########################################
2950 ## Read and write a user domain tty.
2952 ## <param name="domain">
2954 ## Domain allowed access.
2958 interface(`userdom_use_user_ttys',`
2960 type user_tty_device_t;
2963 allow $1 user_tty_device_t:chr_file rw_term_perms;
2966 ########################################
2968 ## Read and write a inherited user domain tty.
2970 ## <param name="domain">
2972 ## Domain allowed access.
2976 interface(`userdom_use_inherited_user_ttys',`
2978 type user_tty_device_t;
2981 allow $1 user_tty_device_t:chr_file rw_inherited_term_perms;
2984 ########################################
2986 ## Read and write a user domain pty.
2988 ## <param name="domain">
2990 ## Domain allowed access.
2994 interface(`userdom_use_user_ptys',`
2999 allow $1 user_devpts_t:chr_file rw_term_perms;
3002 ########################################
3004 ## Read and write a inherited user domain pty.
3006 ## <param name="domain">
3008 ## Domain allowed access.
3012 interface(`userdom_use_inherited_user_ptys',`
3017 allow $1 user_devpts_t:chr_file rw_inherited_term_perms;
3020 ########################################
3022 ## Read and write a inherited user TTYs and PTYs.
3026 ## Allow the specified domain to read and write inherited user
3027 ## TTYs and PTYs. This will allow the domain to
3028 ## interact with the user via the terminal. Typically
3029 ## all interactive applications will require this
3033 ## <param name="domain">
3035 ## Domain allowed access.
3038 ## <infoflow type="both" weight="10"/>
3040 interface(`userdom_use_inherited_user_terminals',`
3042 type user_tty_device_t, user_devpts_t;
3045 allow $1 user_tty_device_t:chr_file rw_inherited_term_perms;
3046 allow $1 user_devpts_t:chr_file rw_inherited_term_perms;
3049 #######################################
3051 ## Allow attempts to read and write
3052 ## a user domain tty and pty.
3054 ## <param name="domain">
3056 ## Domain to not audit.
3060 interface(`userdom_use_user_terminals',`
3062 type user_tty_device_t, user_devpts_t;
3065 allow $1 user_tty_device_t:chr_file rw_term_perms;
3066 allow $1 user_devpts_t:chr_file rw_term_perms;
3069 ########################################
3071 ## Do not audit attempts to read and write
3072 ## a user domain tty and pty.
3074 ## <param name="domain">
3076 ## Domain to not audit.
3080 interface(`userdom_dontaudit_use_user_terminals',`
3082 type user_tty_device_t, user_devpts_t;
3085 dontaudit $1 user_tty_device_t:chr_file rw_term_perms;
3086 dontaudit $1 user_devpts_t:chr_file rw_term_perms;
3089 ########################################
3091 ## Execute a shell in all user domains. This
3092 ## is an explicit transition, requiring the
3093 ## caller to use setexeccon().
3095 ## <param name="domain">
3097 ## Domain allowed to transition.
3101 interface(`userdom_spec_domtrans_all_users',`
3103 attribute userdomain;
3106 corecmd_shell_spec_domtrans($1, userdomain)
3107 allow userdomain $1:fd use;
3108 allow userdomain $1:fifo_file rw_file_perms;
3109 allow userdomain $1:process sigchld;
3112 ########################################
3114 ## Execute an Xserver session in all unprivileged user domains. This
3115 ## is an explicit transition, requiring the
3116 ## caller to use setexeccon().
3118 ## <param name="domain">
3120 ## Domain allowed to transition.
3124 interface(`userdom_xsession_spec_domtrans_all_users',`
3126 attribute userdomain;
3129 xserver_xsession_spec_domtrans($1, userdomain)
3130 allow userdomain $1:fd use;
3131 allow userdomain $1:fifo_file rw_file_perms;
3132 allow userdomain $1:process sigchld;
3135 ########################################
3137 ## Execute a shell in all unprivileged user domains. This
3138 ## is an explicit transition, requiring the
3139 ## caller to use setexeccon().
3141 ## <param name="domain">
3143 ## Domain allowed to transition.
3147 interface(`userdom_spec_domtrans_unpriv_users',`
3149 attribute unpriv_userdomain;
3152 corecmd_shell_spec_domtrans($1, unpriv_userdomain)
3153 allow unpriv_userdomain $1:fd use;
3154 allow unpriv_userdomain $1:fifo_file rw_file_perms;
3155 allow unpriv_userdomain $1:process sigchld;
3158 ########################################
3160 ## Execute an Xserver session in all unprivileged user domains. This
3161 ## is an explicit transition, requiring the
3162 ## caller to use setexeccon().
3164 ## <param name="domain">
3166 ## Domain allowed to transition.
3170 interface(`userdom_xsession_spec_domtrans_unpriv_users',`
3172 attribute unpriv_userdomain;
3175 xserver_xsession_spec_domtrans($1, unpriv_userdomain)
3176 allow unpriv_userdomain $1:fd use;
3177 allow unpriv_userdomain $1:fifo_file rw_file_perms;
3178 allow unpriv_userdomain $1:process sigchld;
3181 ########################################
3183 ## Manage unpriviledged user SysV sempaphores.
3185 ## <param name="domain">
3187 ## Domain allowed access.
3191 interface(`userdom_manage_unpriv_user_semaphores',`
3193 attribute unpriv_userdomain;
3196 allow $1 unpriv_userdomain:sem create_sem_perms;
3199 ########################################
3201 ## Manage unpriviledged user SysV shared
3204 ## <param name="domain">
3206 ## Domain allowed access.
3210 interface(`userdom_manage_unpriv_user_shared_mem',`
3212 attribute unpriv_userdomain;
3215 allow $1 unpriv_userdomain:shm create_shm_perms;
3218 ########################################
3220 ## Execute bin_t in the unprivileged user domains. This
3221 ## is an explicit transition, requiring the
3222 ## caller to use setexeccon().
3224 ## <param name="domain">
3226 ## Domain allowed to transition.
3230 interface(`userdom_bin_spec_domtrans_unpriv_users',`
3232 attribute unpriv_userdomain;
3235 corecmd_bin_spec_domtrans($1, unpriv_userdomain)
3236 allow unpriv_userdomain $1:fd use;
3237 allow unpriv_userdomain $1:fifo_file rw_file_perms;
3238 allow unpriv_userdomain $1:process sigchld;
3241 ########################################
3243 ## Execute all entrypoint files in unprivileged user
3244 ## domains. This is an explicit transition, requiring the
3245 ## caller to use setexeccon().
3247 ## <param name="domain">
3249 ## Domain allowed access.
3253 interface(`userdom_entry_spec_domtrans_unpriv_users',`
3255 attribute unpriv_userdomain;
3258 domain_entry_file_spec_domtrans($1, unpriv_userdomain)
3259 allow unpriv_userdomain $1:fd use;
3260 allow unpriv_userdomain $1:fifo_file rw_fifo_file_perms;
3261 allow unpriv_userdomain $1:process sigchld;
3264 ########################################
3266 ## Search users home directories.
3268 ## <param name="domain">
3270 ## Domain allowed access.
3274 interface(`userdom_search_user_home_content',`
3276 type user_home_dir_t;
3277 attribute user_home_type;
3281 allow $1 { user_home_dir_t user_home_type }:dir search_dir_perms;
3282 allow $1 { user_home_dir_t user_home_type }:lnk_file read_lnk_file_perms;
3285 ########################################
3287 ## Send general signals to unprivileged user domains.
3289 ## <param name="domain">
3291 ## Domain allowed access.
3295 interface(`userdom_signal_unpriv_users',`
3297 attribute unpriv_userdomain;
3300 allow $1 unpriv_userdomain:process signal;
3303 ########################################
3305 ## Inherit the file descriptors from unprivileged user domains.
3307 ## <param name="domain">
3309 ## Domain allowed access.
3313 interface(`userdom_use_unpriv_users_fds',`
3315 attribute unpriv_userdomain;
3318 allow $1 unpriv_userdomain:fd use;
3321 ########################################
3323 ## Do not audit attempts to inherit the file descriptors
3324 ## from unprivileged user domains.
3328 ## Do not audit attempts to inherit the file descriptors
3329 ## from unprivileged user domains. This will supress
3330 ## SELinux denial messages when the specified domain is denied
3331 ## the permission to inherit these file descriptors.
3334 ## <param name="domain">
3336 ## Domain to not audit.
3339 ## <infoflow type="none"/>
3341 interface(`userdom_dontaudit_use_unpriv_user_fds',`
3343 attribute unpriv_userdomain;
3346 dontaudit $1 unpriv_userdomain:fd use;
3349 ########################################
3351 ## Do not audit attempts to use user ptys.
3353 ## <param name="domain">
3355 ## Domain to not audit.
3359 interface(`userdom_dontaudit_use_user_ptys',`
3364 dontaudit $1 user_devpts_t:chr_file rw_inherited_file_perms;
3367 ########################################
3369 ## Relabel files to unprivileged user pty types.
3371 ## <param name="domain">
3373 ## Domain allowed access.
3377 interface(`userdom_relabelto_user_ptys',`
3382 allow $1 user_devpts_t:chr_file relabelto;
3385 ########################################
3387 ## Do not audit attempts to relabel files from
3390 ## <param name="domain">
3392 ## Domain to not audit.
3396 interface(`userdom_dontaudit_relabelfrom_user_ptys',`
3401 dontaudit $1 user_devpts_t:chr_file relabelfrom;
3404 ########################################
3406 ## Write all users files in /tmp
3408 ## <param name="domain">
3410 ## Domain allowed access.
3414 interface(`userdom_write_user_tmp_files',`
3419 write_files_pattern($1, user_tmp_t, user_tmp_t)
3422 ########################################
3424 ## Do not audit attempts to write users
3427 ## <param name="domain">
3429 ## Domain to not audit.
3433 interface(`userdom_dontaudit_write_user_tmp_files',`
3438 dontaudit $1 user_tmp_t:file write;
3441 ########################################
3443 ## Do not audit attempts to read/write users
3444 ## temporary fifo files.
3446 ## <param name="domain">
3448 ## Domain to not audit.
3452 interface(`userdom_dontaudit_rw_user_tmp_pipes',`
3457 dontaudit $1 user_tmp_t:fifo_file rw_inherited_fifo_file_perms;
3460 ########################################
3462 ## Do not audit attempts to use user ttys.
3464 ## <param name="domain">
3466 ## Domain to not audit.
3470 interface(`userdom_dontaudit_use_user_ttys',`
3472 type user_tty_device_t;
3475 dontaudit $1 user_tty_device_t:chr_file rw_file_perms;
3478 ########################################
3480 ## Read the process state of all user domains.
3482 ## <param name="domain">
3484 ## Domain allowed access.
3488 interface(`userdom_read_all_users_state',`
3490 attribute userdomain;
3493 read_files_pattern($1, userdomain, userdomain)
3494 read_lnk_files_pattern($1,userdomain,userdomain)
3495 kernel_search_proc($1)
3498 ########################################
3500 ## Get the attributes of all user domains.
3502 ## <param name="domain">
3504 ## Domain allowed access.
3508 interface(`userdom_getattr_all_users',`
3510 attribute userdomain;
3513 allow $1 userdomain:process getattr;
3516 ########################################
3518 ## Inherit the file descriptors from all user domains
3520 ## <param name="domain">
3522 ## Domain allowed access.
3526 interface(`userdom_use_all_users_fds',`
3528 attribute userdomain;
3531 allow $1 userdomain:fd use;
3534 ########################################
3536 ## Do not audit attempts to inherit the file
3537 ## descriptors from any user domains.
3539 ## <param name="domain">
3541 ## Domain to not audit.
3545 interface(`userdom_dontaudit_use_all_users_fds',`
3547 attribute userdomain;
3550 dontaudit $1 userdomain:fd use;
3553 ########################################
3555 ## Send general signals to all user domains.
3557 ## <param name="domain">
3559 ## Domain allowed access.
3563 interface(`userdom_signal_all_users',`
3565 attribute userdomain;
3568 allow $1 userdomain:process signal;
3571 ########################################
3573 ## Send kill signals to all user domains.
3575 ## <param name="domain">
3577 ## Domain allowed access.
3581 interface(`userdom_kill_all_users',`
3583 attribute userdomain;
3586 allow $1 userdomain:process sigkill;
3589 ########################################
3591 ## Send a SIGCHLD signal to all user domains.
3593 ## <param name="domain">
3595 ## Domain allowed access.
3599 interface(`userdom_sigchld_all_users',`
3601 attribute userdomain;
3604 allow $1 userdomain:process sigchld;
3607 ########################################
3609 ## Create keys for all user domains.
3611 ## <param name="domain">
3613 ## Domain allowed access.
3617 interface(`userdom_create_all_users_keys',`
3619 attribute userdomain;
3622 allow $1 userdomain:key create;
3625 ########################################
3627 ## Send a dbus message to all user domains.
3629 ## <param name="domain">
3631 ## Domain allowed access.
3635 interface(`userdom_dbus_send_all_users',`
3637 attribute userdomain;
3638 class dbus send_msg;
3641 allow $1 userdomain:dbus send_msg;
3644 ########################################
3646 ## Allow apps to set rlimits on userdomain
3648 ## <param name="domain">
3650 ## Domain allowed access.
3654 interface(`userdom_set_rlimitnh',`
3656 attribute userdomain;
3659 allow $1 userdomain:process rlimitinh;
3662 ########################################
3664 ## Define this type as a Allow apps to set rlimits on userdomain
3666 ## <param name="domain">
3668 ## Domain allowed access.
3671 ## <param name="userdomain_prefix">
3673 ## The prefix of the user domain (e.g., user
3674 ## is the prefix for user_t).
3677 ## <param name="domain">
3679 ## Domain allowed access.
3683 template(`userdom_unpriv_usertype',`
3685 attribute unpriv_userdomain, userdomain;
3686 attribute $1_usertype;
3688 typeattribute $2 $1_usertype;
3689 typeattribute $2 unpriv_userdomain;
3690 typeattribute $2 userdomain;
3692 ubac_constrained($2)
3695 ########################################
3697 ## Connect to users over an unix stream socket.
3699 ## <param name="domain">
3701 ## Domain allowed access.
3705 interface(`userdom_stream_connect',`
3708 attribute userdomain;
3711 stream_connect_pattern($1, user_tmp_t, user_tmp_t, userdomain)
3714 ########################################
3716 ## Ptrace user domains.
3718 ## <param name="domain">
3720 ## Domain allowed access.
3724 interface(`userdom_ptrace_all_users',`
3726 attribute userdomain;
3729 allow $1 userdomain:process ptrace;
3732 ########################################
3734 ## dontaudit Search /root
3736 ## <param name="domain">
3738 ## Domain to not audit.
3742 interface(`userdom_dontaudit_search_admin_dir',`
3747 dontaudit $1 admin_home_t:dir search_dir_perms;
3750 ########################################
3752 ## dontaudit list /root
3754 ## <param name="domain">
3756 ## Domain to not audit.
3760 interface(`userdom_dontaudit_list_admin_dir',`
3765 dontaudit $1 admin_home_t:dir list_dir_perms;
3768 ########################################
3770 ## Allow domain to list /root
3772 ## <param name="domain">
3774 ## Domain allowed access.
3778 interface(`userdom_list_admin_dir',`
3783 allow $1 admin_home_t:dir list_dir_perms;
3786 ########################################
3788 ## Allow Search /root
3790 ## <param name="domain">
3792 ## Domain allowed access.
3796 interface(`userdom_search_admin_dir',`
3801 allow $1 admin_home_t:dir search_dir_perms;
3804 ########################################
3806 ## RW unpriviledged user SysV sempaphores.
3808 ## <param name="domain">
3810 ## Domain allowed access.
3814 interface(`userdom_rw_semaphores',`
3816 attribute unpriv_userdomain;
3819 allow $1 unpriv_userdomain:sem rw_sem_perms;
3822 ########################################
3824 ## Send a message to unpriv users over a unix domain
3827 ## <param name="domain">
3829 ## Domain allowed access.
3833 interface(`userdom_dgram_send',`
3835 attribute unpriv_userdomain;
3838 allow $1 unpriv_userdomain:unix_dgram_socket sendto;
3841 ######################################
3843 ## Send a message to users over a unix domain
3846 ## <param name="domain">
3848 ## Domain allowed access.
3852 interface(`userdom_users_dgram_send',`
3854 attribute userdomain;
3857 allow $1 userdomain:unix_dgram_socket sendto;
3860 #######################################
3862 ## Allow execmod on files in homedirectory
3864 ## <param name="domain">
3866 ## Domain allowed access.
3871 interface(`userdom_execmod_user_home_files',`
3873 type user_home_type;
3876 allow $1 user_home_type:file execmod;
3879 ########################################
3881 ## Read admin home files.
3883 ## <param name="domain">
3885 ## Domain allowed access.
3890 interface(`userdom_read_admin_home_files',`
3895 read_files_pattern($1, admin_home_t, admin_home_t)
3898 ########################################
3900 ## Execute admin home files.
3902 ## <param name="domain">
3904 ## Domain allowed access.
3909 interface(`userdom_exec_admin_home_files',`
3914 exec_files_pattern($1, admin_home_t, admin_home_t)
3917 ########################################
3919 ## Append files inherited
3920 ## in the /root directory.
3922 ## <param name="domain">
3924 ## Domain allowed access.
3928 interface(`userdom_inherit_append_admin_home_files',`
3933 allow $1 admin_home_t:file { getattr append };
3937 #######################################
3939 ## Manage all files/directories in the homedir
3941 ## <param name="userdomain">
3948 interface(`userdom_manage_user_home_content',`
3950 type user_home_dir_t, user_home_t;
3951 attribute user_home_type;
3955 manage_dirs_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
3956 manage_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
3957 manage_lnk_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
3958 manage_sock_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
3959 manage_fifo_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
3960 filetrans_pattern($1, user_home_dir_t, user_home_t, { dir file lnk_file sock_file fifo_file })
3965 ########################################
3967 ## Create objects in a user home directory
3968 ## with an automatic type transition to
3969 ## the user home file type.
3971 ## <param name="domain">
3973 ## Domain allowed access.
3976 ## <param name="object_class">
3978 ## The class of the object to be created.
3982 interface(`userdom_user_home_dir_filetrans_pattern',`
3984 type user_home_dir_t, user_home_t;
3987 type_transition $1 user_home_dir_t:$2 user_home_t;
3990 ########################################
3992 ## Create objects in the /root directory
3993 ## with an automatic type transition to
3994 ## a specified private type.
3996 ## <param name="domain">
3998 ## Domain allowed access.
4001 ## <param name="private_type">
4003 ## The type of the object to create.
4006 ## <param name="object_class">
4008 ## The class of the object to be created.
4012 interface(`userdom_admin_home_dir_filetrans',`
4017 filetrans_pattern($1, admin_home_t, $2, $3, $4)
4020 ########################################
4022 ## Send signull to unprivileged user domains.
4024 ## <param name="domain">
4026 ## Domain allowed access.
4030 interface(`userdom_signull_unpriv_users',`
4032 attribute unpriv_userdomain;
4035 allow $1 unpriv_userdomain:process signull;
4038 ########################################
4040 ## Write all users files in /tmp
4042 ## <param name="domain">
4044 ## Domain allowed access.
4048 interface(`userdom_write_user_tmp_dirs',`
4053 write_files_pattern($1, user_tmp_t, user_tmp_t)
4056 ########################################
4058 ## Manage keys for all user domains.
4060 ## <param name="domain">
4062 ## Domain allowed access.
4066 interface(`userdom_manage_all_users_keys',`
4068 attribute userdomain;
4071 allow $1 userdomain:key manage_key_perms;
4075 ########################################
4077 ## Do not audit attempts to read and write
4078 ## unserdomain stream.
4080 ## <param name="domain">
4082 ## Domain to not audit.
4086 interface(`userdom_dontaudit_rw_stream',`
4088 attribute userdomain;
4091 dontaudit $1 userdomain:unix_stream_socket rw_socket_perms;
4094 ########################################
4096 ## Do not audit attempts to read and write
4097 ## unserdomain datagram socket.
4099 ## <param name="domain">
4101 ## Domain to not audit.
4105 interface(`userdom_dontaudit_rw_dgram_socket',`
4107 attribute userdomain;
4110 dontaudit $1 userdomain:unix_dgram_socket { read write };
4113 ########################################
4116 ## in a user home subdirectory.
4118 ## <param name="domain">
4120 ## Domain allowed access.
4124 interface(`userdom_append_user_home_content_files',`
4126 type user_home_dir_t, user_home_t;
4129 append_files_pattern($1, user_home_t, user_home_t)
4130 allow $1 user_home_dir_t:dir search_dir_perms;
4131 files_search_home($1)
4134 ########################################
4136 ## Read files inherited
4137 ## in a user home subdirectory.
4139 ## <param name="domain">
4141 ## Domain allowed access.
4145 interface(`userdom_read_inherited_user_home_content_files',`
4147 attribute user_home_type;
4150 allow $1 user_home_type:file { getattr read };
4153 ########################################
4155 ## Append files inherited
4156 ## in a user home subdirectory.
4158 ## <param name="domain">
4160 ## Domain allowed access.
4164 interface(`userdom_inherit_append_user_home_content_files',`
4169 allow $1 user_home_t:file { getattr append };
4172 ########################################
4174 ## Append files inherited
4175 ## in a user tmp files.
4177 ## <param name="domain">
4179 ## Domain allowed access.
4183 interface(`userdom_inherit_append_user_tmp_files',`
4188 allow $1 user_tmp_t:file { getattr append };
4191 ######################################
4193 ## Read audio files in the users homedir.
4195 ## <param name="domain">
4197 ## Domain allowed access.
4202 interface(`userdom_read_home_audio_files',`
4207 userdom_search_user_home_dirs($1)
4208 allow $1 audio_home_t:dir list_dir_perms;
4209 read_files_pattern($1, audio_home_t, audio_home_t)
4210 read_lnk_files_pattern($1, audio_home_t, audio_home_t)
4213 ########################################
4215 ## Do not audit attempts to write all user home content files.
4217 ## <param name="domain">
4219 ## Domain to not audit.
4223 interface(`userdom_dontaudit_write_all_user_home_content_files',`
4225 attribute user_home_type;
4228 dontaudit $1 user_home_type:file write_file_perms;
4231 ########################################
4233 ## Do not audit attempts to write all user tmp content files.
4235 ## <param name="domain">
4237 ## Domain to not audit.
4241 interface(`userdom_dontaudit_write_all_user_tmp_content_files',`
4243 attribute user_tmp_type;
4246 dontaudit $1 user_tmp_type:file write_file_perms;
4249 ########################################
4251 ## Manage all user temporary content.
4253 ## <param name="domain">
4255 ## Domain allowed access.
4259 interface(`userdom_manage_all_user_tmp_content',`
4261 attribute user_tmp_type;
4264 manage_dirs_pattern($1, user_tmp_type, user_tmp_type)
4265 manage_files_pattern($1, user_tmp_type, user_tmp_type)
4266 manage_lnk_files_pattern($1, user_tmp_type, user_tmp_type)
4267 manage_sock_files_pattern($1, user_tmp_type, user_tmp_type)
4268 manage_fifo_files_pattern($1, user_tmp_type, user_tmp_type)
4269 files_search_tmp($1)
4272 ########################################
4274 ## List all user temporary content.
4276 ## <param name="domain">
4278 ## Domain allowed access.
4282 interface(`userdom_list_all_user_tmp_content',`
4284 attribute user_tmp_type;
4287 list_dirs_pattern($1, user_tmp_type, user_tmp_type)
4288 getattr_files_pattern($1, user_tmp_type, user_tmp_type)
4289 read_lnk_files_pattern($1, user_tmp_type, user_tmp_type)
4290 getattr_sock_files_pattern($1, user_tmp_type, user_tmp_type)
4291 getattr_fifo_files_pattern($1, user_tmp_type, user_tmp_type)
4292 files_search_var($1)
4293 files_search_tmp($1)
4296 ########################################
4298 ## Manage all user tmpfs content.
4300 ## <param name="domain">
4302 ## Domain allowed access.
4306 interface(`userdom_manage_all_user_tmpfs_content',`
4308 attribute user_tmpfs_type;
4311 manage_dirs_pattern($1, user_tmpfs_type, user_tmpfs_type)
4312 manage_files_pattern($1, user_tmpfs_type, user_tmpfs_type)
4313 manage_lnk_files_pattern($1, user_tmpfs_type, user_tmpfs_type)
4314 manage_sock_files_pattern($1, user_tmpfs_type, user_tmpfs_type)
4315 manage_fifo_files_pattern($1, user_tmpfs_type, user_tmpfs_type)
4319 ########################################
4321 ## Delete all user temporary content.
4323 ## <param name="domain">
4325 ## Domain allowed access.
4329 interface(`userdom_delete_all_user_tmp_content',`
4331 attribute user_tmp_type;
4334 delete_dirs_pattern($1, user_tmp_type, user_tmp_type)
4335 delete_files_pattern($1, user_tmp_type, user_tmp_type)
4336 delete_lnk_files_pattern($1, user_tmp_type, user_tmp_type)
4337 delete_sock_files_pattern($1, user_tmp_type, user_tmp_type)
4338 delete_fifo_files_pattern($1, user_tmp_type, user_tmp_type)
4340 files_search_var($1)
4341 files_delete_tmp_dir_entry($1)
4344 ########################################
4346 ## Read system SSL certificates in the users homedir.
4348 ## <param name="domain">
4350 ## Domain allowed access.
4354 interface(`userdom_read_home_certs',`
4359 userdom_search_user_home_content($1)
4360 allow $1 home_cert_t:dir list_dir_perms;
4361 read_files_pattern($1, home_cert_t, home_cert_t)
4362 read_lnk_files_pattern($1, home_cert_t, home_cert_t)
4365 #######################################
4367 ## Dontaudit Write system SSL certificates in the users homedir.
4369 ## <param name="domain">
4371 ## Domain to not audit.
4375 interface(`userdom_dontaudit_write_home_certs',`
4380 dontaudit $1 home_cert_t:file write;
4383 ########################################
4385 ## dontaudit Search getatrr /root files
4387 ## <param name="domain">
4389 ## Domain to not audit.
4393 interface(`userdom_dontaudit_getattr_admin_home_files',`
4398 dontaudit $1 admin_home_t:file getattr;
4401 ########################################
4403 ## dontaudit read /root lnk files
4405 ## <param name="domain">
4407 ## Domain to not audit.
4411 interface(`userdom_dontaudit_read_admin_home_lnk_files',`
4416 dontaudit $1 admin_home_t:lnk_file read;
4419 ########################################
4421 ## dontaudit read /root files
4423 ## <param name="domain">
4425 ## Domain to not audit.
4429 interface(`userdom_dontaudit_read_admin_home_files',`
4434 dontaudit $1 admin_home_t:file read_file_perms;
4437 ########################################
4439 ## Create, read, write, and delete user
4440 ## temporary chr files.
4442 ## <param name="domain">
4444 ## Domain allowed access.
4448 interface(`userdom_manage_user_tmp_chr_files',`
4453 manage_chr_files_pattern($1, user_tmp_t, user_tmp_t)
4454 files_search_tmp($1)
4457 ########################################
4459 ## Create, read, write, and delete user
4460 ## temporary blk files.
4462 ## <param name="domain">
4464 ## Domain allowed access.
4468 interface(`userdom_manage_user_tmp_blk_files',`
4473 manage_blk_files_pattern($1, user_tmp_t, user_tmp_t)
4474 files_search_tmp($1)
4477 ########################################
4479 ## Dontaudit attempt to set attributes on user temporary directories.
4481 ## <param name="domain">
4483 ## Domain to not audit.
4487 interface(`userdom_dontaudit_setattr_user_tmp',`
4492 dontaudit $1 user_tmp_t:dir setattr;
4495 ########################################
4497 ## Write all inherited users files in /tmp
4499 ## <param name="domain">
4501 ## Domain allowed access.
4505 interface(`userdom_write_inherited_user_tmp_files',`
4510 allow $1 user_tmp_t:file write;
4513 ########################################
4515 ## Delete all users files in /tmp
4517 ## <param name="domain">
4519 ## Domain allowed access.
4523 interface(`userdom_delete_user_tmp_files',`
4528 allow $1 user_tmp_t:file delete_file_perms;
4531 ########################################
4533 ## Delete user tmpfs files.
4535 ## <param name="domain">
4537 ## Domain allowed access.
4541 interface(`userdom_delete_user_tmpfs_files',`
4546 allow $1 user_tmpfs_t:file delete_file_perms;
4549 ########################################
4551 ## Read/Write unpriviledged user SysV shared
4554 ## <param name="domain">
4556 ## Domain allowed access.
4560 interface(`userdom_rw_unpriv_user_shared_mem',`
4562 attribute unpriv_userdomain;
4565 allow $1 unpriv_userdomain:shm rw_shm_perms;
4568 ########################################
4570 ## Do not audit attempts to search user
4571 ## temporary directories.
4573 ## <param name="domain">
4575 ## Domain to not audit.
4579 interface(`userdom_dontaudit_search_user_tmp',`
4584 dontaudit $1 user_tmp_t:dir search_dir_perms;
4587 ########################################
4589 ## Execute a file in a user home directory
4590 ## in the specified domain.
4594 ## Execute a file in a user home directory
4595 ## in the specified domain.
4598 ## No interprocess communication (signals, pipes,
4599 ## etc.) is provided by this interface since
4600 ## the domains are not owned by this module.
4603 ## <param name="domain">
4605 ## Domain allowed access.
4608 ## <param name="target_domain">
4610 ## The type of the new process.
4614 interface(`userdom_domtrans_user_home',`
4619 read_lnk_files_pattern($1, user_home_t, user_home_t)
4620 domain_transition_pattern($1, user_home_t, $2)
4621 type_transition $1 user_home_t:process $2;
4624 ########################################
4626 ## Execute a file in a user tmp directory
4627 ## in the specified domain.
4631 ## Execute a file in a user tmp directory
4632 ## in the specified domain.
4635 ## No interprocess communication (signals, pipes,
4636 ## etc.) is provided by this interface since
4637 ## the domains are not owned by this module.
4640 ## <param name="domain">
4642 ## Domain allowed access.
4645 ## <param name="target_domain">
4647 ## The type of the new process.
4651 interface(`userdom_domtrans_user_tmp',`
4656 files_search_tmp($1)
4657 read_lnk_files_pattern($1, user_tmp_t, user_tmp_t)
4658 domain_transition_pattern($1, user_tmp_t, $2)
4659 type_transition $1 user_tmp_t:process $2;
4662 ########################################
4664 ## Do not audit attempts to read all user home content files.
4666 ## <param name="domain">
4668 ## Domain to not audit.
4672 interface(`userdom_dontaudit_read_all_user_home_content_files',`
4674 attribute user_home_type;
4677 dontaudit $1 user_home_type:file read_file_perms;
4680 ########################################
4682 ## Do not audit attempts to read all user tmp content files.
4684 ## <param name="domain">
4686 ## Domain to not audit.
4690 interface(`userdom_dontaudit_read_all_user_tmp_content_files',`
4692 attribute user_tmp_type;
4695 dontaudit $1 user_tmp_type:file read_file_perms;