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)
1404 term_use_unallocated_ttys($1_t)
1406 auth_getattr_shadow($1_t)
1407 # Manage almost all files
1408 auth_manage_all_files_except_shadow($1_t)
1409 # Relabel almost all files
1410 auth_relabel_all_files_except_shadow($1_t)
1414 logging_send_syslog_msg($1_t)
1417 modutils_domtrans_insmod($1_t)
1418 modutils_domtrans_depmod($1_t)
1421 # The following rule is temporary until such time that a complete
1422 # policy management infrastructure is in place so that an administrator
1423 # cannot directly manipulate policy files with arbitrary programs.
1424 seutil_manage_src_policy($1_t)
1425 # Violates the goal of limiting write access to checkpolicy.
1426 # But presently necessary for installing the file_contexts file.
1427 seutil_manage_bin_policy($1_t)
1429 userdom_manage_user_home_content_dirs($1_t)
1430 userdom_manage_user_home_content_files($1_t)
1431 userdom_manage_user_home_content_symlinks($1_t)
1432 userdom_manage_user_home_content_pipes($1_t)
1433 userdom_manage_user_home_content_sockets($1_t)
1434 userdom_user_home_dir_filetrans_user_home_content($1_t, { dir file lnk_file fifo_file sock_file })
1436 tunable_policy(`user_rw_noexattrfile',`
1437 fs_manage_noxattr_fs_files($1_t)
1438 fs_manage_noxattr_fs_dirs($1_t)
1440 fs_read_noxattr_fs_files($1_t)
1444 postgresql_unconfined($1_t)
1448 userhelper_exec($1_t)
1452 ########################################
1454 ## Allow user to run as a secadm
1458 ## Create objects in a user home directory
1459 ## with an automatic type transition to
1460 ## a specified private type.
1463 ## This is a templated interface, and should only
1464 ## be called from a per-userdomain template.
1467 ## <param name="domain">
1469 ## Domain allowed access.
1472 ## <param name="role">
1474 ## The role of the object to create.
1478 template(`userdom_security_admin_template',`
1479 allow $1 self:capability { dac_read_search dac_override };
1481 corecmd_exec_shell($1)
1483 domain_obj_id_change_exemption($1)
1485 dev_relabel_all_dev_nodes($1)
1487 files_create_boot_flag($1)
1488 files_create_default_dir($1)
1489 files_root_filetrans_default($1, dir)
1491 # Necessary for managing /boot/efi
1492 fs_manage_dos_files($1)
1494 mls_process_read_up($1)
1495 mls_file_read_all_levels($1)
1496 mls_file_upgrade($1)
1497 mls_file_downgrade($1)
1499 selinux_set_enforce_mode($1)
1500 selinux_set_all_booleans($1)
1501 selinux_set_parameters($1)
1502 selinux_read_policy($1)
1504 auth_relabel_all_files_except_shadow($1)
1505 auth_relabel_shadow($1)
1509 logging_send_syslog_msg($1)
1510 logging_read_audit_log($1)
1511 logging_read_generic_logs($1)
1512 logging_read_audit_config($1)
1514 seutil_manage_bin_policy($1)
1515 seutil_manage_default_contexts($1)
1516 seutil_manage_file_contexts($1)
1517 seutil_manage_module_store($1)
1518 seutil_manage_config($1)
1519 seutil_run_checkpolicy($1,$2)
1520 seutil_run_loadpolicy($1,$2)
1521 seutil_run_semanage($1,$2)
1522 seutil_run_setsebool($1,$2)
1523 seutil_run_setfiles($1, $2)
1525 seutil_manage_bin_policy($1)
1526 seutil_manage_default_contexts($1)
1527 seutil_manage_file_contexts($1)
1528 seutil_manage_module_store($1)
1529 seutil_manage_config($1)
1536 consoletype_exec($1)
1544 ipsec_run_setkey($1,$2)
1548 netlabel_run_mgmt($1,$2)
1556 ########################################
1558 ## Make the specified type usable in a
1559 ## user home directory.
1561 ## <param name="type">
1563 ## Type to be used as a file in the
1564 ## user home directory.
1568 interface(`userdom_user_home_content',`
1571 attribute user_home_type;
1574 allow $1 user_home_t:filesystem associate;
1576 ubac_constrained($1)
1578 files_poly_member($1)
1579 typeattribute $1 user_home_type;
1582 ########################################
1584 ## Make the specified type usable in a
1585 ## generic temporary directory.
1587 ## <param name="type">
1589 ## Type to be used as a file in the
1590 ## generic temporary directory.
1594 interface(`userdom_user_tmp_content',`
1596 attribute user_tmp_type;
1599 typeattribute $1 user_tmp_type;
1602 ubac_constrained($1)
1605 ########################################
1607 ## Allow domain to attach to TUN devices created by administrative users.
1609 ## <param name="domain">
1611 ## Domain allowed access.
1615 interface(`userdom_attach_admin_tun_iface',`
1617 attribute admindomain;
1620 allow $1 admindomain:tun_socket relabelfrom;
1621 allow $1 self:tun_socket relabelto;
1624 ########################################
1626 ## Set the attributes of a user pty.
1628 ## <param name="domain">
1630 ## Domain allowed access.
1634 interface(`userdom_setattr_user_ptys',`
1639 allow $1 user_devpts_t:chr_file setattr_chr_file_perms;
1642 ########################################
1644 ## Create a user pty.
1646 ## <param name="domain">
1648 ## Domain allowed access.
1652 interface(`userdom_create_user_pty',`
1657 term_create_pty($1, user_devpts_t)
1660 ########################################
1662 ## Get the attributes of user home directories.
1664 ## <param name="domain">
1666 ## Domain allowed access.
1670 interface(`userdom_getattr_user_home_dirs',`
1672 type user_home_dir_t;
1675 allow $1 user_home_dir_t:dir getattr_dir_perms;
1676 files_search_home($1)
1679 ########################################
1681 ## Do not audit attempts to get the attributes of user home directories.
1683 ## <param name="domain">
1685 ## Domain to not audit.
1689 interface(`userdom_dontaudit_getattr_user_home_dirs',`
1691 type user_home_dir_t;
1694 dontaudit $1 user_home_dir_t:dir getattr_dir_perms;
1697 ########################################
1699 ## Search user home directories.
1701 ## <param name="domain">
1703 ## Domain allowed access.
1707 interface(`userdom_search_user_home_dirs',`
1709 type user_home_dir_t;
1712 allow $1 user_home_dir_t:dir search_dir_perms;
1713 allow $1 user_home_dir_t:lnk_file read_lnk_file_perms;
1714 files_search_home($1)
1717 ########################################
1719 ## Do not audit attempts to search user home directories.
1723 ## Do not audit attempts to search user home directories.
1724 ## This will supress SELinux denial messages when the specified
1725 ## domain is denied the permission to search these directories.
1728 ## <param name="domain">
1730 ## Domain to not audit.
1733 ## <infoflow type="none"/>
1735 interface(`userdom_dontaudit_search_user_home_dirs',`
1737 type user_home_dir_t;
1740 dontaudit $1 user_home_dir_t:dir search_dir_perms;
1743 ########################################
1745 ## List user home directories.
1747 ## <param name="domain">
1749 ## Domain allowed access.
1753 interface(`userdom_list_user_home_dirs',`
1755 type user_home_dir_t;
1758 allow $1 user_home_dir_t:dir list_dir_perms;
1759 files_search_home($1)
1761 tunable_policy(`use_nfs_home_dirs',`
1765 tunable_policy(`use_samba_home_dirs',`
1770 ########################################
1772 ## Do not audit attempts to list user home subdirectories.
1774 ## <param name="domain">
1776 ## Domain to not audit.
1780 interface(`userdom_dontaudit_list_user_home_dirs',`
1782 type user_home_dir_t;
1786 dontaudit $1 user_home_dir_t:dir list_dir_perms;
1787 dontaudit $1 user_home_t:dir list_dir_perms;
1790 ########################################
1792 ## Create user home directories.
1794 ## <param name="domain">
1796 ## Domain allowed access.
1800 interface(`userdom_create_user_home_dirs',`
1802 type user_home_dir_t;
1805 allow $1 user_home_dir_t:dir create_dir_perms;
1808 ########################################
1810 ## Create user home directories.
1812 ## <param name="domain">
1814 ## Domain allowed access.
1818 interface(`userdom_manage_user_home_dirs',`
1820 type user_home_dir_t;
1823 allow $1 user_home_dir_t:dir manage_dir_perms;
1826 ########################################
1828 ## Relabel to user home directories.
1830 ## <param name="domain">
1832 ## Domain allowed access.
1836 interface(`userdom_relabelto_user_home_dirs',`
1838 type user_home_dir_t;
1841 allow $1 user_home_dir_t:dir relabelto;
1845 ########################################
1847 ## Relabel to user home files.
1849 ## <param name="domain">
1851 ## Domain allowed access.
1855 interface(`userdom_relabelto_user_home_files',`
1860 allow $1 user_home_t:file relabelto;
1862 ########################################
1864 ## Relabel user home files.
1866 ## <param name="domain">
1868 ## Domain allowed access.
1872 interface(`userdom_relabel_user_home_files',`
1877 allow $1 user_home_t:file relabel_file_perms;
1880 ########################################
1882 ## Create directories in the home dir root with
1883 ## the user home directory type.
1885 ## <param name="domain">
1887 ## Domain allowed access.
1891 interface(`userdom_home_filetrans_user_home_dir',`
1893 type user_home_dir_t;
1896 files_home_filetrans($1, user_home_dir_t, dir)
1899 ########################################
1901 ## Do a domain transition to the specified
1902 ## domain when executing a program in the
1903 ## user home directory.
1907 ## Do a domain transition to the specified
1908 ## domain when executing a program in the
1909 ## user home directory.
1912 ## No interprocess communication (signals, pipes,
1913 ## etc.) is provided by this interface since
1914 ## the domains are not owned by this module.
1917 ## <param name="source_domain">
1919 ## Domain allowed to transition.
1922 ## <param name="target_domain">
1924 ## Domain to transition to.
1928 interface(`userdom_user_home_domtrans',`
1930 type user_home_dir_t, user_home_t;
1933 domain_auto_trans($1, user_home_t, $2)
1934 allow $1 user_home_dir_t:dir search_dir_perms;
1935 files_search_home($1)
1938 ########################################
1940 ## Do not audit attempts to search user home content directories.
1942 ## <param name="domain">
1944 ## Domain to not audit.
1948 interface(`userdom_dontaudit_search_user_home_content',`
1953 dontaudit $1 user_home_t:dir search_dir_perms;
1954 fs_dontaudit_list_nfs($1)
1955 fs_dontaudit_list_cifs($1)
1958 ########################################
1960 ## List contents of users home directory.
1962 ## <param name="domain">
1964 ## Domain allowed access.
1968 interface(`userdom_list_user_home_content',`
1970 type user_home_dir_t;
1971 attribute user_home_type;
1975 allow $1 { user_home_dir_t user_home_type }:dir list_dir_perms;
1978 ########################################
1980 ## Create, read, write, and delete directories
1981 ## in a user home subdirectory.
1983 ## <param name="domain">
1985 ## Domain allowed access.
1989 interface(`userdom_manage_user_home_content_dirs',`
1991 type user_home_dir_t, user_home_t;
1994 manage_dirs_pattern($1, { user_home_dir_t user_home_t }, user_home_t)
1995 files_search_home($1)
1998 ########################################
2000 ## Delete directories in a user home subdirectory.
2002 ## <param name="domain">
2004 ## Domain allowed access.
2008 interface(`userdom_delete_user_home_content_dirs',`
2013 allow $1 user_home_t:dir delete_dir_perms;
2016 ########################################
2018 ## Set the attributes of user home files.
2020 ## <param name="domain">
2022 ## Domain allowed access.
2027 interface(`userdom_setattr_user_home_content_files',`
2032 allow $1 user_home_t:file setattr;
2035 ########################################
2037 ## Do not audit attempts to set the
2038 ## attributes of user home files.
2040 ## <param name="domain">
2042 ## Domain to not audit.
2046 interface(`userdom_dontaudit_setattr_user_home_content_files',`
2051 dontaudit $1 user_home_t:file setattr_file_perms;
2054 ########################################
2056 ## Mmap user home files.
2058 ## <param name="domain">
2060 ## Domain allowed access.
2064 interface(`userdom_mmap_user_home_content_files',`
2066 type user_home_dir_t, user_home_t;
2069 mmap_files_pattern($1, { user_home_dir_t user_home_t }, user_home_t)
2070 files_search_home($1)
2073 ########################################
2075 ## Read user home files.
2077 ## <param name="domain">
2079 ## Domain allowed access.
2083 interface(`userdom_read_user_home_content_files',`
2085 type user_home_dir_t, user_home_t;
2088 list_dirs_pattern($1, { user_home_dir_t user_home_t }, { user_home_dir_t user_home_t })
2089 read_files_pattern($1, { user_home_dir_t user_home_t }, user_home_t)
2090 files_search_home($1)
2093 ########################################
2095 ## Do not audit attempts to getattr user home files.
2097 ## <param name="domain">
2099 ## Domain to not audit.
2103 interface(`userdom_dontaudit_getattr_user_home_content',`
2105 attribute user_home_type;
2108 dontaudit $1 user_home_type:dir getattr;
2109 dontaudit $1 user_home_type:file getattr;
2112 ########################################
2114 ## Do not audit attempts to read user home files.
2116 ## <param name="domain">
2118 ## Domain to not audit.
2122 interface(`userdom_dontaudit_read_user_home_content_files',`
2124 attribute user_home_type;
2125 type user_home_dir_t;
2128 dontaudit $1 user_home_dir_t:dir list_dir_perms;
2129 dontaudit $1 user_home_type:dir list_dir_perms;
2130 dontaudit $1 user_home_type:file read_file_perms;
2131 dontaudit $1 user_home_type:lnk_file read_lnk_file_perms;
2134 ########################################
2136 ## Do not audit attempts to append user home files.
2138 ## <param name="domain">
2140 ## Domain to not audit.
2144 interface(`userdom_dontaudit_append_user_home_content_files',`
2149 dontaudit $1 user_home_t:file append_file_perms;
2152 ########################################
2154 ## Do not audit attempts to write user home files.
2156 ## <param name="domain">
2158 ## Domain to not audit.
2162 interface(`userdom_dontaudit_write_user_home_content_files',`
2167 dontaudit $1 user_home_t:file write_file_perms;
2170 ########################################
2172 ## Delete files in a user home subdirectory.
2174 ## <param name="domain">
2176 ## Domain allowed access.
2180 interface(`userdom_delete_user_home_content_files',`
2185 allow $1 user_home_t:file delete_file_perms;
2188 ########################################
2190 ## Delete sock files in a user home subdirectory.
2192 ## <param name="domain">
2194 ## Domain allowed access.
2198 interface(`userdom_delete_user_home_content_sock_files',`
2203 allow $1 user_home_t:sock_file delete_file_perms;
2206 ########################################
2208 ## Do not audit attempts to write user home files.
2210 ## <param name="domain">
2212 ## Domain to not audit.
2216 interface(`userdom_dontaudit_relabel_user_home_content_files',`
2221 dontaudit $1 user_home_t:file relabel_file_perms;
2224 ########################################
2226 ## Read user home subdirectory symbolic links.
2228 ## <param name="domain">
2230 ## Domain allowed access.
2234 interface(`userdom_read_user_home_content_symlinks',`
2236 type user_home_dir_t, user_home_t;
2239 allow $1 { user_home_dir_t user_home_t }:lnk_file read_lnk_file_perms;
2242 ########################################
2244 ## Execute user home files.
2246 ## <param name="domain">
2248 ## Domain allowed access.
2253 interface(`userdom_exec_user_home_content_files',`
2255 type user_home_dir_t;
2256 attribute user_home_type;
2259 files_search_home($1)
2260 exec_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
2261 dontaudit $1 user_home_type:sock_file execute;
2264 ########################################
2266 ## Do not audit attempts to execute user home files.
2268 ## <param name="domain">
2270 ## Domain to not audit.
2274 interface(`userdom_dontaudit_exec_user_home_content_files',`
2279 dontaudit $1 user_home_t:file exec_file_perms;
2282 ########################################
2284 ## Create, read, write, and delete files
2285 ## in a user home subdirectory.
2287 ## <param name="domain">
2289 ## Domain allowed access.
2293 interface(`userdom_manage_user_home_content_files',`
2295 type user_home_dir_t, user_home_t;
2298 manage_files_pattern($1, user_home_t, user_home_t)
2299 allow $1 user_home_dir_t:dir search_dir_perms;
2300 files_search_home($1)
2303 ########################################
2305 ## Do not audit attempts to create, read, write, and delete directories
2306 ## in a user home subdirectory.
2308 ## <param name="domain">
2310 ## Domain to not audit.
2314 interface(`userdom_dontaudit_manage_user_home_content_dirs',`
2316 type user_home_dir_t, user_home_t;
2319 dontaudit $1 user_home_t:dir manage_dir_perms;
2322 ########################################
2324 ## Create, read, write, and delete symbolic links
2325 ## in a user home subdirectory.
2327 ## <param name="domain">
2329 ## Domain allowed access.
2333 interface(`userdom_manage_user_home_content_symlinks',`
2335 type user_home_dir_t, user_home_t;
2338 manage_lnk_files_pattern($1, user_home_t, user_home_t)
2339 allow $1 user_home_dir_t:dir search_dir_perms;
2340 files_search_home($1)
2343 ########################################
2345 ## Delete symbolic links in a user home directory.
2347 ## <param name="domain">
2349 ## Domain allowed access.
2353 interface(`userdom_delete_user_home_content_symlinks',`
2358 allow $1 user_home_t:lnk_file delete_lnk_file_perms;
2361 ########################################
2363 ## Create, read, write, and delete named pipes
2364 ## in a user home subdirectory.
2366 ## <param name="domain">
2368 ## Domain allowed access.
2372 interface(`userdom_manage_user_home_content_pipes',`
2374 type user_home_dir_t, user_home_t;
2377 manage_fifo_files_pattern($1, user_home_t, user_home_t)
2378 allow $1 user_home_dir_t:dir search_dir_perms;
2379 files_search_home($1)
2382 ########################################
2384 ## Create, read, write, and delete named sockets
2385 ## in a user home subdirectory.
2387 ## <param name="domain">
2389 ## Domain allowed access.
2393 interface(`userdom_manage_user_home_content_sockets',`
2395 type user_home_dir_t, user_home_t;
2398 allow $1 user_home_dir_t:dir search_dir_perms;
2399 manage_sock_files_pattern($1, user_home_t, user_home_t)
2400 files_search_home($1)
2403 ########################################
2405 ## Create objects in a user home directory
2406 ## with an automatic type transition to
2407 ## a specified private type.
2409 ## <param name="domain">
2411 ## Domain allowed access.
2414 ## <param name="private_type">
2416 ## The type of the object to create.
2419 ## <param name="object_class">
2421 ## The class of the object to be created.
2425 interface(`userdom_user_home_dir_filetrans',`
2427 type user_home_dir_t;
2430 filetrans_pattern($1, user_home_dir_t, $2, $3, $4)
2431 files_search_home($1)
2434 ########################################
2436 ## Create objects in a user home directory
2437 ## with an automatic type transition to
2438 ## a specified private type.
2440 ## <param name="domain">
2442 ## Domain allowed access.
2445 ## <param name="private_type">
2447 ## The type of the object to create.
2450 ## <param name="object_class">
2452 ## The class of the object to be created.
2456 interface(`userdom_user_home_content_filetrans',`
2458 type user_home_dir_t, user_home_t;
2461 filetrans_pattern($1, user_home_t, $2, $3)
2462 allow $1 user_home_dir_t:dir search_dir_perms;
2463 files_search_home($1)
2466 ########################################
2468 ## Create objects in a user home directory
2469 ## with an automatic type transition to
2470 ## the user home file type.
2472 ## <param name="domain">
2474 ## Domain allowed access.
2477 ## <param name="object_class">
2479 ## The class of the object to be created.
2483 interface(`userdom_user_home_dir_filetrans_user_home_content',`
2485 type user_home_dir_t, user_home_t;
2488 filetrans_pattern($1, user_home_dir_t, user_home_t, $2)
2489 files_search_home($1)
2492 ########################################
2494 ## Write to user temporary named sockets.
2496 ## <param name="domain">
2498 ## Domain allowed access.
2502 interface(`userdom_write_user_tmp_sockets',`
2507 allow $1 user_tmp_t:sock_file write_sock_file_perms;
2508 files_search_tmp($1)
2511 ########################################
2513 ## List user temporary directories.
2515 ## <param name="domain">
2517 ## Domain allowed access.
2521 interface(`userdom_list_user_tmp',`
2526 allow $1 user_tmp_t:dir list_dir_perms;
2527 files_search_tmp($1)
2530 ########################################
2532 ## Do not audit attempts to list user
2533 ## temporary directories.
2535 ## <param name="domain">
2537 ## Domain to not audit.
2541 interface(`userdom_dontaudit_list_user_tmp',`
2546 dontaudit $1 user_tmp_t:dir list_dir_perms;
2549 ########################################
2551 ## Do not audit attempts to manage users
2552 ## temporary directories.
2554 ## <param name="domain">
2556 ## Domain to not audit.
2560 interface(`userdom_dontaudit_manage_user_tmp_dirs',`
2565 dontaudit $1 user_tmp_t:dir manage_dir_perms;
2568 ########################################
2570 ## Read user temporary files.
2572 ## <param name="domain">
2574 ## Domain allowed access.
2578 interface(`userdom_read_user_tmp_files',`
2583 read_files_pattern($1, user_tmp_t, user_tmp_t)
2584 allow $1 user_tmp_t:dir list_dir_perms;
2585 files_search_tmp($1)
2588 ########################################
2590 ## Do not audit attempts to read users
2593 ## <param name="domain">
2595 ## Domain to not audit.
2599 interface(`userdom_dontaudit_read_user_tmp_files',`
2604 dontaudit $1 user_tmp_t:file read_inherited_file_perms;
2607 ########################################
2609 ## Do not audit attempts to append users
2612 ## <param name="domain">
2614 ## Domain to not audit.
2618 interface(`userdom_dontaudit_append_user_tmp_files',`
2623 dontaudit $1 user_tmp_t:file append_file_perms;
2626 ########################################
2628 ## Read and write user temporary files.
2630 ## <param name="domain">
2632 ## Domain allowed access.
2636 interface(`userdom_rw_user_tmp_files',`
2641 allow $1 user_tmp_t:dir list_dir_perms;
2642 rw_files_pattern($1, user_tmp_t, user_tmp_t)
2643 files_search_tmp($1)
2646 ########################################
2648 ## Do not audit attempts to manage users
2651 ## <param name="domain">
2653 ## Domain to not audit.
2657 interface(`userdom_dontaudit_manage_user_tmp_files',`
2662 dontaudit $1 user_tmp_t:file manage_file_perms;
2665 ########################################
2667 ## Read user temporary symbolic links.
2669 ## <param name="domain">
2671 ## Domain allowed access.
2675 interface(`userdom_read_user_tmp_symlinks',`
2680 read_lnk_files_pattern($1, user_tmp_t, user_tmp_t)
2681 allow $1 user_tmp_t:dir list_dir_perms;
2682 files_search_tmp($1)
2685 ########################################
2687 ## Create, read, write, and delete user
2688 ## temporary directories.
2690 ## <param name="domain">
2692 ## Domain allowed access.
2696 interface(`userdom_manage_user_tmp_dirs',`
2701 manage_dirs_pattern($1, user_tmp_t, user_tmp_t)
2702 files_search_tmp($1)
2705 ########################################
2707 ## Create, read, write, and delete user
2710 ## <param name="domain">
2712 ## Domain allowed access.
2716 interface(`userdom_manage_user_tmp_files',`
2721 manage_files_pattern($1, user_tmp_t, user_tmp_t)
2722 files_search_tmp($1)
2725 ########################################
2727 ## Create, read, write, and delete user
2728 ## temporary symbolic links.
2730 ## <param name="domain">
2732 ## Domain allowed access.
2736 interface(`userdom_manage_user_tmp_symlinks',`
2741 manage_lnk_files_pattern($1, user_tmp_t, user_tmp_t)
2742 files_search_tmp($1)
2745 ########################################
2747 ## Create, read, write, and delete user
2748 ## temporary named pipes.
2750 ## <param name="domain">
2752 ## Domain allowed access.
2756 interface(`userdom_manage_user_tmp_pipes',`
2761 manage_fifo_files_pattern($1, user_tmp_t, user_tmp_t)
2762 files_search_tmp($1)
2765 ########################################
2767 ## Create, read, write, and delete user
2768 ## temporary named sockets.
2770 ## <param name="domain">
2772 ## Domain allowed access.
2776 interface(`userdom_manage_user_tmp_sockets',`
2781 manage_sock_files_pattern($1, user_tmp_t, user_tmp_t)
2782 files_search_tmp($1)
2785 ########################################
2787 ## Create objects in a user temporary directory
2788 ## with an automatic type transition to
2789 ## a specified private type.
2791 ## <param name="domain">
2793 ## Domain allowed access.
2796 ## <param name="private_type">
2798 ## The type of the object to create.
2801 ## <param name="object_class">
2803 ## The class of the object to be created.
2807 interface(`userdom_user_tmp_filetrans',`
2812 filetrans_pattern($1, user_tmp_t, $2, $3)
2813 files_search_tmp($1)
2816 ########################################
2818 ## Create objects in the temporary directory
2819 ## with an automatic type transition to
2820 ## the user temporary type.
2822 ## <param name="domain">
2824 ## Domain allowed access.
2827 ## <param name="object_class">
2829 ## The class of the object to be created.
2833 interface(`userdom_tmp_filetrans_user_tmp',`
2838 files_tmp_filetrans($1, user_tmp_t, $2)
2841 ########################################
2843 ## Read user tmpfs files.
2845 ## <param name="domain">
2847 ## Domain allowed access.
2851 interface(`userdom_read_user_tmpfs_files',`
2856 read_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
2857 read_lnk_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
2858 allow $1 user_tmpfs_t:dir list_dir_perms;
2862 ########################################
2864 ## Read/Write user tmpfs files.
2866 ## <param name="domain">
2868 ## Domain allowed access.
2872 interface(`userdom_rw_user_tmpfs_files',`
2877 rw_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
2878 read_lnk_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
2879 allow $1 user_tmpfs_t:dir list_dir_perms;
2883 ########################################
2885 ## Get the attributes of a user domain tty.
2887 ## <param name="domain">
2889 ## Domain allowed access.
2893 interface(`userdom_getattr_user_ttys',`
2895 type user_tty_device_t;
2898 allow $1 user_tty_device_t:chr_file getattr_chr_file_perms;
2901 ########################################
2903 ## Do not audit attempts to get the attributes of a user domain tty.
2905 ## <param name="domain">
2907 ## Domain to not audit.
2911 interface(`userdom_dontaudit_getattr_user_ttys',`
2913 type user_tty_device_t;
2916 dontaudit $1 user_tty_device_t:chr_file getattr_chr_file_perms;
2919 ########################################
2921 ## Set the attributes of a user domain tty.
2923 ## <param name="domain">
2925 ## Domain allowed access.
2929 interface(`userdom_setattr_user_ttys',`
2931 type user_tty_device_t;
2934 allow $1 user_tty_device_t:chr_file setattr_chr_file_perms;
2937 ########################################
2939 ## Do not audit attempts to set the attributes of a user domain tty.
2941 ## <param name="domain">
2943 ## Domain to not audit.
2947 interface(`userdom_dontaudit_setattr_user_ttys',`
2949 type user_tty_device_t;
2952 dontaudit $1 user_tty_device_t:chr_file setattr_chr_file_perms;
2955 ########################################
2957 ## Read and write a user domain tty.
2959 ## <param name="domain">
2961 ## Domain allowed access.
2965 interface(`userdom_use_user_ttys',`
2967 type user_tty_device_t;
2970 allow $1 user_tty_device_t:chr_file rw_term_perms;
2973 ########################################
2975 ## Read and write a inherited user domain tty.
2977 ## <param name="domain">
2979 ## Domain allowed access.
2983 interface(`userdom_use_inherited_user_ttys',`
2985 type user_tty_device_t;
2988 allow $1 user_tty_device_t:chr_file rw_inherited_term_perms;
2991 ########################################
2993 ## Read and write a user domain pty.
2995 ## <param name="domain">
2997 ## Domain allowed access.
3001 interface(`userdom_use_user_ptys',`
3006 allow $1 user_devpts_t:chr_file rw_term_perms;
3009 ########################################
3011 ## Read and write a inherited user domain pty.
3013 ## <param name="domain">
3015 ## Domain allowed access.
3019 interface(`userdom_use_inherited_user_ptys',`
3024 allow $1 user_devpts_t:chr_file rw_inherited_term_perms;
3027 ########################################
3029 ## Read and write a inherited user TTYs and PTYs.
3033 ## Allow the specified domain to read and write inherited user
3034 ## TTYs and PTYs. This will allow the domain to
3035 ## interact with the user via the terminal. Typically
3036 ## all interactive applications will require this
3040 ## <param name="domain">
3042 ## Domain allowed access.
3045 ## <infoflow type="both" weight="10"/>
3047 interface(`userdom_use_inherited_user_terminals',`
3049 type user_tty_device_t, user_devpts_t;
3052 allow $1 user_tty_device_t:chr_file rw_inherited_term_perms;
3053 allow $1 user_devpts_t:chr_file rw_inherited_term_perms;
3056 #######################################
3058 ## Allow attempts to read and write
3059 ## a user domain tty and pty.
3061 ## <param name="domain">
3063 ## Domain to not audit.
3067 interface(`userdom_use_user_terminals',`
3069 type user_tty_device_t, user_devpts_t;
3072 allow $1 user_tty_device_t:chr_file rw_term_perms;
3073 allow $1 user_devpts_t:chr_file rw_term_perms;
3076 ########################################
3078 ## Do not audit attempts to read and write
3079 ## a user domain tty and pty.
3081 ## <param name="domain">
3083 ## Domain to not audit.
3087 interface(`userdom_dontaudit_use_user_terminals',`
3089 type user_tty_device_t, user_devpts_t;
3092 dontaudit $1 user_tty_device_t:chr_file rw_term_perms;
3093 dontaudit $1 user_devpts_t:chr_file rw_term_perms;
3097 ########################################
3099 ## Get attributes of user domain tty and pty.
3101 ## <param name="domain">
3103 ## Domain allowed access.
3107 interface(`userdom_getattr_user_terminals',`
3109 type user_tty_device_t, user_devpts_t;
3112 allow $1 { user_tty_device_t user_devpts_t }:chr_file getattr_chr_file_perms;
3115 ########################################
3117 ## Execute a shell in all user domains. This
3118 ## is an explicit transition, requiring the
3119 ## caller to use setexeccon().
3121 ## <param name="domain">
3123 ## Domain allowed to transition.
3127 interface(`userdom_spec_domtrans_all_users',`
3129 attribute userdomain;
3132 corecmd_shell_spec_domtrans($1, userdomain)
3133 allow userdomain $1:fd use;
3134 allow userdomain $1:fifo_file rw_file_perms;
3135 allow userdomain $1:process sigchld;
3138 ########################################
3140 ## Execute an Xserver session in all unprivileged user domains. This
3141 ## is an explicit transition, requiring the
3142 ## caller to use setexeccon().
3144 ## <param name="domain">
3146 ## Domain allowed to transition.
3150 interface(`userdom_xsession_spec_domtrans_all_users',`
3152 attribute userdomain;
3155 xserver_xsession_spec_domtrans($1, userdomain)
3156 allow userdomain $1:fd use;
3157 allow userdomain $1:fifo_file rw_file_perms;
3158 allow userdomain $1:process sigchld;
3161 ########################################
3163 ## Execute a shell in all unprivileged user domains. This
3164 ## is an explicit transition, requiring the
3165 ## caller to use setexeccon().
3167 ## <param name="domain">
3169 ## Domain allowed to transition.
3173 interface(`userdom_spec_domtrans_unpriv_users',`
3175 attribute unpriv_userdomain;
3178 corecmd_shell_spec_domtrans($1, unpriv_userdomain)
3179 allow unpriv_userdomain $1:fd use;
3180 allow unpriv_userdomain $1:fifo_file rw_file_perms;
3181 allow unpriv_userdomain $1:process sigchld;
3184 ########################################
3186 ## Execute an Xserver session in all unprivileged user domains. This
3187 ## is an explicit transition, requiring the
3188 ## caller to use setexeccon().
3190 ## <param name="domain">
3192 ## Domain allowed to transition.
3196 interface(`userdom_xsession_spec_domtrans_unpriv_users',`
3198 attribute unpriv_userdomain;
3201 xserver_xsession_spec_domtrans($1, unpriv_userdomain)
3202 allow unpriv_userdomain $1:fd use;
3203 allow unpriv_userdomain $1:fifo_file rw_file_perms;
3204 allow unpriv_userdomain $1:process sigchld;
3207 ########################################
3209 ## Manage unpriviledged user SysV sempaphores.
3211 ## <param name="domain">
3213 ## Domain allowed access.
3217 interface(`userdom_manage_unpriv_user_semaphores',`
3219 attribute unpriv_userdomain;
3222 allow $1 unpriv_userdomain:sem create_sem_perms;
3225 ########################################
3227 ## Manage unpriviledged user SysV shared
3230 ## <param name="domain">
3232 ## Domain allowed access.
3236 interface(`userdom_manage_unpriv_user_shared_mem',`
3238 attribute unpriv_userdomain;
3241 allow $1 unpriv_userdomain:shm create_shm_perms;
3244 ########################################
3246 ## Execute bin_t in the unprivileged user domains. This
3247 ## is an explicit transition, requiring the
3248 ## caller to use setexeccon().
3250 ## <param name="domain">
3252 ## Domain allowed to transition.
3256 interface(`userdom_bin_spec_domtrans_unpriv_users',`
3258 attribute unpriv_userdomain;
3261 corecmd_bin_spec_domtrans($1, unpriv_userdomain)
3262 allow unpriv_userdomain $1:fd use;
3263 allow unpriv_userdomain $1:fifo_file rw_file_perms;
3264 allow unpriv_userdomain $1:process sigchld;
3267 ########################################
3269 ## Execute all entrypoint files in unprivileged user
3270 ## domains. This is an explicit transition, requiring the
3271 ## caller to use setexeccon().
3273 ## <param name="domain">
3275 ## Domain allowed access.
3279 interface(`userdom_entry_spec_domtrans_unpriv_users',`
3281 attribute unpriv_userdomain;
3284 domain_entry_file_spec_domtrans($1, unpriv_userdomain)
3285 allow unpriv_userdomain $1:fd use;
3286 allow unpriv_userdomain $1:fifo_file rw_fifo_file_perms;
3287 allow unpriv_userdomain $1:process sigchld;
3290 ########################################
3292 ## Search users home directories.
3294 ## <param name="domain">
3296 ## Domain allowed access.
3300 interface(`userdom_search_user_home_content',`
3302 type user_home_dir_t;
3303 attribute user_home_type;
3307 allow $1 { user_home_dir_t user_home_type }:dir search_dir_perms;
3308 allow $1 { user_home_dir_t user_home_type }:lnk_file read_lnk_file_perms;
3311 ########################################
3313 ## Send general signals to unprivileged user domains.
3315 ## <param name="domain">
3317 ## Domain allowed access.
3321 interface(`userdom_signal_unpriv_users',`
3323 attribute unpriv_userdomain;
3326 allow $1 unpriv_userdomain:process signal;
3329 ########################################
3331 ## Inherit the file descriptors from unprivileged user domains.
3333 ## <param name="domain">
3335 ## Domain allowed access.
3339 interface(`userdom_use_unpriv_users_fds',`
3341 attribute unpriv_userdomain;
3344 allow $1 unpriv_userdomain:fd use;
3347 ########################################
3349 ## Do not audit attempts to inherit the file descriptors
3350 ## from unprivileged user domains.
3354 ## Do not audit attempts to inherit the file descriptors
3355 ## from unprivileged user domains. This will supress
3356 ## SELinux denial messages when the specified domain is denied
3357 ## the permission to inherit these file descriptors.
3360 ## <param name="domain">
3362 ## Domain to not audit.
3365 ## <infoflow type="none"/>
3367 interface(`userdom_dontaudit_use_unpriv_user_fds',`
3369 attribute unpriv_userdomain;
3372 dontaudit $1 unpriv_userdomain:fd use;
3375 ########################################
3377 ## Do not audit attempts to use user ptys.
3379 ## <param name="domain">
3381 ## Domain to not audit.
3385 interface(`userdom_dontaudit_use_user_ptys',`
3390 dontaudit $1 user_devpts_t:chr_file rw_inherited_file_perms;
3393 ########################################
3395 ## Relabel files to unprivileged user pty types.
3397 ## <param name="domain">
3399 ## Domain allowed access.
3403 interface(`userdom_relabelto_user_ptys',`
3408 allow $1 user_devpts_t:chr_file relabelto;
3411 ########################################
3413 ## Do not audit attempts to relabel files from
3416 ## <param name="domain">
3418 ## Domain to not audit.
3422 interface(`userdom_dontaudit_relabelfrom_user_ptys',`
3427 dontaudit $1 user_devpts_t:chr_file relabelfrom;
3430 ########################################
3432 ## Write all users files in /tmp
3434 ## <param name="domain">
3436 ## Domain allowed access.
3440 interface(`userdom_write_user_tmp_files',`
3445 write_files_pattern($1, user_tmp_t, user_tmp_t)
3448 ########################################
3450 ## Do not audit attempts to write users
3453 ## <param name="domain">
3455 ## Domain to not audit.
3459 interface(`userdom_dontaudit_write_user_tmp_files',`
3464 dontaudit $1 user_tmp_t:file write;
3467 ########################################
3469 ## Do not audit attempts to read/write users
3470 ## temporary fifo files.
3472 ## <param name="domain">
3474 ## Domain to not audit.
3478 interface(`userdom_dontaudit_rw_user_tmp_pipes',`
3483 dontaudit $1 user_tmp_t:fifo_file rw_inherited_fifo_file_perms;
3486 ########################################
3488 ## Do not audit attempts to use user ttys.
3490 ## <param name="domain">
3492 ## Domain to not audit.
3496 interface(`userdom_dontaudit_use_user_ttys',`
3498 type user_tty_device_t;
3501 dontaudit $1 user_tty_device_t:chr_file rw_file_perms;
3504 ########################################
3506 ## Read the process state of all user domains.
3508 ## <param name="domain">
3510 ## Domain allowed access.
3514 interface(`userdom_read_all_users_state',`
3516 attribute userdomain;
3519 read_files_pattern($1, userdomain, userdomain)
3520 read_lnk_files_pattern($1,userdomain,userdomain)
3521 kernel_search_proc($1)
3524 ########################################
3526 ## Get the attributes of all user domains.
3528 ## <param name="domain">
3530 ## Domain allowed access.
3534 interface(`userdom_getattr_all_users',`
3536 attribute userdomain;
3539 allow $1 userdomain:process getattr;
3542 ########################################
3544 ## Inherit the file descriptors from all user domains
3546 ## <param name="domain">
3548 ## Domain allowed access.
3552 interface(`userdom_use_all_users_fds',`
3554 attribute userdomain;
3557 allow $1 userdomain:fd use;
3560 ########################################
3562 ## Do not audit attempts to inherit the file
3563 ## descriptors from any user domains.
3565 ## <param name="domain">
3567 ## Domain to not audit.
3571 interface(`userdom_dontaudit_use_all_users_fds',`
3573 attribute userdomain;
3576 dontaudit $1 userdomain:fd use;
3579 ########################################
3581 ## Send general signals to all user domains.
3583 ## <param name="domain">
3585 ## Domain allowed access.
3589 interface(`userdom_signal_all_users',`
3591 attribute userdomain;
3594 allow $1 userdomain:process signal;
3597 ########################################
3599 ## Send kill signals to all user domains.
3601 ## <param name="domain">
3603 ## Domain allowed access.
3607 interface(`userdom_kill_all_users',`
3609 attribute userdomain;
3612 allow $1 userdomain:process sigkill;
3615 ########################################
3617 ## Send a SIGCHLD signal to all user domains.
3619 ## <param name="domain">
3621 ## Domain allowed access.
3625 interface(`userdom_sigchld_all_users',`
3627 attribute userdomain;
3630 allow $1 userdomain:process sigchld;
3633 ########################################
3635 ## Create keys for all user domains.
3637 ## <param name="domain">
3639 ## Domain allowed access.
3643 interface(`userdom_create_all_users_keys',`
3645 attribute userdomain;
3648 allow $1 userdomain:key create;
3651 ########################################
3653 ## Send a dbus message to all user domains.
3655 ## <param name="domain">
3657 ## Domain allowed access.
3661 interface(`userdom_dbus_send_all_users',`
3663 attribute userdomain;
3664 class dbus send_msg;
3667 allow $1 userdomain:dbus send_msg;
3670 ########################################
3672 ## Allow apps to set rlimits on userdomain
3674 ## <param name="domain">
3676 ## Domain allowed access.
3680 interface(`userdom_set_rlimitnh',`
3682 attribute userdomain;
3685 allow $1 userdomain:process rlimitinh;
3688 ########################################
3690 ## Define this type as a Allow apps to set rlimits on userdomain
3692 ## <param name="domain">
3694 ## Domain allowed access.
3697 ## <param name="userdomain_prefix">
3699 ## The prefix of the user domain (e.g., user
3700 ## is the prefix for user_t).
3703 ## <param name="domain">
3705 ## Domain allowed access.
3709 template(`userdom_unpriv_usertype',`
3711 attribute unpriv_userdomain, userdomain;
3712 attribute $1_usertype;
3714 typeattribute $2 $1_usertype;
3715 typeattribute $2 unpriv_userdomain;
3716 typeattribute $2 userdomain;
3718 ubac_constrained($2)
3721 ########################################
3723 ## Connect to users over an unix stream socket.
3725 ## <param name="domain">
3727 ## Domain allowed access.
3731 interface(`userdom_stream_connect',`
3734 attribute userdomain;
3737 stream_connect_pattern($1, user_tmp_t, user_tmp_t, userdomain)
3740 ########################################
3742 ## Ptrace user domains.
3744 ## <param name="domain">
3746 ## Domain allowed access.
3750 interface(`userdom_ptrace_all_users',`
3752 attribute userdomain;
3755 allow $1 userdomain:process ptrace;
3758 ########################################
3760 ## dontaudit Search /root
3762 ## <param name="domain">
3764 ## Domain to not audit.
3768 interface(`userdom_dontaudit_search_admin_dir',`
3773 dontaudit $1 admin_home_t:dir search_dir_perms;
3776 ########################################
3778 ## dontaudit list /root
3780 ## <param name="domain">
3782 ## Domain to not audit.
3786 interface(`userdom_dontaudit_list_admin_dir',`
3791 dontaudit $1 admin_home_t:dir list_dir_perms;
3794 ########################################
3796 ## Allow domain to list /root
3798 ## <param name="domain">
3800 ## Domain allowed access.
3804 interface(`userdom_list_admin_dir',`
3809 allow $1 admin_home_t:dir list_dir_perms;
3812 ########################################
3814 ## Allow Search /root
3816 ## <param name="domain">
3818 ## Domain allowed access.
3822 interface(`userdom_search_admin_dir',`
3827 allow $1 admin_home_t:dir search_dir_perms;
3830 ########################################
3832 ## RW unpriviledged user SysV sempaphores.
3834 ## <param name="domain">
3836 ## Domain allowed access.
3840 interface(`userdom_rw_semaphores',`
3842 attribute unpriv_userdomain;
3845 allow $1 unpriv_userdomain:sem rw_sem_perms;
3848 ########################################
3850 ## Send a message to unpriv users over a unix domain
3853 ## <param name="domain">
3855 ## Domain allowed access.
3859 interface(`userdom_dgram_send',`
3861 attribute unpriv_userdomain;
3864 allow $1 unpriv_userdomain:unix_dgram_socket sendto;
3867 ######################################
3869 ## Send a message to users over a unix domain
3872 ## <param name="domain">
3874 ## Domain allowed access.
3878 interface(`userdom_users_dgram_send',`
3880 attribute userdomain;
3883 allow $1 userdomain:unix_dgram_socket sendto;
3886 #######################################
3888 ## Allow execmod on files in homedirectory
3890 ## <param name="domain">
3892 ## Domain allowed access.
3897 interface(`userdom_execmod_user_home_files',`
3899 type user_home_type;
3902 allow $1 user_home_type:file execmod;
3905 ########################################
3907 ## Read admin home files.
3909 ## <param name="domain">
3911 ## Domain allowed access.
3916 interface(`userdom_read_admin_home_files',`
3921 read_files_pattern($1, admin_home_t, admin_home_t)
3924 ########################################
3926 ## Execute admin home files.
3928 ## <param name="domain">
3930 ## Domain allowed access.
3935 interface(`userdom_exec_admin_home_files',`
3940 exec_files_pattern($1, admin_home_t, admin_home_t)
3943 ########################################
3945 ## Append files inherited
3946 ## in the /root directory.
3948 ## <param name="domain">
3950 ## Domain allowed access.
3954 interface(`userdom_inherit_append_admin_home_files',`
3959 allow $1 admin_home_t:file { getattr append };
3963 #######################################
3965 ## Manage all files/directories in the homedir
3967 ## <param name="userdomain">
3974 interface(`userdom_manage_user_home_content',`
3976 type user_home_dir_t, user_home_t;
3977 attribute user_home_type;
3981 manage_dirs_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
3982 manage_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
3983 manage_lnk_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
3984 manage_sock_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
3985 manage_fifo_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
3986 filetrans_pattern($1, user_home_dir_t, user_home_t, { dir file lnk_file sock_file fifo_file })
3991 ########################################
3993 ## Create objects in a user home directory
3994 ## with an automatic type transition to
3995 ## the user home file type.
3997 ## <param name="domain">
3999 ## Domain allowed access.
4002 ## <param name="object_class">
4004 ## The class of the object to be created.
4008 interface(`userdom_user_home_dir_filetrans_pattern',`
4010 type user_home_dir_t, user_home_t;
4013 type_transition $1 user_home_dir_t:$2 user_home_t;
4016 ########################################
4018 ## Create objects in the /root directory
4019 ## with an automatic type transition to
4020 ## a specified private type.
4022 ## <param name="domain">
4024 ## Domain allowed access.
4027 ## <param name="private_type">
4029 ## The type of the object to create.
4032 ## <param name="object_class">
4034 ## The class of the object to be created.
4038 interface(`userdom_admin_home_dir_filetrans',`
4043 filetrans_pattern($1, admin_home_t, $2, $3, $4)
4046 ########################################
4048 ## Send signull to unprivileged user domains.
4050 ## <param name="domain">
4052 ## Domain allowed access.
4056 interface(`userdom_signull_unpriv_users',`
4058 attribute unpriv_userdomain;
4061 allow $1 unpriv_userdomain:process signull;
4064 ########################################
4066 ## Write all users files in /tmp
4068 ## <param name="domain">
4070 ## Domain allowed access.
4074 interface(`userdom_write_user_tmp_dirs',`
4079 write_files_pattern($1, user_tmp_t, user_tmp_t)
4082 ########################################
4084 ## Manage keys for all user domains.
4086 ## <param name="domain">
4088 ## Domain allowed access.
4092 interface(`userdom_manage_all_users_keys',`
4094 attribute userdomain;
4097 allow $1 userdomain:key manage_key_perms;
4101 ########################################
4103 ## Do not audit attempts to read and write
4104 ## unserdomain stream.
4106 ## <param name="domain">
4108 ## Domain to not audit.
4112 interface(`userdom_dontaudit_rw_stream',`
4114 attribute userdomain;
4117 dontaudit $1 userdomain:unix_stream_socket rw_socket_perms;
4120 ########################################
4122 ## Do not audit attempts to read and write
4123 ## unserdomain datagram socket.
4125 ## <param name="domain">
4127 ## Domain to not audit.
4131 interface(`userdom_dontaudit_rw_dgram_socket',`
4133 attribute userdomain;
4136 dontaudit $1 userdomain:unix_dgram_socket { read write };
4139 ########################################
4142 ## in a user home subdirectory.
4144 ## <param name="domain">
4146 ## Domain allowed access.
4150 interface(`userdom_append_user_home_content_files',`
4152 type user_home_dir_t, user_home_t;
4155 append_files_pattern($1, user_home_t, user_home_t)
4156 allow $1 user_home_dir_t:dir search_dir_perms;
4157 files_search_home($1)
4160 ########################################
4162 ## Read files inherited
4163 ## in a user home subdirectory.
4165 ## <param name="domain">
4167 ## Domain allowed access.
4171 interface(`userdom_read_inherited_user_home_content_files',`
4173 attribute user_home_type;
4176 allow $1 user_home_type:file { getattr read };
4179 ########################################
4181 ## Append files inherited
4182 ## in a user home subdirectory.
4184 ## <param name="domain">
4186 ## Domain allowed access.
4190 interface(`userdom_inherit_append_user_home_content_files',`
4195 allow $1 user_home_t:file { getattr append };
4198 ########################################
4200 ## Append files inherited
4201 ## in a user tmp files.
4203 ## <param name="domain">
4205 ## Domain allowed access.
4209 interface(`userdom_inherit_append_user_tmp_files',`
4214 allow $1 user_tmp_t:file { getattr append };
4217 ######################################
4219 ## Read audio files in the users homedir.
4221 ## <param name="domain">
4223 ## Domain allowed access.
4228 interface(`userdom_read_home_audio_files',`
4233 userdom_search_user_home_dirs($1)
4234 allow $1 audio_home_t:dir list_dir_perms;
4235 read_files_pattern($1, audio_home_t, audio_home_t)
4236 read_lnk_files_pattern($1, audio_home_t, audio_home_t)
4239 ########################################
4241 ## Do not audit attempts to write all user home content files.
4243 ## <param name="domain">
4245 ## Domain to not audit.
4249 interface(`userdom_dontaudit_write_all_user_home_content_files',`
4251 attribute user_home_type;
4254 dontaudit $1 user_home_type:file write_file_perms;
4257 ########################################
4259 ## Do not audit attempts to write all user tmp content files.
4261 ## <param name="domain">
4263 ## Domain to not audit.
4267 interface(`userdom_dontaudit_write_all_user_tmp_content_files',`
4269 attribute user_tmp_type;
4272 dontaudit $1 user_tmp_type:file write_file_perms;
4275 ########################################
4277 ## Manage all user temporary content.
4279 ## <param name="domain">
4281 ## Domain allowed access.
4285 interface(`userdom_manage_all_user_tmp_content',`
4287 attribute user_tmp_type;
4290 manage_dirs_pattern($1, user_tmp_type, user_tmp_type)
4291 manage_files_pattern($1, user_tmp_type, user_tmp_type)
4292 manage_lnk_files_pattern($1, user_tmp_type, user_tmp_type)
4293 manage_sock_files_pattern($1, user_tmp_type, user_tmp_type)
4294 manage_fifo_files_pattern($1, user_tmp_type, user_tmp_type)
4295 files_search_tmp($1)
4298 ########################################
4300 ## List all user temporary content.
4302 ## <param name="domain">
4304 ## Domain allowed access.
4308 interface(`userdom_list_all_user_tmp_content',`
4310 attribute user_tmp_type;
4313 list_dirs_pattern($1, user_tmp_type, user_tmp_type)
4314 getattr_files_pattern($1, user_tmp_type, user_tmp_type)
4315 read_lnk_files_pattern($1, user_tmp_type, user_tmp_type)
4316 getattr_sock_files_pattern($1, user_tmp_type, user_tmp_type)
4317 getattr_fifo_files_pattern($1, user_tmp_type, user_tmp_type)
4318 files_search_var($1)
4319 files_search_tmp($1)
4322 ########################################
4324 ## Manage all user tmpfs content.
4326 ## <param name="domain">
4328 ## Domain allowed access.
4332 interface(`userdom_manage_all_user_tmpfs_content',`
4334 attribute user_tmpfs_type;
4337 manage_dirs_pattern($1, user_tmpfs_type, user_tmpfs_type)
4338 manage_files_pattern($1, user_tmpfs_type, user_tmpfs_type)
4339 manage_lnk_files_pattern($1, user_tmpfs_type, user_tmpfs_type)
4340 manage_sock_files_pattern($1, user_tmpfs_type, user_tmpfs_type)
4341 manage_fifo_files_pattern($1, user_tmpfs_type, user_tmpfs_type)
4345 ########################################
4347 ## Delete all user temporary content.
4349 ## <param name="domain">
4351 ## Domain allowed access.
4355 interface(`userdom_delete_all_user_tmp_content',`
4357 attribute user_tmp_type;
4360 delete_dirs_pattern($1, user_tmp_type, user_tmp_type)
4361 delete_files_pattern($1, user_tmp_type, user_tmp_type)
4362 delete_lnk_files_pattern($1, user_tmp_type, user_tmp_type)
4363 delete_sock_files_pattern($1, user_tmp_type, user_tmp_type)
4364 delete_fifo_files_pattern($1, user_tmp_type, user_tmp_type)
4366 files_search_var($1)
4367 files_delete_tmp_dir_entry($1)
4370 ########################################
4372 ## Read system SSL certificates in the users homedir.
4374 ## <param name="domain">
4376 ## Domain allowed access.
4380 interface(`userdom_read_home_certs',`
4385 userdom_search_user_home_content($1)
4386 allow $1 home_cert_t:dir list_dir_perms;
4387 read_files_pattern($1, home_cert_t, home_cert_t)
4388 read_lnk_files_pattern($1, home_cert_t, home_cert_t)
4391 #######################################
4393 ## Dontaudit Write system SSL certificates in the users homedir.
4395 ## <param name="domain">
4397 ## Domain to not audit.
4401 interface(`userdom_dontaudit_write_home_certs',`
4406 dontaudit $1 home_cert_t:file write;
4409 ########################################
4411 ## dontaudit Search getatrr /root files
4413 ## <param name="domain">
4415 ## Domain to not audit.
4419 interface(`userdom_dontaudit_getattr_admin_home_files',`
4424 dontaudit $1 admin_home_t:file getattr;
4427 ########################################
4429 ## dontaudit read /root lnk files
4431 ## <param name="domain">
4433 ## Domain to not audit.
4437 interface(`userdom_dontaudit_read_admin_home_lnk_files',`
4442 dontaudit $1 admin_home_t:lnk_file read;
4445 ########################################
4447 ## dontaudit read /root files
4449 ## <param name="domain">
4451 ## Domain to not audit.
4455 interface(`userdom_dontaudit_read_admin_home_files',`
4460 dontaudit $1 admin_home_t:file read_file_perms;
4463 ########################################
4465 ## Create, read, write, and delete user
4466 ## temporary chr files.
4468 ## <param name="domain">
4470 ## Domain allowed access.
4474 interface(`userdom_manage_user_tmp_chr_files',`
4479 manage_chr_files_pattern($1, user_tmp_t, user_tmp_t)
4480 files_search_tmp($1)
4483 ########################################
4485 ## Create, read, write, and delete user
4486 ## temporary blk files.
4488 ## <param name="domain">
4490 ## Domain allowed access.
4494 interface(`userdom_manage_user_tmp_blk_files',`
4499 manage_blk_files_pattern($1, user_tmp_t, user_tmp_t)
4500 files_search_tmp($1)
4503 ########################################
4505 ## Dontaudit attempt to set attributes on user temporary directories.
4507 ## <param name="domain">
4509 ## Domain to not audit.
4513 interface(`userdom_dontaudit_setattr_user_tmp',`
4518 dontaudit $1 user_tmp_t:dir setattr;
4521 ########################################
4523 ## Write all inherited users files in /tmp
4525 ## <param name="domain">
4527 ## Domain allowed access.
4531 interface(`userdom_write_inherited_user_tmp_files',`
4536 allow $1 user_tmp_t:file write;
4539 ########################################
4541 ## Delete all users files in /tmp
4543 ## <param name="domain">
4545 ## Domain allowed access.
4549 interface(`userdom_delete_user_tmp_files',`
4554 allow $1 user_tmp_t:file delete_file_perms;
4557 ########################################
4559 ## Delete user tmpfs files.
4561 ## <param name="domain">
4563 ## Domain allowed access.
4567 interface(`userdom_delete_user_tmpfs_files',`
4572 allow $1 user_tmpfs_t:file delete_file_perms;
4575 ########################################
4577 ## Read/Write unpriviledged user SysV shared
4580 ## <param name="domain">
4582 ## Domain allowed access.
4586 interface(`userdom_rw_unpriv_user_shared_mem',`
4588 attribute unpriv_userdomain;
4591 allow $1 unpriv_userdomain:shm rw_shm_perms;
4594 ########################################
4596 ## Do not audit attempts to search user
4597 ## temporary directories.
4599 ## <param name="domain">
4601 ## Domain to not audit.
4605 interface(`userdom_dontaudit_search_user_tmp',`
4610 dontaudit $1 user_tmp_t:dir search_dir_perms;
4613 ########################################
4615 ## Execute a file in a user home directory
4616 ## in the specified domain.
4620 ## Execute a file in a user home directory
4621 ## in the specified domain.
4624 ## No interprocess communication (signals, pipes,
4625 ## etc.) is provided by this interface since
4626 ## the domains are not owned by this module.
4629 ## <param name="domain">
4631 ## Domain allowed access.
4634 ## <param name="target_domain">
4636 ## The type of the new process.
4640 interface(`userdom_domtrans_user_home',`
4645 read_lnk_files_pattern($1, user_home_t, user_home_t)
4646 domain_transition_pattern($1, user_home_t, $2)
4647 type_transition $1 user_home_t:process $2;
4650 ########################################
4652 ## Execute a file in a user tmp directory
4653 ## in the specified domain.
4657 ## Execute a file in a user tmp directory
4658 ## in the specified domain.
4661 ## No interprocess communication (signals, pipes,
4662 ## etc.) is provided by this interface since
4663 ## the domains are not owned by this module.
4666 ## <param name="domain">
4668 ## Domain allowed access.
4671 ## <param name="target_domain">
4673 ## The type of the new process.
4677 interface(`userdom_domtrans_user_tmp',`
4682 files_search_tmp($1)
4683 read_lnk_files_pattern($1, user_tmp_t, user_tmp_t)
4684 domain_transition_pattern($1, user_tmp_t, $2)
4685 type_transition $1 user_tmp_t:process $2;
4688 ########################################
4690 ## Do not audit attempts to read all user home content files.
4692 ## <param name="domain">
4694 ## Domain to not audit.
4698 interface(`userdom_dontaudit_read_all_user_home_content_files',`
4700 attribute user_home_type;
4703 dontaudit $1 user_home_type:file read_file_perms;
4706 ########################################
4708 ## Do not audit attempts to read all user tmp content files.
4710 ## <param name="domain">
4712 ## Domain to not audit.
4716 interface(`userdom_dontaudit_read_all_user_tmp_content_files',`
4718 attribute user_tmp_type;
4721 dontaudit $1 user_tmp_type:file read_file_perms;