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)
1530 consoletype_exec($1)
1538 ipsec_run_setkey($1,$2)
1542 netlabel_run_mgmt($1,$2)
1550 ########################################
1552 ## Make the specified type usable in a
1553 ## user home directory.
1555 ## <param name="type">
1557 ## Type to be used as a file in the
1558 ## user home directory.
1562 interface(`userdom_user_home_content',`
1565 attribute user_home_type;
1568 allow $1 user_home_t:filesystem associate;
1570 ubac_constrained($1)
1572 files_poly_member($1)
1573 typeattribute $1 user_home_type;
1576 ########################################
1578 ## Make the specified type usable in a
1579 ## generic temporary directory.
1581 ## <param name="type">
1583 ## Type to be used as a file in the
1584 ## generic temporary directory.
1588 interface(`userdom_user_tmp_content',`
1590 attribute user_tmp_type;
1593 typeattribute $1 user_tmp_type;
1596 ubac_constrained($1)
1599 ########################################
1601 ## Allow domain to attach to TUN devices created by administrative users.
1603 ## <param name="domain">
1605 ## Domain allowed access.
1609 interface(`userdom_attach_admin_tun_iface',`
1611 attribute admindomain;
1614 allow $1 admindomain:tun_socket relabelfrom;
1615 allow $1 self:tun_socket relabelto;
1618 ########################################
1620 ## Set the attributes of a user pty.
1622 ## <param name="domain">
1624 ## Domain allowed access.
1628 interface(`userdom_setattr_user_ptys',`
1633 allow $1 user_devpts_t:chr_file setattr_chr_file_perms;
1636 ########################################
1638 ## Create a user pty.
1640 ## <param name="domain">
1642 ## Domain allowed access.
1646 interface(`userdom_create_user_pty',`
1651 term_create_pty($1, user_devpts_t)
1654 ########################################
1656 ## Get the attributes of user home directories.
1658 ## <param name="domain">
1660 ## Domain allowed access.
1664 interface(`userdom_getattr_user_home_dirs',`
1666 type user_home_dir_t;
1669 allow $1 user_home_dir_t:dir getattr_dir_perms;
1670 files_search_home($1)
1673 ########################################
1675 ## Do not audit attempts to get the attributes of user home directories.
1677 ## <param name="domain">
1679 ## Domain to not audit.
1683 interface(`userdom_dontaudit_getattr_user_home_dirs',`
1685 type user_home_dir_t;
1688 dontaudit $1 user_home_dir_t:dir getattr_dir_perms;
1691 ########################################
1693 ## Search user home directories.
1695 ## <param name="domain">
1697 ## Domain allowed access.
1701 interface(`userdom_search_user_home_dirs',`
1703 type user_home_dir_t;
1706 allow $1 user_home_dir_t:dir search_dir_perms;
1707 allow $1 user_home_dir_t:lnk_file read_lnk_file_perms;
1708 files_search_home($1)
1711 ########################################
1713 ## Do not audit attempts to search user home directories.
1717 ## Do not audit attempts to search user home directories.
1718 ## This will supress SELinux denial messages when the specified
1719 ## domain is denied the permission to search these directories.
1722 ## <param name="domain">
1724 ## Domain to not audit.
1727 ## <infoflow type="none"/>
1729 interface(`userdom_dontaudit_search_user_home_dirs',`
1731 type user_home_dir_t;
1734 dontaudit $1 user_home_dir_t:dir search_dir_perms;
1737 ########################################
1739 ## List user home directories.
1741 ## <param name="domain">
1743 ## Domain allowed access.
1747 interface(`userdom_list_user_home_dirs',`
1749 type user_home_dir_t;
1752 allow $1 user_home_dir_t:dir list_dir_perms;
1753 files_search_home($1)
1755 tunable_policy(`use_nfs_home_dirs',`
1759 tunable_policy(`use_samba_home_dirs',`
1764 ########################################
1766 ## Do not audit attempts to list user home subdirectories.
1768 ## <param name="domain">
1770 ## Domain to not audit.
1774 interface(`userdom_dontaudit_list_user_home_dirs',`
1776 type user_home_dir_t;
1780 dontaudit $1 user_home_dir_t:dir list_dir_perms;
1781 dontaudit $1 user_home_t:dir list_dir_perms;
1784 ########################################
1786 ## Create user home directories.
1788 ## <param name="domain">
1790 ## Domain allowed access.
1794 interface(`userdom_create_user_home_dirs',`
1796 type user_home_dir_t;
1799 allow $1 user_home_dir_t:dir create_dir_perms;
1802 ########################################
1804 ## Create user home directories.
1806 ## <param name="domain">
1808 ## Domain allowed access.
1812 interface(`userdom_manage_user_home_dirs',`
1814 type user_home_dir_t;
1817 allow $1 user_home_dir_t:dir manage_dir_perms;
1820 ########################################
1822 ## Relabel to user home directories.
1824 ## <param name="domain">
1826 ## Domain allowed access.
1830 interface(`userdom_relabelto_user_home_dirs',`
1832 type user_home_dir_t;
1835 allow $1 user_home_dir_t:dir relabelto;
1839 ########################################
1841 ## Relabel to user home files.
1843 ## <param name="domain">
1845 ## Domain allowed access.
1849 interface(`userdom_relabelto_user_home_files',`
1854 allow $1 user_home_t:file relabelto;
1856 ########################################
1858 ## Relabel user home files.
1860 ## <param name="domain">
1862 ## Domain allowed access.
1866 interface(`userdom_relabel_user_home_files',`
1871 allow $1 user_home_t:file relabel_file_perms;
1874 ########################################
1876 ## Create directories in the home dir root with
1877 ## the user home directory type.
1879 ## <param name="domain">
1881 ## Domain allowed access.
1885 interface(`userdom_home_filetrans_user_home_dir',`
1887 type user_home_dir_t;
1890 files_home_filetrans($1, user_home_dir_t, dir)
1893 ########################################
1895 ## Do a domain transition to the specified
1896 ## domain when executing a program in the
1897 ## user home directory.
1901 ## Do a domain transition to the specified
1902 ## domain when executing a program in the
1903 ## user home directory.
1906 ## No interprocess communication (signals, pipes,
1907 ## etc.) is provided by this interface since
1908 ## the domains are not owned by this module.
1911 ## <param name="source_domain">
1913 ## Domain allowed to transition.
1916 ## <param name="target_domain">
1918 ## Domain to transition to.
1922 interface(`userdom_user_home_domtrans',`
1924 type user_home_dir_t, user_home_t;
1927 domain_auto_trans($1, user_home_t, $2)
1928 allow $1 user_home_dir_t:dir search_dir_perms;
1929 files_search_home($1)
1932 ########################################
1934 ## Do not audit attempts to search user home content directories.
1936 ## <param name="domain">
1938 ## Domain to not audit.
1942 interface(`userdom_dontaudit_search_user_home_content',`
1947 dontaudit $1 user_home_t:dir search_dir_perms;
1948 fs_dontaudit_list_nfs($1)
1949 fs_dontaudit_list_cifs($1)
1952 ########################################
1954 ## List contents of users home directory.
1956 ## <param name="domain">
1958 ## Domain allowed access.
1962 interface(`userdom_list_user_home_content',`
1964 type user_home_dir_t;
1965 attribute user_home_type;
1969 allow $1 { user_home_dir_t user_home_type }:dir list_dir_perms;
1972 ########################################
1974 ## Create, read, write, and delete directories
1975 ## in a user home subdirectory.
1977 ## <param name="domain">
1979 ## Domain allowed access.
1983 interface(`userdom_manage_user_home_content_dirs',`
1985 type user_home_dir_t, user_home_t;
1988 manage_dirs_pattern($1, { user_home_dir_t user_home_t }, user_home_t)
1989 files_search_home($1)
1992 ########################################
1994 ## Delete directories in a user home subdirectory.
1996 ## <param name="domain">
1998 ## Domain allowed access.
2002 interface(`userdom_delete_user_home_content_dirs',`
2007 allow $1 user_home_t:dir delete_dir_perms;
2010 ########################################
2012 ## Set the attributes of user home files.
2014 ## <param name="domain">
2016 ## Domain allowed access.
2021 interface(`userdom_setattr_user_home_content_files',`
2026 allow $1 user_home_t:file setattr;
2029 ########################################
2031 ## Do not audit attempts to set the
2032 ## attributes of user home files.
2034 ## <param name="domain">
2036 ## Domain to not audit.
2040 interface(`userdom_dontaudit_setattr_user_home_content_files',`
2045 dontaudit $1 user_home_t:file setattr_file_perms;
2048 ########################################
2050 ## Mmap user home files.
2052 ## <param name="domain">
2054 ## Domain allowed access.
2058 interface(`userdom_mmap_user_home_content_files',`
2060 type user_home_dir_t, user_home_t;
2063 mmap_files_pattern($1, { user_home_dir_t user_home_t }, user_home_t)
2064 files_search_home($1)
2067 ########################################
2069 ## Read user home files.
2071 ## <param name="domain">
2073 ## Domain allowed access.
2077 interface(`userdom_read_user_home_content_files',`
2079 type user_home_dir_t, user_home_t;
2082 list_dirs_pattern($1, { user_home_dir_t user_home_t }, { user_home_dir_t user_home_t })
2083 read_files_pattern($1, { user_home_dir_t user_home_t }, user_home_t)
2084 files_search_home($1)
2087 ########################################
2089 ## Do not audit attempts to getattr user home files.
2091 ## <param name="domain">
2093 ## Domain to not audit.
2097 interface(`userdom_dontaudit_getattr_user_home_content',`
2099 attribute user_home_type;
2102 dontaudit $1 user_home_type:dir getattr;
2103 dontaudit $1 user_home_type:file getattr;
2106 ########################################
2108 ## Do not audit attempts to read user home files.
2110 ## <param name="domain">
2112 ## Domain to not audit.
2116 interface(`userdom_dontaudit_read_user_home_content_files',`
2118 attribute user_home_type;
2119 type user_home_dir_t;
2122 dontaudit $1 user_home_dir_t:dir list_dir_perms;
2123 dontaudit $1 user_home_type:dir list_dir_perms;
2124 dontaudit $1 user_home_type:file read_file_perms;
2125 dontaudit $1 user_home_type:lnk_file read_lnk_file_perms;
2128 ########################################
2130 ## Do not audit attempts to append user home files.
2132 ## <param name="domain">
2134 ## Domain to not audit.
2138 interface(`userdom_dontaudit_append_user_home_content_files',`
2143 dontaudit $1 user_home_t:file append_file_perms;
2146 ########################################
2148 ## Do not audit attempts to write user home files.
2150 ## <param name="domain">
2152 ## Domain to not audit.
2156 interface(`userdom_dontaudit_write_user_home_content_files',`
2161 dontaudit $1 user_home_t:file write_file_perms;
2164 ########################################
2166 ## Delete files in a user home subdirectory.
2168 ## <param name="domain">
2170 ## Domain allowed access.
2174 interface(`userdom_delete_user_home_content_files',`
2179 allow $1 user_home_t:file delete_file_perms;
2182 ########################################
2184 ## Delete sock files in a user home subdirectory.
2186 ## <param name="domain">
2188 ## Domain allowed access.
2192 interface(`userdom_delete_user_home_content_sock_files',`
2197 allow $1 user_home_t:sock_file delete_file_perms;
2200 ########################################
2202 ## Do not audit attempts to write user home files.
2204 ## <param name="domain">
2206 ## Domain to not audit.
2210 interface(`userdom_dontaudit_relabel_user_home_content_files',`
2215 dontaudit $1 user_home_t:file relabel_file_perms;
2218 ########################################
2220 ## Read user home subdirectory symbolic links.
2222 ## <param name="domain">
2224 ## Domain allowed access.
2228 interface(`userdom_read_user_home_content_symlinks',`
2230 type user_home_dir_t, user_home_t;
2233 allow $1 { user_home_dir_t user_home_t }:lnk_file read_lnk_file_perms;
2236 ########################################
2238 ## Execute user home files.
2240 ## <param name="domain">
2242 ## Domain allowed access.
2247 interface(`userdom_exec_user_home_content_files',`
2249 type user_home_dir_t;
2250 attribute user_home_type;
2253 files_search_home($1)
2254 exec_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
2255 dontaudit $1 user_home_type:sock_file execute;
2258 ########################################
2260 ## Do not audit attempts to execute user home files.
2262 ## <param name="domain">
2264 ## Domain to not audit.
2268 interface(`userdom_dontaudit_exec_user_home_content_files',`
2273 dontaudit $1 user_home_t:file exec_file_perms;
2276 ########################################
2278 ## Create, read, write, and delete files
2279 ## in a user home subdirectory.
2281 ## <param name="domain">
2283 ## Domain allowed access.
2287 interface(`userdom_manage_user_home_content_files',`
2289 type user_home_dir_t, user_home_t;
2292 manage_files_pattern($1, user_home_t, user_home_t)
2293 allow $1 user_home_dir_t:dir search_dir_perms;
2294 files_search_home($1)
2297 ########################################
2299 ## Do not audit attempts to create, read, write, and delete directories
2300 ## in a user home subdirectory.
2302 ## <param name="domain">
2304 ## Domain to not audit.
2308 interface(`userdom_dontaudit_manage_user_home_content_dirs',`
2310 type user_home_dir_t, user_home_t;
2313 dontaudit $1 user_home_t:dir manage_dir_perms;
2316 ########################################
2318 ## Create, read, write, and delete symbolic links
2319 ## in a user home subdirectory.
2321 ## <param name="domain">
2323 ## Domain allowed access.
2327 interface(`userdom_manage_user_home_content_symlinks',`
2329 type user_home_dir_t, user_home_t;
2332 manage_lnk_files_pattern($1, user_home_t, user_home_t)
2333 allow $1 user_home_dir_t:dir search_dir_perms;
2334 files_search_home($1)
2337 ########################################
2339 ## Delete symbolic links in a user home directory.
2341 ## <param name="domain">
2343 ## Domain allowed access.
2347 interface(`userdom_delete_user_home_content_symlinks',`
2352 allow $1 user_home_t:lnk_file delete_lnk_file_perms;
2355 ########################################
2357 ## Create, read, write, and delete named pipes
2358 ## in a user home subdirectory.
2360 ## <param name="domain">
2362 ## Domain allowed access.
2366 interface(`userdom_manage_user_home_content_pipes',`
2368 type user_home_dir_t, user_home_t;
2371 manage_fifo_files_pattern($1, user_home_t, user_home_t)
2372 allow $1 user_home_dir_t:dir search_dir_perms;
2373 files_search_home($1)
2376 ########################################
2378 ## Create, read, write, and delete named sockets
2379 ## in a user home subdirectory.
2381 ## <param name="domain">
2383 ## Domain allowed access.
2387 interface(`userdom_manage_user_home_content_sockets',`
2389 type user_home_dir_t, user_home_t;
2392 allow $1 user_home_dir_t:dir search_dir_perms;
2393 manage_sock_files_pattern($1, user_home_t, user_home_t)
2394 files_search_home($1)
2397 ########################################
2399 ## Create objects in a user home directory
2400 ## with an automatic type transition to
2401 ## a specified private type.
2403 ## <param name="domain">
2405 ## Domain allowed access.
2408 ## <param name="private_type">
2410 ## The type of the object to create.
2413 ## <param name="object_class">
2415 ## The class of the object to be created.
2419 interface(`userdom_user_home_dir_filetrans',`
2421 type user_home_dir_t;
2424 filetrans_pattern($1, user_home_dir_t, $2, $3, $4)
2425 files_search_home($1)
2428 ########################################
2430 ## Create objects in a user home directory
2431 ## with an automatic type transition to
2432 ## a specified private type.
2434 ## <param name="domain">
2436 ## Domain allowed access.
2439 ## <param name="private_type">
2441 ## The type of the object to create.
2444 ## <param name="object_class">
2446 ## The class of the object to be created.
2450 interface(`userdom_user_home_content_filetrans',`
2452 type user_home_dir_t, user_home_t;
2455 filetrans_pattern($1, user_home_t, $2, $3)
2456 allow $1 user_home_dir_t:dir search_dir_perms;
2457 files_search_home($1)
2460 ########################################
2462 ## Create objects in a user home directory
2463 ## with an automatic type transition to
2464 ## the user home file type.
2466 ## <param name="domain">
2468 ## Domain allowed access.
2471 ## <param name="object_class">
2473 ## The class of the object to be created.
2477 interface(`userdom_user_home_dir_filetrans_user_home_content',`
2479 type user_home_dir_t, user_home_t;
2482 filetrans_pattern($1, user_home_dir_t, user_home_t, $2)
2483 files_search_home($1)
2486 ########################################
2488 ## Write to user temporary named sockets.
2490 ## <param name="domain">
2492 ## Domain allowed access.
2496 interface(`userdom_write_user_tmp_sockets',`
2501 allow $1 user_tmp_t:sock_file write_sock_file_perms;
2502 files_search_tmp($1)
2505 ########################################
2507 ## List user temporary directories.
2509 ## <param name="domain">
2511 ## Domain allowed access.
2515 interface(`userdom_list_user_tmp',`
2520 allow $1 user_tmp_t:dir list_dir_perms;
2521 files_search_tmp($1)
2524 ########################################
2526 ## Do not audit attempts to list user
2527 ## temporary directories.
2529 ## <param name="domain">
2531 ## Domain to not audit.
2535 interface(`userdom_dontaudit_list_user_tmp',`
2540 dontaudit $1 user_tmp_t:dir list_dir_perms;
2543 ########################################
2545 ## Do not audit attempts to manage users
2546 ## temporary directories.
2548 ## <param name="domain">
2550 ## Domain to not audit.
2554 interface(`userdom_dontaudit_manage_user_tmp_dirs',`
2559 dontaudit $1 user_tmp_t:dir manage_dir_perms;
2562 ########################################
2564 ## Read user temporary files.
2566 ## <param name="domain">
2568 ## Domain allowed access.
2572 interface(`userdom_read_user_tmp_files',`
2577 read_files_pattern($1, user_tmp_t, user_tmp_t)
2578 allow $1 user_tmp_t:dir list_dir_perms;
2579 files_search_tmp($1)
2582 ########################################
2584 ## Do not audit attempts to read users
2587 ## <param name="domain">
2589 ## Domain to not audit.
2593 interface(`userdom_dontaudit_read_user_tmp_files',`
2598 dontaudit $1 user_tmp_t:file read_inherited_file_perms;
2601 ########################################
2603 ## Do not audit attempts to append users
2606 ## <param name="domain">
2608 ## Domain to not audit.
2612 interface(`userdom_dontaudit_append_user_tmp_files',`
2617 dontaudit $1 user_tmp_t:file append_file_perms;
2620 ########################################
2622 ## Read and write user temporary files.
2624 ## <param name="domain">
2626 ## Domain allowed access.
2630 interface(`userdom_rw_user_tmp_files',`
2635 allow $1 user_tmp_t:dir list_dir_perms;
2636 rw_files_pattern($1, user_tmp_t, user_tmp_t)
2637 files_search_tmp($1)
2640 ########################################
2642 ## Do not audit attempts to manage users
2645 ## <param name="domain">
2647 ## Domain to not audit.
2651 interface(`userdom_dontaudit_manage_user_tmp_files',`
2656 dontaudit $1 user_tmp_t:file manage_file_perms;
2659 ########################################
2661 ## Read user temporary symbolic links.
2663 ## <param name="domain">
2665 ## Domain allowed access.
2669 interface(`userdom_read_user_tmp_symlinks',`
2674 read_lnk_files_pattern($1, user_tmp_t, user_tmp_t)
2675 allow $1 user_tmp_t:dir list_dir_perms;
2676 files_search_tmp($1)
2679 ########################################
2681 ## Create, read, write, and delete user
2682 ## temporary directories.
2684 ## <param name="domain">
2686 ## Domain allowed access.
2690 interface(`userdom_manage_user_tmp_dirs',`
2695 manage_dirs_pattern($1, user_tmp_t, user_tmp_t)
2696 files_search_tmp($1)
2699 ########################################
2701 ## Create, read, write, and delete user
2704 ## <param name="domain">
2706 ## Domain allowed access.
2710 interface(`userdom_manage_user_tmp_files',`
2715 manage_files_pattern($1, user_tmp_t, user_tmp_t)
2716 files_search_tmp($1)
2719 ########################################
2721 ## Create, read, write, and delete user
2722 ## temporary symbolic links.
2724 ## <param name="domain">
2726 ## Domain allowed access.
2730 interface(`userdom_manage_user_tmp_symlinks',`
2735 manage_lnk_files_pattern($1, user_tmp_t, user_tmp_t)
2736 files_search_tmp($1)
2739 ########################################
2741 ## Create, read, write, and delete user
2742 ## temporary named pipes.
2744 ## <param name="domain">
2746 ## Domain allowed access.
2750 interface(`userdom_manage_user_tmp_pipes',`
2755 manage_fifo_files_pattern($1, user_tmp_t, user_tmp_t)
2756 files_search_tmp($1)
2759 ########################################
2761 ## Create, read, write, and delete user
2762 ## temporary named sockets.
2764 ## <param name="domain">
2766 ## Domain allowed access.
2770 interface(`userdom_manage_user_tmp_sockets',`
2775 manage_sock_files_pattern($1, user_tmp_t, user_tmp_t)
2776 files_search_tmp($1)
2779 ########################################
2781 ## Create objects in a user temporary directory
2782 ## with an automatic type transition to
2783 ## a specified private type.
2785 ## <param name="domain">
2787 ## Domain allowed access.
2790 ## <param name="private_type">
2792 ## The type of the object to create.
2795 ## <param name="object_class">
2797 ## The class of the object to be created.
2801 interface(`userdom_user_tmp_filetrans',`
2806 filetrans_pattern($1, user_tmp_t, $2, $3)
2807 files_search_tmp($1)
2810 ########################################
2812 ## Create objects in the temporary directory
2813 ## with an automatic type transition to
2814 ## the user temporary type.
2816 ## <param name="domain">
2818 ## Domain allowed access.
2821 ## <param name="object_class">
2823 ## The class of the object to be created.
2827 interface(`userdom_tmp_filetrans_user_tmp',`
2832 files_tmp_filetrans($1, user_tmp_t, $2)
2835 ########################################
2837 ## Read user tmpfs files.
2839 ## <param name="domain">
2841 ## Domain allowed access.
2845 interface(`userdom_read_user_tmpfs_files',`
2850 read_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
2851 read_lnk_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
2852 allow $1 user_tmpfs_t:dir list_dir_perms;
2856 ########################################
2858 ## Read/Write user tmpfs files.
2860 ## <param name="domain">
2862 ## Domain allowed access.
2866 interface(`userdom_rw_user_tmpfs_files',`
2871 rw_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
2872 read_lnk_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
2873 allow $1 user_tmpfs_t:dir list_dir_perms;
2877 ########################################
2879 ## Get the attributes of a user domain tty.
2881 ## <param name="domain">
2883 ## Domain allowed access.
2887 interface(`userdom_getattr_user_ttys',`
2889 type user_tty_device_t;
2892 allow $1 user_tty_device_t:chr_file getattr_chr_file_perms;
2895 ########################################
2897 ## Do not audit attempts to get the attributes of a user domain tty.
2899 ## <param name="domain">
2901 ## Domain to not audit.
2905 interface(`userdom_dontaudit_getattr_user_ttys',`
2907 type user_tty_device_t;
2910 dontaudit $1 user_tty_device_t:chr_file getattr_chr_file_perms;
2913 ########################################
2915 ## Set the attributes of a user domain tty.
2917 ## <param name="domain">
2919 ## Domain allowed access.
2923 interface(`userdom_setattr_user_ttys',`
2925 type user_tty_device_t;
2928 allow $1 user_tty_device_t:chr_file setattr_chr_file_perms;
2931 ########################################
2933 ## Do not audit attempts to set the attributes of a user domain tty.
2935 ## <param name="domain">
2937 ## Domain to not audit.
2941 interface(`userdom_dontaudit_setattr_user_ttys',`
2943 type user_tty_device_t;
2946 dontaudit $1 user_tty_device_t:chr_file setattr_chr_file_perms;
2949 ########################################
2951 ## Read and write a user domain tty.
2953 ## <param name="domain">
2955 ## Domain allowed access.
2959 interface(`userdom_use_user_ttys',`
2961 type user_tty_device_t;
2964 allow $1 user_tty_device_t:chr_file rw_term_perms;
2967 ########################################
2969 ## Read and write a inherited user domain tty.
2971 ## <param name="domain">
2973 ## Domain allowed access.
2977 interface(`userdom_use_inherited_user_ttys',`
2979 type user_tty_device_t;
2982 allow $1 user_tty_device_t:chr_file rw_inherited_term_perms;
2985 ########################################
2987 ## Read and write a user domain pty.
2989 ## <param name="domain">
2991 ## Domain allowed access.
2995 interface(`userdom_use_user_ptys',`
3000 allow $1 user_devpts_t:chr_file rw_term_perms;
3003 ########################################
3005 ## Read and write a inherited user domain pty.
3007 ## <param name="domain">
3009 ## Domain allowed access.
3013 interface(`userdom_use_inherited_user_ptys',`
3018 allow $1 user_devpts_t:chr_file rw_inherited_term_perms;
3021 ########################################
3023 ## Read and write a inherited user TTYs and PTYs.
3027 ## Allow the specified domain to read and write inherited user
3028 ## TTYs and PTYs. This will allow the domain to
3029 ## interact with the user via the terminal. Typically
3030 ## all interactive applications will require this
3034 ## <param name="domain">
3036 ## Domain allowed access.
3039 ## <infoflow type="both" weight="10"/>
3041 interface(`userdom_use_inherited_user_terminals',`
3043 type user_tty_device_t, user_devpts_t;
3046 allow $1 user_tty_device_t:chr_file rw_inherited_term_perms;
3047 allow $1 user_devpts_t:chr_file rw_inherited_term_perms;
3050 #######################################
3052 ## Allow attempts to read and write
3053 ## a user domain tty and pty.
3055 ## <param name="domain">
3057 ## Domain to not audit.
3061 interface(`userdom_use_user_terminals',`
3063 type user_tty_device_t, user_devpts_t;
3066 allow $1 user_tty_device_t:chr_file rw_term_perms;
3067 allow $1 user_devpts_t:chr_file rw_term_perms;
3070 ########################################
3072 ## Do not audit attempts to read and write
3073 ## a user domain tty and pty.
3075 ## <param name="domain">
3077 ## Domain to not audit.
3081 interface(`userdom_dontaudit_use_user_terminals',`
3083 type user_tty_device_t, user_devpts_t;
3086 dontaudit $1 user_tty_device_t:chr_file rw_term_perms;
3087 dontaudit $1 user_devpts_t:chr_file rw_term_perms;
3090 ########################################
3092 ## Execute a shell in all user domains. This
3093 ## is an explicit transition, requiring the
3094 ## caller to use setexeccon().
3096 ## <param name="domain">
3098 ## Domain allowed to transition.
3102 interface(`userdom_spec_domtrans_all_users',`
3104 attribute userdomain;
3107 corecmd_shell_spec_domtrans($1, userdomain)
3108 allow userdomain $1:fd use;
3109 allow userdomain $1:fifo_file rw_file_perms;
3110 allow userdomain $1:process sigchld;
3113 ########################################
3115 ## Execute an Xserver session in all unprivileged user domains. This
3116 ## is an explicit transition, requiring the
3117 ## caller to use setexeccon().
3119 ## <param name="domain">
3121 ## Domain allowed to transition.
3125 interface(`userdom_xsession_spec_domtrans_all_users',`
3127 attribute userdomain;
3130 xserver_xsession_spec_domtrans($1, userdomain)
3131 allow userdomain $1:fd use;
3132 allow userdomain $1:fifo_file rw_file_perms;
3133 allow userdomain $1:process sigchld;
3136 ########################################
3138 ## Execute a shell in all unprivileged user domains. This
3139 ## is an explicit transition, requiring the
3140 ## caller to use setexeccon().
3142 ## <param name="domain">
3144 ## Domain allowed to transition.
3148 interface(`userdom_spec_domtrans_unpriv_users',`
3150 attribute unpriv_userdomain;
3153 corecmd_shell_spec_domtrans($1, unpriv_userdomain)
3154 allow unpriv_userdomain $1:fd use;
3155 allow unpriv_userdomain $1:fifo_file rw_file_perms;
3156 allow unpriv_userdomain $1:process sigchld;
3159 ########################################
3161 ## Execute an Xserver session in all unprivileged user domains. This
3162 ## is an explicit transition, requiring the
3163 ## caller to use setexeccon().
3165 ## <param name="domain">
3167 ## Domain allowed to transition.
3171 interface(`userdom_xsession_spec_domtrans_unpriv_users',`
3173 attribute unpriv_userdomain;
3176 xserver_xsession_spec_domtrans($1, unpriv_userdomain)
3177 allow unpriv_userdomain $1:fd use;
3178 allow unpriv_userdomain $1:fifo_file rw_file_perms;
3179 allow unpriv_userdomain $1:process sigchld;
3182 ########################################
3184 ## Manage unpriviledged user SysV sempaphores.
3186 ## <param name="domain">
3188 ## Domain allowed access.
3192 interface(`userdom_manage_unpriv_user_semaphores',`
3194 attribute unpriv_userdomain;
3197 allow $1 unpriv_userdomain:sem create_sem_perms;
3200 ########################################
3202 ## Manage unpriviledged user SysV shared
3205 ## <param name="domain">
3207 ## Domain allowed access.
3211 interface(`userdom_manage_unpriv_user_shared_mem',`
3213 attribute unpriv_userdomain;
3216 allow $1 unpriv_userdomain:shm create_shm_perms;
3219 ########################################
3221 ## Execute bin_t in the unprivileged user domains. This
3222 ## is an explicit transition, requiring the
3223 ## caller to use setexeccon().
3225 ## <param name="domain">
3227 ## Domain allowed to transition.
3231 interface(`userdom_bin_spec_domtrans_unpriv_users',`
3233 attribute unpriv_userdomain;
3236 corecmd_bin_spec_domtrans($1, unpriv_userdomain)
3237 allow unpriv_userdomain $1:fd use;
3238 allow unpriv_userdomain $1:fifo_file rw_file_perms;
3239 allow unpriv_userdomain $1:process sigchld;
3242 ########################################
3244 ## Execute all entrypoint files in unprivileged user
3245 ## domains. This is an explicit transition, requiring the
3246 ## caller to use setexeccon().
3248 ## <param name="domain">
3250 ## Domain allowed access.
3254 interface(`userdom_entry_spec_domtrans_unpriv_users',`
3256 attribute unpriv_userdomain;
3259 domain_entry_file_spec_domtrans($1, unpriv_userdomain)
3260 allow unpriv_userdomain $1:fd use;
3261 allow unpriv_userdomain $1:fifo_file rw_fifo_file_perms;
3262 allow unpriv_userdomain $1:process sigchld;
3265 ########################################
3267 ## Search users home directories.
3269 ## <param name="domain">
3271 ## Domain allowed access.
3275 interface(`userdom_search_user_home_content',`
3277 type user_home_dir_t;
3278 attribute user_home_type;
3282 allow $1 { user_home_dir_t user_home_type }:dir search_dir_perms;
3283 allow $1 { user_home_dir_t user_home_type }:lnk_file read_lnk_file_perms;
3286 ########################################
3288 ## Send general signals to unprivileged user domains.
3290 ## <param name="domain">
3292 ## Domain allowed access.
3296 interface(`userdom_signal_unpriv_users',`
3298 attribute unpriv_userdomain;
3301 allow $1 unpriv_userdomain:process signal;
3304 ########################################
3306 ## Inherit the file descriptors from unprivileged user domains.
3308 ## <param name="domain">
3310 ## Domain allowed access.
3314 interface(`userdom_use_unpriv_users_fds',`
3316 attribute unpriv_userdomain;
3319 allow $1 unpriv_userdomain:fd use;
3322 ########################################
3324 ## Do not audit attempts to inherit the file descriptors
3325 ## from unprivileged user domains.
3329 ## Do not audit attempts to inherit the file descriptors
3330 ## from unprivileged user domains. This will supress
3331 ## SELinux denial messages when the specified domain is denied
3332 ## the permission to inherit these file descriptors.
3335 ## <param name="domain">
3337 ## Domain to not audit.
3340 ## <infoflow type="none"/>
3342 interface(`userdom_dontaudit_use_unpriv_user_fds',`
3344 attribute unpriv_userdomain;
3347 dontaudit $1 unpriv_userdomain:fd use;
3350 ########################################
3352 ## Do not audit attempts to use user ptys.
3354 ## <param name="domain">
3356 ## Domain to not audit.
3360 interface(`userdom_dontaudit_use_user_ptys',`
3365 dontaudit $1 user_devpts_t:chr_file rw_inherited_file_perms;
3368 ########################################
3370 ## Relabel files to unprivileged user pty types.
3372 ## <param name="domain">
3374 ## Domain allowed access.
3378 interface(`userdom_relabelto_user_ptys',`
3383 allow $1 user_devpts_t:chr_file relabelto;
3386 ########################################
3388 ## Do not audit attempts to relabel files from
3391 ## <param name="domain">
3393 ## Domain to not audit.
3397 interface(`userdom_dontaudit_relabelfrom_user_ptys',`
3402 dontaudit $1 user_devpts_t:chr_file relabelfrom;
3405 ########################################
3407 ## Write all users files in /tmp
3409 ## <param name="domain">
3411 ## Domain allowed access.
3415 interface(`userdom_write_user_tmp_files',`
3420 write_files_pattern($1, user_tmp_t, user_tmp_t)
3423 ########################################
3425 ## Do not audit attempts to write users
3428 ## <param name="domain">
3430 ## Domain to not audit.
3434 interface(`userdom_dontaudit_write_user_tmp_files',`
3439 dontaudit $1 user_tmp_t:file write;
3442 ########################################
3444 ## Do not audit attempts to read/write users
3445 ## temporary fifo files.
3447 ## <param name="domain">
3449 ## Domain to not audit.
3453 interface(`userdom_dontaudit_rw_user_tmp_pipes',`
3458 dontaudit $1 user_tmp_t:fifo_file rw_inherited_fifo_file_perms;
3461 ########################################
3463 ## Do not audit attempts to use user ttys.
3465 ## <param name="domain">
3467 ## Domain to not audit.
3471 interface(`userdom_dontaudit_use_user_ttys',`
3473 type user_tty_device_t;
3476 dontaudit $1 user_tty_device_t:chr_file rw_file_perms;
3479 ########################################
3481 ## Read the process state of all user domains.
3483 ## <param name="domain">
3485 ## Domain allowed access.
3489 interface(`userdom_read_all_users_state',`
3491 attribute userdomain;
3494 read_files_pattern($1, userdomain, userdomain)
3495 read_lnk_files_pattern($1,userdomain,userdomain)
3496 kernel_search_proc($1)
3499 ########################################
3501 ## Get the attributes of all user domains.
3503 ## <param name="domain">
3505 ## Domain allowed access.
3509 interface(`userdom_getattr_all_users',`
3511 attribute userdomain;
3514 allow $1 userdomain:process getattr;
3517 ########################################
3519 ## Inherit the file descriptors from all user domains
3521 ## <param name="domain">
3523 ## Domain allowed access.
3527 interface(`userdom_use_all_users_fds',`
3529 attribute userdomain;
3532 allow $1 userdomain:fd use;
3535 ########################################
3537 ## Do not audit attempts to inherit the file
3538 ## descriptors from any user domains.
3540 ## <param name="domain">
3542 ## Domain to not audit.
3546 interface(`userdom_dontaudit_use_all_users_fds',`
3548 attribute userdomain;
3551 dontaudit $1 userdomain:fd use;
3554 ########################################
3556 ## Send general signals to all user domains.
3558 ## <param name="domain">
3560 ## Domain allowed access.
3564 interface(`userdom_signal_all_users',`
3566 attribute userdomain;
3569 allow $1 userdomain:process signal;
3572 ########################################
3574 ## Send kill signals to all user domains.
3576 ## <param name="domain">
3578 ## Domain allowed access.
3582 interface(`userdom_kill_all_users',`
3584 attribute userdomain;
3587 allow $1 userdomain:process sigkill;
3590 ########################################
3592 ## Send a SIGCHLD signal to all user domains.
3594 ## <param name="domain">
3596 ## Domain allowed access.
3600 interface(`userdom_sigchld_all_users',`
3602 attribute userdomain;
3605 allow $1 userdomain:process sigchld;
3608 ########################################
3610 ## Create keys for all user domains.
3612 ## <param name="domain">
3614 ## Domain allowed access.
3618 interface(`userdom_create_all_users_keys',`
3620 attribute userdomain;
3623 allow $1 userdomain:key create;
3626 ########################################
3628 ## Send a dbus message to all user domains.
3630 ## <param name="domain">
3632 ## Domain allowed access.
3636 interface(`userdom_dbus_send_all_users',`
3638 attribute userdomain;
3639 class dbus send_msg;
3642 allow $1 userdomain:dbus send_msg;
3645 ########################################
3647 ## Allow apps to set rlimits on userdomain
3649 ## <param name="domain">
3651 ## Domain allowed access.
3655 interface(`userdom_set_rlimitnh',`
3657 attribute userdomain;
3660 allow $1 userdomain:process rlimitinh;
3663 ########################################
3665 ## Define this type as a Allow apps to set rlimits on userdomain
3667 ## <param name="domain">
3669 ## Domain allowed access.
3672 ## <param name="userdomain_prefix">
3674 ## The prefix of the user domain (e.g., user
3675 ## is the prefix for user_t).
3678 ## <param name="domain">
3680 ## Domain allowed access.
3684 template(`userdom_unpriv_usertype',`
3686 attribute unpriv_userdomain, userdomain;
3687 attribute $1_usertype;
3689 typeattribute $2 $1_usertype;
3690 typeattribute $2 unpriv_userdomain;
3691 typeattribute $2 userdomain;
3693 ubac_constrained($2)
3696 ########################################
3698 ## Connect to users over an unix stream socket.
3700 ## <param name="domain">
3702 ## Domain allowed access.
3706 interface(`userdom_stream_connect',`
3709 attribute userdomain;
3712 stream_connect_pattern($1, user_tmp_t, user_tmp_t, userdomain)
3715 ########################################
3717 ## Ptrace user domains.
3719 ## <param name="domain">
3721 ## Domain allowed access.
3725 interface(`userdom_ptrace_all_users',`
3727 attribute userdomain;
3730 allow $1 userdomain:process ptrace;
3733 ########################################
3735 ## dontaudit Search /root
3737 ## <param name="domain">
3739 ## Domain to not audit.
3743 interface(`userdom_dontaudit_search_admin_dir',`
3748 dontaudit $1 admin_home_t:dir search_dir_perms;
3751 ########################################
3753 ## dontaudit list /root
3755 ## <param name="domain">
3757 ## Domain to not audit.
3761 interface(`userdom_dontaudit_list_admin_dir',`
3766 dontaudit $1 admin_home_t:dir list_dir_perms;
3769 ########################################
3771 ## Allow domain to list /root
3773 ## <param name="domain">
3775 ## Domain allowed access.
3779 interface(`userdom_list_admin_dir',`
3784 allow $1 admin_home_t:dir list_dir_perms;
3787 ########################################
3789 ## Allow Search /root
3791 ## <param name="domain">
3793 ## Domain allowed access.
3797 interface(`userdom_search_admin_dir',`
3802 allow $1 admin_home_t:dir search_dir_perms;
3805 ########################################
3807 ## RW unpriviledged user SysV sempaphores.
3809 ## <param name="domain">
3811 ## Domain allowed access.
3815 interface(`userdom_rw_semaphores',`
3817 attribute unpriv_userdomain;
3820 allow $1 unpriv_userdomain:sem rw_sem_perms;
3823 ########################################
3825 ## Send a message to unpriv users over a unix domain
3828 ## <param name="domain">
3830 ## Domain allowed access.
3834 interface(`userdom_dgram_send',`
3836 attribute unpriv_userdomain;
3839 allow $1 unpriv_userdomain:unix_dgram_socket sendto;
3842 ######################################
3844 ## Send a message to users over a unix domain
3847 ## <param name="domain">
3849 ## Domain allowed access.
3853 interface(`userdom_users_dgram_send',`
3855 attribute userdomain;
3858 allow $1 userdomain:unix_dgram_socket sendto;
3861 #######################################
3863 ## Allow execmod on files in homedirectory
3865 ## <param name="domain">
3867 ## Domain allowed access.
3872 interface(`userdom_execmod_user_home_files',`
3874 type user_home_type;
3877 allow $1 user_home_type:file execmod;
3880 ########################################
3882 ## Read admin home files.
3884 ## <param name="domain">
3886 ## Domain allowed access.
3891 interface(`userdom_read_admin_home_files',`
3896 read_files_pattern($1, admin_home_t, admin_home_t)
3899 ########################################
3901 ## Execute admin home files.
3903 ## <param name="domain">
3905 ## Domain allowed access.
3910 interface(`userdom_exec_admin_home_files',`
3915 exec_files_pattern($1, admin_home_t, admin_home_t)
3918 ########################################
3920 ## Append files inherited
3921 ## in the /root directory.
3923 ## <param name="domain">
3925 ## Domain allowed access.
3929 interface(`userdom_inherit_append_admin_home_files',`
3934 allow $1 admin_home_t:file { getattr append };
3938 #######################################
3940 ## Manage all files/directories in the homedir
3942 ## <param name="userdomain">
3949 interface(`userdom_manage_user_home_content',`
3951 type user_home_dir_t, user_home_t;
3952 attribute user_home_type;
3956 manage_dirs_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
3957 manage_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
3958 manage_lnk_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
3959 manage_sock_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
3960 manage_fifo_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
3961 filetrans_pattern($1, user_home_dir_t, user_home_t, { dir file lnk_file sock_file fifo_file })
3966 ########################################
3968 ## Create objects in a user home directory
3969 ## with an automatic type transition to
3970 ## the user home file type.
3972 ## <param name="domain">
3974 ## Domain allowed access.
3977 ## <param name="object_class">
3979 ## The class of the object to be created.
3983 interface(`userdom_user_home_dir_filetrans_pattern',`
3985 type user_home_dir_t, user_home_t;
3988 type_transition $1 user_home_dir_t:$2 user_home_t;
3991 ########################################
3993 ## Create objects in the /root directory
3994 ## with an automatic type transition to
3995 ## a specified private type.
3997 ## <param name="domain">
3999 ## Domain allowed access.
4002 ## <param name="private_type">
4004 ## The type of the object to create.
4007 ## <param name="object_class">
4009 ## The class of the object to be created.
4013 interface(`userdom_admin_home_dir_filetrans',`
4018 filetrans_pattern($1, admin_home_t, $2, $3, $4)
4021 ########################################
4023 ## Send signull to unprivileged user domains.
4025 ## <param name="domain">
4027 ## Domain allowed access.
4031 interface(`userdom_signull_unpriv_users',`
4033 attribute unpriv_userdomain;
4036 allow $1 unpriv_userdomain:process signull;
4039 ########################################
4041 ## Write all users files in /tmp
4043 ## <param name="domain">
4045 ## Domain allowed access.
4049 interface(`userdom_write_user_tmp_dirs',`
4054 write_files_pattern($1, user_tmp_t, user_tmp_t)
4057 ########################################
4059 ## Manage keys for all user domains.
4061 ## <param name="domain">
4063 ## Domain allowed access.
4067 interface(`userdom_manage_all_users_keys',`
4069 attribute userdomain;
4072 allow $1 userdomain:key manage_key_perms;
4076 ########################################
4078 ## Do not audit attempts to read and write
4079 ## unserdomain stream.
4081 ## <param name="domain">
4083 ## Domain to not audit.
4087 interface(`userdom_dontaudit_rw_stream',`
4089 attribute userdomain;
4092 dontaudit $1 userdomain:unix_stream_socket rw_socket_perms;
4095 ########################################
4097 ## Do not audit attempts to read and write
4098 ## unserdomain datagram socket.
4100 ## <param name="domain">
4102 ## Domain to not audit.
4106 interface(`userdom_dontaudit_rw_dgram_socket',`
4108 attribute userdomain;
4111 dontaudit $1 userdomain:unix_dgram_socket { read write };
4114 ########################################
4117 ## in a user home subdirectory.
4119 ## <param name="domain">
4121 ## Domain allowed access.
4125 interface(`userdom_append_user_home_content_files',`
4127 type user_home_dir_t, user_home_t;
4130 append_files_pattern($1, user_home_t, user_home_t)
4131 allow $1 user_home_dir_t:dir search_dir_perms;
4132 files_search_home($1)
4135 ########################################
4137 ## Read files inherited
4138 ## in a user home subdirectory.
4140 ## <param name="domain">
4142 ## Domain allowed access.
4146 interface(`userdom_read_inherited_user_home_content_files',`
4148 attribute user_home_type;
4151 allow $1 user_home_type:file { getattr read };
4154 ########################################
4156 ## Append files inherited
4157 ## in a user home subdirectory.
4159 ## <param name="domain">
4161 ## Domain allowed access.
4165 interface(`userdom_inherit_append_user_home_content_files',`
4170 allow $1 user_home_t:file { getattr append };
4173 ########################################
4175 ## Append files inherited
4176 ## in a user tmp files.
4178 ## <param name="domain">
4180 ## Domain allowed access.
4184 interface(`userdom_inherit_append_user_tmp_files',`
4189 allow $1 user_tmp_t:file { getattr append };
4192 ######################################
4194 ## Read audio files in the users homedir.
4196 ## <param name="domain">
4198 ## Domain allowed access.
4203 interface(`userdom_read_home_audio_files',`
4208 userdom_search_user_home_dirs($1)
4209 allow $1 audio_home_t:dir list_dir_perms;
4210 read_files_pattern($1, audio_home_t, audio_home_t)
4211 read_lnk_files_pattern($1, audio_home_t, audio_home_t)
4214 ########################################
4216 ## Do not audit attempts to write all user home content files.
4218 ## <param name="domain">
4220 ## Domain to not audit.
4224 interface(`userdom_dontaudit_write_all_user_home_content_files',`
4226 attribute user_home_type;
4229 dontaudit $1 user_home_type:file write_file_perms;
4232 ########################################
4234 ## Do not audit attempts to write all user tmp content files.
4236 ## <param name="domain">
4238 ## Domain to not audit.
4242 interface(`userdom_dontaudit_write_all_user_tmp_content_files',`
4244 attribute user_tmp_type;
4247 dontaudit $1 user_tmp_type:file write_file_perms;
4250 ########################################
4252 ## Manage all user temporary content.
4254 ## <param name="domain">
4256 ## Domain allowed access.
4260 interface(`userdom_manage_all_user_tmp_content',`
4262 attribute user_tmp_type;
4265 manage_dirs_pattern($1, user_tmp_type, user_tmp_type)
4266 manage_files_pattern($1, user_tmp_type, user_tmp_type)
4267 manage_lnk_files_pattern($1, user_tmp_type, user_tmp_type)
4268 manage_sock_files_pattern($1, user_tmp_type, user_tmp_type)
4269 manage_fifo_files_pattern($1, user_tmp_type, user_tmp_type)
4270 files_search_tmp($1)
4273 ########################################
4275 ## List all user temporary content.
4277 ## <param name="domain">
4279 ## Domain allowed access.
4283 interface(`userdom_list_all_user_tmp_content',`
4285 attribute user_tmp_type;
4288 list_dirs_pattern($1, user_tmp_type, user_tmp_type)
4289 getattr_files_pattern($1, user_tmp_type, user_tmp_type)
4290 read_lnk_files_pattern($1, user_tmp_type, user_tmp_type)
4291 getattr_sock_files_pattern($1, user_tmp_type, user_tmp_type)
4292 getattr_fifo_files_pattern($1, user_tmp_type, user_tmp_type)
4293 files_search_var($1)
4294 files_search_tmp($1)
4297 ########################################
4299 ## Manage all user tmpfs content.
4301 ## <param name="domain">
4303 ## Domain allowed access.
4307 interface(`userdom_manage_all_user_tmpfs_content',`
4309 attribute user_tmpfs_type;
4312 manage_dirs_pattern($1, user_tmpfs_type, user_tmpfs_type)
4313 manage_files_pattern($1, user_tmpfs_type, user_tmpfs_type)
4314 manage_lnk_files_pattern($1, user_tmpfs_type, user_tmpfs_type)
4315 manage_sock_files_pattern($1, user_tmpfs_type, user_tmpfs_type)
4316 manage_fifo_files_pattern($1, user_tmpfs_type, user_tmpfs_type)
4320 ########################################
4322 ## Delete all user temporary content.
4324 ## <param name="domain">
4326 ## Domain allowed access.
4330 interface(`userdom_delete_all_user_tmp_content',`
4332 attribute user_tmp_type;
4335 delete_dirs_pattern($1, user_tmp_type, user_tmp_type)
4336 delete_files_pattern($1, user_tmp_type, user_tmp_type)
4337 delete_lnk_files_pattern($1, user_tmp_type, user_tmp_type)
4338 delete_sock_files_pattern($1, user_tmp_type, user_tmp_type)
4339 delete_fifo_files_pattern($1, user_tmp_type, user_tmp_type)
4341 files_search_var($1)
4342 files_delete_tmp_dir_entry($1)
4345 ########################################
4347 ## Read system SSL certificates in the users homedir.
4349 ## <param name="domain">
4351 ## Domain allowed access.
4355 interface(`userdom_read_home_certs',`
4360 userdom_search_user_home_content($1)
4361 allow $1 home_cert_t:dir list_dir_perms;
4362 read_files_pattern($1, home_cert_t, home_cert_t)
4363 read_lnk_files_pattern($1, home_cert_t, home_cert_t)
4366 #######################################
4368 ## Dontaudit Write system SSL certificates in the users homedir.
4370 ## <param name="domain">
4372 ## Domain to not audit.
4376 interface(`userdom_dontaudit_write_home_certs',`
4381 dontaudit $1 home_cert_t:file write;
4384 ########################################
4386 ## dontaudit Search getatrr /root files
4388 ## <param name="domain">
4390 ## Domain to not audit.
4394 interface(`userdom_dontaudit_getattr_admin_home_files',`
4399 dontaudit $1 admin_home_t:file getattr;
4402 ########################################
4404 ## dontaudit read /root lnk files
4406 ## <param name="domain">
4408 ## Domain to not audit.
4412 interface(`userdom_dontaudit_read_admin_home_lnk_files',`
4417 dontaudit $1 admin_home_t:lnk_file read;
4420 ########################################
4422 ## dontaudit read /root files
4424 ## <param name="domain">
4426 ## Domain to not audit.
4430 interface(`userdom_dontaudit_read_admin_home_files',`
4435 dontaudit $1 admin_home_t:file read_file_perms;
4438 ########################################
4440 ## Create, read, write, and delete user
4441 ## temporary chr files.
4443 ## <param name="domain">
4445 ## Domain allowed access.
4449 interface(`userdom_manage_user_tmp_chr_files',`
4454 manage_chr_files_pattern($1, user_tmp_t, user_tmp_t)
4455 files_search_tmp($1)
4458 ########################################
4460 ## Create, read, write, and delete user
4461 ## temporary blk files.
4463 ## <param name="domain">
4465 ## Domain allowed access.
4469 interface(`userdom_manage_user_tmp_blk_files',`
4474 manage_blk_files_pattern($1, user_tmp_t, user_tmp_t)
4475 files_search_tmp($1)
4478 ########################################
4480 ## Dontaudit attempt to set attributes on user temporary directories.
4482 ## <param name="domain">
4484 ## Domain to not audit.
4488 interface(`userdom_dontaudit_setattr_user_tmp',`
4493 dontaudit $1 user_tmp_t:dir setattr;
4496 ########################################
4498 ## Write all inherited users files in /tmp
4500 ## <param name="domain">
4502 ## Domain allowed access.
4506 interface(`userdom_write_inherited_user_tmp_files',`
4511 allow $1 user_tmp_t:file write;
4514 ########################################
4516 ## Delete all users files in /tmp
4518 ## <param name="domain">
4520 ## Domain allowed access.
4524 interface(`userdom_delete_user_tmp_files',`
4529 allow $1 user_tmp_t:file delete_file_perms;
4532 ########################################
4534 ## Delete user tmpfs files.
4536 ## <param name="domain">
4538 ## Domain allowed access.
4542 interface(`userdom_delete_user_tmpfs_files',`
4547 allow $1 user_tmpfs_t:file delete_file_perms;
4550 ########################################
4552 ## Read/Write unpriviledged user SysV shared
4555 ## <param name="domain">
4557 ## Domain allowed access.
4561 interface(`userdom_rw_unpriv_user_shared_mem',`
4563 attribute unpriv_userdomain;
4566 allow $1 unpriv_userdomain:shm rw_shm_perms;
4569 ########################################
4571 ## Do not audit attempts to search user
4572 ## temporary directories.
4574 ## <param name="domain">
4576 ## Domain to not audit.
4580 interface(`userdom_dontaudit_search_user_tmp',`
4585 dontaudit $1 user_tmp_t:dir search_dir_perms;
4588 ########################################
4590 ## Execute a file in a user home directory
4591 ## in the specified domain.
4595 ## Execute a file in a user home directory
4596 ## in the specified domain.
4599 ## No interprocess communication (signals, pipes,
4600 ## etc.) is provided by this interface since
4601 ## the domains are not owned by this module.
4604 ## <param name="domain">
4606 ## Domain allowed access.
4609 ## <param name="target_domain">
4611 ## The type of the new process.
4615 interface(`userdom_domtrans_user_home',`
4620 read_lnk_files_pattern($1, user_home_t, user_home_t)
4621 domain_transition_pattern($1, user_home_t, $2)
4622 type_transition $1 user_home_t:process $2;
4625 ########################################
4627 ## Execute a file in a user tmp directory
4628 ## in the specified domain.
4632 ## Execute a file in a user tmp directory
4633 ## in the specified domain.
4636 ## No interprocess communication (signals, pipes,
4637 ## etc.) is provided by this interface since
4638 ## the domains are not owned by this module.
4641 ## <param name="domain">
4643 ## Domain allowed access.
4646 ## <param name="target_domain">
4648 ## The type of the new process.
4652 interface(`userdom_domtrans_user_tmp',`
4657 files_search_tmp($1)
4658 read_lnk_files_pattern($1, user_tmp_t, user_tmp_t)
4659 domain_transition_pattern($1, user_tmp_t, $2)
4660 type_transition $1 user_tmp_t:process $2;
4663 ########################################
4665 ## Do not audit attempts to read all user home content files.
4667 ## <param name="domain">
4669 ## Domain to not audit.
4673 interface(`userdom_dontaudit_read_all_user_home_content_files',`
4675 attribute user_home_type;
4678 dontaudit $1 user_home_type:file read_file_perms;
4681 ########################################
4683 ## Do not audit attempts to read all user tmp content files.
4685 ## <param name="domain">
4687 ## Domain to not audit.
4691 interface(`userdom_dontaudit_read_all_user_tmp_content_files',`
4693 attribute user_tmp_type;
4696 dontaudit $1 user_tmp_type:file read_file_perms;