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',`
320 attribute user_tmp_type;
324 role $1 types user_tmp_t;
326 files_poly_member_tmp($2, user_tmp_t)
328 manage_dirs_pattern($2, user_tmp_type, user_tmp_type)
329 manage_files_pattern($2, user_tmp_type, user_tmp_type)
330 manage_lnk_files_pattern($2, user_tmp_type, user_tmp_type)
331 manage_sock_files_pattern($2, user_tmp_type, user_tmp_type)
332 manage_fifo_files_pattern($2, user_tmp_type, user_tmp_type)
333 files_tmp_filetrans($2, user_tmp_t, { dir file lnk_file sock_file fifo_file })
334 relabel_dirs_pattern($2, user_tmp_type, user_tmp_type)
335 relabel_files_pattern($2, user_tmp_type, user_tmp_type)
336 relabel_lnk_files_pattern($2, user_tmp_type, user_tmp_type)
337 relabel_sock_files_pattern($2, user_tmp_type, user_tmp_type)
338 relabel_fifo_files_pattern($2, user_tmp_type, user_tmp_type)
341 #######################################
343 ## Dontaudit search of user bin dirs.
345 ## <param name="domain">
347 ## Domain to not audit.
351 interface(`userdom_dontaudit_search_user_bin_dirs',`
356 dontaudit $1 home_bin_t:dir search_dir_perms;
359 #######################################
361 ## Execute user bin files.
363 ## <param name="domain">
365 ## Domain allowed access.
369 interface(`userdom_exec_user_bin_files',`
371 attribute user_home_type;
372 type home_bin_t, user_home_dir_t;
375 exec_files_pattern($1, { user_home_dir_t user_home_type }, home_bin_t)
376 files_search_home($1)
379 #######################################
381 ## The execute access user temporary files.
383 ## <param name="domain">
385 ## Domain allowed access.
390 interface(`userdom_exec_user_tmp_files',`
395 exec_files_pattern($1, user_tmp_t, user_tmp_t)
396 dontaudit $1 user_tmp_t:sock_file execute;
400 #######################################
402 ## Role access for the user tmpfs type
403 ## that the user has full access.
407 ## Role access for the user tmpfs type
408 ## that the user has full access.
411 ## This does not allow execute access.
414 ## <param name="role">
416 ## Role allowed access.
419 ## <param name="domain">
421 ## Domain allowed access.
426 interface(`userdom_manage_tmpfs_role',`
428 attribute user_tmpfs_type;
432 role $1 types user_tmpfs_t;
434 manage_dirs_pattern($2, user_tmpfs_type, user_tmpfs_type)
435 manage_files_pattern($2, user_tmpfs_type, user_tmpfs_type)
436 manage_lnk_files_pattern($2, user_tmpfs_type, user_tmpfs_type)
437 manage_sock_files_pattern($2, user_tmpfs_type, user_tmpfs_type)
438 manage_fifo_files_pattern($2, user_tmpfs_type, user_tmpfs_type)
439 fs_tmpfs_filetrans($2, user_tmpfs_t, { dir file lnk_file sock_file fifo_file })
440 relabel_dirs_pattern($2, user_tmpfs_type, user_tmpfs_type)
441 relabel_files_pattern($2, user_tmpfs_type, user_tmpfs_type)
442 relabel_lnk_files_pattern($2, user_tmpfs_type, user_tmpfs_type)
443 relabel_sock_files_pattern($2, user_tmpfs_type, user_tmpfs_type)
444 relabel_fifo_files_pattern($2, user_tmpfs_type, user_tmpfs_type)
447 #######################################
449 ## The interface allowing the user basic
450 ## network permissions
452 ## <param name="userdomain">
459 interface(`userdom_basic_networking',`
461 allow $1 self:tcp_socket create_stream_socket_perms;
462 allow $1 self:udp_socket create_socket_perms;
464 corenet_all_recvfrom_unlabeled($1)
465 corenet_all_recvfrom_netlabel($1)
466 corenet_tcp_sendrecv_generic_if($1)
467 corenet_udp_sendrecv_generic_if($1)
468 corenet_tcp_sendrecv_generic_node($1)
469 corenet_udp_sendrecv_generic_node($1)
470 corenet_tcp_sendrecv_all_ports($1)
471 corenet_udp_sendrecv_all_ports($1)
472 corenet_tcp_connect_all_ports($1)
473 corenet_sendrecv_all_client_packets($1)
476 init_tcp_recvfrom_all_daemons($1)
477 init_udp_recvfrom_all_daemons($1)
481 ipsec_match_default_spd($1)
486 #######################################
488 ## The template for creating a user xwindows client. (Deprecated)
490 ## <param name="userdomain_prefix">
492 ## The prefix of the user domain (e.g., user
493 ## is the prefix for user_t).
498 template(`userdom_xwindows_client_template',`
499 refpolicywarn(`$0() has been deprecated, please use xserver_role() instead.')
501 type $1_t, user_tmpfs_t;
504 dev_rw_xserver_misc($1_t)
505 dev_rw_power_management($1_t)
509 # open office is looking for the following
510 dev_getattr_agp_dev($1_t)
511 dev_dontaudit_rw_dri($1_t)
512 # GNOME checks for usb and other devices:
514 dev_rw_generic_usb_dev($1_t)
516 xserver_user_x_domain_template($1, $1_t, user_tmpfs_t)
517 xserver_xsession_entry_type($1_t)
518 xserver_dontaudit_write_log($1_t)
519 xserver_stream_connect_xdm($1_t)
520 # certain apps want to read xdm.pid file
521 xserver_read_xdm_pid($1_t)
522 # gnome-session creates socket under /tmp/.ICE-unix/
523 xserver_create_xdm_tmp_sockets($1_t)
524 # Needed for escd, remove if we get escd policy
525 xserver_manage_xdm_tmp_files($1_t)
528 #######################################
530 ## The template for allowing the user to change passwords.
532 ## <param name="userdomain_prefix">
534 ## The prefix of the user domain (e.g., user
535 ## is the prefix for user_t).
540 template(`userdom_change_password_template',`
547 usermanage_run_chfn($1_t,$1_r)
548 usermanage_run_passwd($1_t,$1_r)
552 #######################################
554 ## The template containing rules common to unprivileged
555 ## users and administrative users.
559 ## This template creates a user domain, types, and
560 ## rules for the user's tty, pty, tmp, and tmpfs files.
563 ## <param name="userdomain_prefix">
565 ## The prefix of the user domain (e.g., user
566 ## is the prefix for user_t).
570 template(`userdom_common_user_template',`
572 attribute unpriv_userdomain;
575 userdom_basic_networking($1_usertype)
577 ##############################
579 # User domain Local policy
582 # evolution and gnome-session try to create a netlink socket
583 dontaudit $1_t self:netlink_socket { create ioctl read getattr write setattr append bind connect getopt setopt shutdown };
584 dontaudit $1_t self:netlink_route_socket { create ioctl read getattr write setattr append bind connect getopt setopt shutdown nlmsg_read nlmsg_write };
585 allow $1_t self:netlink_kobject_uevent_socket create_socket_perms;
586 allow $1_t self:socket create_socket_perms;
588 allow $1_usertype unpriv_userdomain:fd use;
590 kernel_read_system_state($1_usertype)
591 kernel_read_network_state($1_usertype)
592 kernel_read_software_raid_state($1_usertype)
593 kernel_read_net_sysctls($1_usertype)
594 # Very permissive allowing every domain to see every type:
595 kernel_get_sysvipc_info($1_usertype)
596 # Find CDROM devices:
597 kernel_read_device_sysctls($1_usertype)
598 kernel_request_load_module($1_usertype)
600 corenet_udp_bind_generic_node($1_usertype)
601 corenet_udp_bind_generic_port($1_usertype)
603 dev_read_rand($1_usertype)
604 dev_write_sound($1_usertype)
605 dev_read_sound($1_usertype)
606 dev_read_sound_mixer($1_usertype)
607 dev_write_sound_mixer($1_usertype)
609 files_exec_etc_files($1_usertype)
610 files_search_locks($1_usertype)
611 # Check to see if cdrom is mounted
612 files_search_mnt($1_usertype)
613 # cjp: perhaps should cut back on file reads:
614 files_read_var_files($1_usertype)
615 files_read_var_symlinks($1_usertype)
616 files_read_generic_spool($1_usertype)
617 files_read_var_lib_files($1_usertype)
619 files_getattr_lost_found_dirs($1_usertype)
620 files_read_config_files($1_usertype)
621 fs_read_noxattr_fs_files($1_usertype)
622 fs_read_noxattr_fs_symlinks($1_usertype)
623 fs_rw_cgroup_files($1_usertype)
625 application_getattr_socket($1_usertype)
627 logging_send_syslog_msg($1_usertype)
628 logging_send_audit_msgs($1_usertype)
629 selinux_get_enforce_mode($1_usertype)
631 # cjp: some of this probably can be removed
632 selinux_get_fs_mount($1_usertype)
633 selinux_validate_context($1_usertype)
634 selinux_compute_access_vector($1_usertype)
635 selinux_compute_create_context($1_usertype)
636 selinux_compute_relabel_context($1_usertype)
637 selinux_compute_user_contexts($1_usertype)
640 storage_getattr_fixed_disk_dev($1_usertype)
642 auth_read_login_records($1_usertype)
643 auth_run_pam($1_t,$1_r)
644 auth_run_utempter($1_t,$1_r)
646 init_read_utmp($1_usertype)
648 seutil_read_file_contexts($1_usertype)
649 seutil_read_default_contexts($1_usertype)
650 seutil_run_newrole($1_t,$1_r)
651 seutil_exec_checkpolicy($1_t)
652 seutil_exec_setfiles($1_usertype)
653 # for when the network connection is killed
654 # this is needed when a login role can change
656 seutil_dontaudit_signal_newrole($1_t)
658 tunable_policy(`user_direct_mouse',`
659 dev_read_mouse($1_usertype)
662 tunable_policy(`user_ttyfile_stat',`
663 term_getattr_all_ttys($1_t)
667 alsa_read_rw_config($1_usertype)
668 alsa_manage_home_files($1_t)
669 alsa_relabel_home_files($1_t)
673 # Allow graphical boot to check battery lifespan
674 apm_stream_connect($1_usertype)
678 canna_stream_connect($1_usertype)
682 chrome_role($1_r, $1_usertype)
686 colord_read_lib_files($1_usertype)
690 dbus_system_bus_client($1_usertype)
692 allow $1_usertype $1_usertype:dbus send_msg;
695 avahi_dbus_chat($1_usertype)
699 policykit_dbus_chat($1_usertype)
703 bluetooth_dbus_chat($1_usertype)
707 consolekit_dbus_chat($1_usertype)
708 consolekit_read_log($1_usertype)
712 devicekit_dbus_chat($1_usertype)
713 devicekit_dbus_chat_power($1_usertype)
714 devicekit_dbus_chat_disk($1_usertype)
718 evolution_dbus_chat($1_usertype)
719 evolution_alarm_dbus_chat($1_usertype)
723 gnome_dbus_chat_gconfdefault($1_usertype)
727 hal_dbus_chat($1_usertype)
731 kde_dbus_chat_backlighthelper($1_usertype)
735 modemmanager_dbus_chat($1_usertype)
739 networkmanager_dbus_chat($1_usertype)
740 networkmanager_read_lib_files($1_usertype)
744 vpn_dbus_chat($1_usertype)
749 git_session_role($1_r, $1_usertype)
753 inetd_use_fds($1_usertype)
754 inetd_rw_tcp_sockets($1_usertype)
758 inn_read_config($1_usertype)
759 inn_read_news_lib($1_usertype)
760 inn_read_news_spool($1_usertype)
764 lircd_stream_connect($1_usertype)
768 locate_read_lib_files($1_usertype)
771 # for running depmod as part of the kernel packaging process
773 modutils_read_module_config($1_usertype)
777 mta_rw_spool($1_usertype)
778 mta_manage_queue($1_usertype)
779 mta_filetrans_home_content($1_usertype)
783 nsplugin_role($1_r, $1_usertype)
787 tunable_policy(`allow_user_mysql_connect',`
788 mysql_stream_connect($1_t)
793 oident_manage_user_content($1_t)
794 oident_relabel_user_content($1_t)
798 # to allow monitoring of pcmcia status
799 pcmcia_read_pid($1_usertype)
803 pcscd_read_pub_files($1_usertype)
804 pcscd_stream_connect($1_usertype)
808 tunable_policy(`allow_user_postgresql_connect',`
809 postgresql_stream_connect($1_usertype)
810 postgresql_tcp_connect($1_usertype)
815 resmgr_stream_connect($1_usertype)
819 rpc_dontaudit_getattr_exports($1_usertype)
820 rpc_manage_nfs_rw_content($1_usertype)
824 rpcbind_stream_connect($1_usertype)
828 samba_stream_connect_winbind($1_usertype)
832 sandbox_transition($1_usertype, $1_r)
836 seunshare_role_template($1, $1_r, $1_t)
840 slrnpull_search_spool($1_usertype)
845 #######################################
847 ## The template for creating a login user.
851 ## This template creates a user domain, types, and
852 ## rules for the user's tty, pty, home directories,
853 ## tmp, and tmpfs files.
856 ## <param name="userdomain_prefix">
858 ## The prefix of the user domain (e.g., user
859 ## is the prefix for user_t).
863 template(`userdom_login_user_template', `
865 class context contains;
868 userdom_base_user_template($1)
870 userdom_manage_home_role($1_r, $1_usertype)
872 userdom_manage_tmp_role($1_r, $1_usertype)
873 userdom_manage_tmpfs_role($1_r, $1_usertype)
875 ifelse(`$1',`unconfined',`',`
876 gen_tunable(allow_$1_exec_content, true)
878 tunable_policy(`allow_$1_exec_content',`
879 userdom_exec_user_tmp_files($1_usertype)
880 userdom_exec_user_home_content_files($1_usertype)
882 tunable_policy(`allow_$1_exec_content && use_nfs_home_dirs',`
883 fs_exec_nfs_files($1_usertype)
886 tunable_policy(`allow_$1_exec_content && use_samba_home_dirs',`
887 fs_exec_cifs_files($1_usertype)
891 userdom_change_password_template($1)
893 ##############################
895 # User domain Local policy
898 allow $1_t self:capability { setgid chown fowner };
899 dontaudit $1_t self:capability { sys_nice fsetid };
901 allow $1_t self:process ~{ setcurrent setexec setrlimit execmem execstack execheap };
902 dontaudit $1_t self:process setrlimit;
903 dontaudit $1_t self:netlink_route_socket { create ioctl read getattr write setattr append bind connect getopt setopt shutdown nlmsg_read nlmsg_write };
905 allow $1_t self:context contains;
907 kernel_dontaudit_read_system_state($1_usertype)
908 kernel_dontaudit_list_all_proc($1_usertype)
910 dev_read_sysfs($1_usertype)
911 dev_read_urand($1_usertype)
913 domain_use_interactive_fds($1_usertype)
914 # Command completion can fire hundreds of denials
915 domain_dontaudit_exec_all_entry_files($1_usertype)
917 files_dontaudit_list_default($1_usertype)
918 files_dontaudit_read_default_files($1_usertype)
920 files_getattr_lost_found_dirs($1_usertype)
922 fs_get_all_fs_quotas($1_usertype)
923 fs_getattr_all_fs($1_usertype)
924 fs_search_all($1_usertype)
925 fs_list_inotifyfs($1_usertype)
926 fs_rw_anon_inodefs_files($1_usertype)
928 auth_dontaudit_write_login_records($1_t)
931 # Stop warnings about access to /dev/console
932 init_dontaudit_use_fds($1_usertype)
933 init_dontaudit_use_script_fds($1_usertype)
935 libs_exec_lib_files($1_usertype)
937 logging_dontaudit_getattr_all_logs($1_usertype)
939 # for running TeX programs
940 miscfiles_read_tetex_data($1_usertype)
941 miscfiles_exec_tetex_data($1_usertype)
943 seutil_read_config($1_usertype)
946 cups_read_config($1_usertype)
947 cups_stream_connect($1_usertype)
948 cups_stream_connect_ptal($1_usertype)
952 kerberos_use($1_usertype)
953 kerberos_filetrans_home_content($1_usertype)
957 mta_dontaudit_read_spool_symlinks($1_usertype)
961 quota_dontaudit_getattr_db($1_usertype)
965 rpm_read_db($1_usertype)
966 rpm_dontaudit_manage_db($1_usertype)
967 rpm_read_cache($1_usertype)
971 oddjob_run_mkhomedir($1_t, $1_r)
975 #######################################
977 ## The template for creating a unprivileged login user.
981 ## This template creates a user domain, types, and
982 ## rules for the user's tty, pty, home directories,
983 ## tmp, and tmpfs files.
986 ## <param name="userdomain_prefix">
988 ## The prefix of the user domain (e.g., user
989 ## is the prefix for user_t).
993 template(`userdom_restricted_user_template',`
995 attribute unpriv_userdomain;
998 userdom_login_user_template($1)
1000 typeattribute $1_t unpriv_userdomain;
1001 domain_interactive_fd($1_t)
1003 allow $1_usertype self:netlink_kobject_uevent_socket create_socket_perms;
1004 dontaudit $1_usertype self:netlink_audit_socket create_socket_perms;
1006 ##############################
1012 loadkeys_run($1_t,$1_r)
1016 #######################################
1018 ## The template for creating a unprivileged xwindows login user.
1022 ## The template for creating a unprivileged xwindows login user.
1025 ## This template creates a user domain, types, and
1026 ## rules for the user's tty, pty, home directories,
1027 ## tmp, and tmpfs files.
1030 ## <param name="userdomain_prefix">
1032 ## The prefix of the user domain (e.g., user
1033 ## is the prefix for user_t).
1037 template(`userdom_restricted_xwindows_user_template',`
1039 userdom_restricted_user_template($1)
1041 ##############################
1046 auth_role($1_r, $1_t)
1047 auth_search_pam_console_data($1_usertype)
1048 auth_dontaudit_read_login_records($1_usertype)
1050 dev_read_sound($1_usertype)
1051 dev_write_sound($1_usertype)
1052 # gnome keyring wants to read this.
1053 dev_dontaudit_read_rand($1_usertype)
1054 # temporarily allow since openoffice requires this
1055 dev_read_rand($1_usertype)
1057 dev_read_video_dev($1_usertype)
1058 dev_write_video_dev($1_usertype)
1059 dev_rw_wireless($1_usertype)
1061 libs_dontaudit_setattr_lib_files($1_usertype)
1063 tunable_policy(`user_rw_noexattrfile',`
1065 dev_rw_generic_usb_dev($1_usertype)
1067 fs_manage_noxattr_fs_files($1_usertype)
1068 fs_manage_noxattr_fs_dirs($1_usertype)
1069 fs_manage_dos_dirs($1_usertype)
1070 fs_manage_dos_files($1_usertype)
1071 storage_raw_read_removable_device($1_usertype)
1072 storage_raw_write_removable_device($1_usertype)
1075 logging_send_syslog_msg($1_usertype)
1076 logging_dontaudit_send_audit_msgs($1_t)
1078 # Need to to this just so screensaver will work. Should be moved to screensaver domain
1079 logging_send_audit_msgs($1_t)
1080 selinux_get_enforce_mode($1_t)
1081 seutil_exec_restorecond($1_t)
1082 seutil_read_file_contexts($1_t)
1083 seutil_read_default_contexts($1_t)
1085 xserver_restricted_role($1_r, $1_t)
1088 alsa_read_rw_config($1_usertype)
1091 # cjp: needed by KDE apps
1094 gnome_read_usr_config($1_usertype)
1095 gnome_role_gkeyringd($1, $1_r, $1_t)
1096 # cjp: telepathy F15 bugs
1097 telepathy_dbus_session_role($1_r, $1_t, $1)
1101 dbus_role_template($1, $1_r, $1_usertype)
1102 dbus_system_bus_client($1_usertype)
1103 allow $1_usertype $1_usertype:dbus send_msg;
1106 abrt_dbus_chat($1_usertype)
1107 abrt_run_helper($1_usertype, $1_r)
1111 consolekit_dontaudit_read_log($1_usertype)
1112 consolekit_dbus_chat($1_usertype)
1116 cups_dbus_chat($1_usertype)
1117 cups_dbus_chat_config($1_usertype)
1121 devicekit_dbus_chat($1_usertype)
1122 devicekit_dbus_chat_disk($1_usertype)
1123 devicekit_dbus_chat_power($1_usertype)
1127 fprintd_dbus_chat($1_t)
1132 openoffice_role_template($1, $1_r, $1_usertype)
1136 policykit_role($1_r, $1_usertype)
1140 pulseaudio_role($1_r, $1_usertype)
1144 rtkit_scheduled($1_usertype)
1148 setroubleshoot_dontaudit_stream_connect($1_t)
1152 udev_read_db($1_usertype)
1156 wm_role_template($1, $1_r, $1_t)
1160 #######################################
1162 ## The template for creating a unprivileged user roughly
1163 ## equivalent to a regular linux user.
1167 ## The template for creating a unprivileged user roughly
1168 ## equivalent to a regular linux user.
1171 ## This template creates a user domain, types, and
1172 ## rules for the user's tty, pty, home directories,
1173 ## tmp, and tmpfs files.
1176 ## <param name="userdomain_prefix">
1178 ## The prefix of the user domain (e.g., user
1179 ## is the prefix for user_t).
1183 template(`userdom_unpriv_user_template', `
1185 ##############################
1190 # Inherit rules for ordinary users.
1191 userdom_restricted_xwindows_user_template($1)
1192 userdom_common_user_template($1)
1194 ##############################
1199 # port access is audited even if dac would not have allowed it, so dontaudit it here
1200 # corenet_dontaudit_tcp_bind_all_reserved_ports($1_t)
1201 # Need the following rule to allow users to run vpnc
1202 corenet_tcp_bind_xserver_port($1_t)
1203 corenet_tcp_bind_generic_node($1_usertype)
1205 storage_rw_fuse($1_t)
1207 miscfiles_read_hwdata($1_usertype)
1209 # Allow users to run TCP servers (bind to ports and accept connection from
1210 # the same domain and outside users) disabling this forces FTP passive mode
1211 # and may change other protocols
1213 tunable_policy(`user_share_music',`
1214 corenet_tcp_bind_daap_port($1_usertype)
1217 tunable_policy(`user_tcp_server',`
1218 corenet_tcp_bind_all_unreserved_ports($1_usertype)
1221 tunable_policy(`user_setrlimit',`
1222 allow $1_usertype self:process setrlimit;
1226 cdrecord_role($1_r, $1_t)
1230 cron_role($1_r, $1_t)
1234 games_rw_data($1_usertype)
1238 gpg_role($1_r, $1_usertype)
1242 gnomeclock_dbus_chat($1_t)
1246 gpm_stream_connect($1_usertype)
1250 execmem_role_template($1, $1_r, $1_t)
1254 java_role_template($1, $1_r, $1_t)
1258 mono_role_template($1, $1_r, $1_t)
1262 mount_run_fusermount($1_t, $1_r)
1263 mount_read_pid_files($1_t)
1267 wine_role_template($1, $1_r, $1_t)
1271 postfix_run_postdrop($1_t, $1_r)
1274 # Run pppd in pppd_t by default for user
1276 ppp_run_cond($1_t, $1_r)
1280 #######################################
1282 ## The template for creating an administrative user.
1286 ## This template creates a user domain, types, and
1287 ## rules for the user's tty, pty, home directories,
1288 ## tmp, and tmpfs files.
1291 ## The privileges given to administrative users are:
1293 ## <li>Raw disk access</li>
1294 ## <li>Set all sysctls</li>
1295 ## <li>All kernel ring buffer controls</li>
1296 ## <li>Create, read, write, and delete all files but shadow</li>
1297 ## <li>Manage source and binary format SELinux policy</li>
1298 ## <li>Run insmod</li>
1302 ## <param name="userdomain_prefix">
1304 ## The prefix of the user domain (e.g., sysadm
1305 ## is the prefix for sysadm_t).
1309 template(`userdom_admin_user_template',`
1311 attribute admindomain;
1312 class passwd { passwd chfn chsh rootok crontab };
1315 ##############################
1320 # Inherit rules for ordinary users.
1321 userdom_login_user_template($1)
1322 userdom_common_user_template($1)
1324 domain_obj_id_change_exemption($1_t)
1325 role system_r types $1_t;
1327 typeattribute $1_t admindomain;
1329 ifdef(`direct_sysadm_daemon',`
1330 domain_system_change_exemption($1_t)
1333 ##############################
1338 allow $1_t self:capability ~{ sys_module audit_control audit_write };
1339 allow $1_t self:capability2 syslog;
1340 allow $1_t self:process { setexec setfscreate };
1341 allow $1_t self:netlink_audit_socket nlmsg_readpriv;
1342 allow $1_t self:tun_socket create;
1343 # Set password information for other users.
1344 allow $1_t self:passwd { passwd chfn chsh };
1345 # Skip authentication when pam_rootok is specified.
1346 allow $1_t self:passwd rootok;
1348 # Manipulate other users crontab.
1349 allow $1_t self:passwd crontab;
1351 kernel_read_software_raid_state($1_t)
1352 kernel_getattr_core_if($1_t)
1353 kernel_getattr_message_if($1_t)
1354 kernel_change_ring_buffer_level($1_t)
1355 kernel_clear_ring_buffer($1_t)
1356 kernel_read_ring_buffer($1_t)
1357 kernel_get_sysvipc_info($1_t)
1358 kernel_rw_all_sysctls($1_t)
1359 # signal unlabeled processes:
1360 kernel_kill_unlabeled($1_t)
1361 kernel_signal_unlabeled($1_t)
1362 kernel_sigstop_unlabeled($1_t)
1363 kernel_signull_unlabeled($1_t)
1364 kernel_sigchld_unlabeled($1_t)
1367 corenet_tcp_bind_generic_port($1_t)
1368 # allow setting up tunnels
1369 corenet_rw_tun_tap_dev($1_t)
1371 dev_getattr_generic_blk_files($1_t)
1372 dev_getattr_generic_chr_files($1_t)
1374 dev_getattr_mtrr_dev($1_t)
1375 # Allow MAKEDEV to work
1376 dev_create_all_blk_files($1_t)
1377 dev_create_all_chr_files($1_t)
1378 dev_delete_all_blk_files($1_t)
1379 dev_delete_all_chr_files($1_t)
1380 dev_rename_all_blk_files($1_t)
1381 dev_rename_all_chr_files($1_t)
1382 dev_create_generic_symlinks($1_t)
1383 dev_rw_generic_usb_dev($1_t)
1386 domain_setpriority_all_domains($1_t)
1387 domain_read_all_domains_state($1_t)
1388 domain_getattr_all_domains($1_t)
1389 domain_getcap_all_domains($1_t)
1390 domain_dontaudit_ptrace_all_domains($1_t)
1391 # signal all domains:
1392 domain_kill_all_domains($1_t)
1393 domain_signal_all_domains($1_t)
1394 domain_signull_all_domains($1_t)
1395 domain_sigstop_all_domains($1_t)
1396 domain_sigstop_all_domains($1_t)
1397 domain_sigchld_all_domains($1_t)
1399 domain_getattr_all_sockets($1_t)
1400 domain_dontaudit_getattr_all_sockets($1_t)
1402 files_exec_usr_src_files($1_t)
1404 fs_getattr_all_fs($1_t)
1405 fs_getattr_all_files($1_t)
1407 fs_set_all_quotas($1_t)
1408 fs_exec_noxattr($1_t)
1410 storage_raw_read_removable_device($1_t)
1411 storage_raw_write_removable_device($1_t)
1412 storage_dontaudit_read_fixed_disk($1_t)
1414 term_use_all_inherited_terms($1_t)
1415 term_use_unallocated_ttys($1_t)
1417 auth_getattr_shadow($1_t)
1418 # Manage almost all files
1419 auth_manage_all_files_except_shadow($1_t)
1420 # Relabel almost all files
1421 auth_relabel_all_files_except_shadow($1_t)
1425 logging_send_syslog_msg($1_t)
1428 modutils_domtrans_insmod($1_t)
1429 modutils_domtrans_depmod($1_t)
1432 # The following rule is temporary until such time that a complete
1433 # policy management infrastructure is in place so that an administrator
1434 # cannot directly manipulate policy files with arbitrary programs.
1435 seutil_manage_src_policy($1_t)
1436 # Violates the goal of limiting write access to checkpolicy.
1437 # But presently necessary for installing the file_contexts file.
1438 seutil_manage_bin_policy($1_t)
1440 userdom_manage_user_home_content_dirs($1_t)
1441 userdom_manage_user_home_content_files($1_t)
1442 userdom_manage_user_home_content_symlinks($1_t)
1443 userdom_manage_user_home_content_pipes($1_t)
1444 userdom_manage_user_home_content_sockets($1_t)
1445 userdom_user_home_dir_filetrans_user_home_content($1_t, { dir file lnk_file fifo_file sock_file })
1447 tunable_policy(`user_rw_noexattrfile',`
1448 fs_manage_noxattr_fs_files($1_t)
1449 fs_manage_noxattr_fs_dirs($1_t)
1451 fs_read_noxattr_fs_files($1_t)
1455 postgresql_unconfined($1_t)
1459 userhelper_exec($1_t)
1463 ########################################
1465 ## Allow user to run as a secadm
1469 ## Create objects in a user home directory
1470 ## with an automatic type transition to
1471 ## a specified private type.
1474 ## This is a templated interface, and should only
1475 ## be called from a per-userdomain template.
1478 ## <param name="domain">
1480 ## Domain allowed access.
1483 ## <param name="role">
1485 ## The role of the object to create.
1489 template(`userdom_security_admin_template',`
1490 allow $1 self:capability { dac_read_search dac_override };
1492 corecmd_exec_shell($1)
1494 domain_obj_id_change_exemption($1)
1496 dev_relabel_all_dev_nodes($1)
1498 files_create_boot_flag($1)
1499 files_create_default_dir($1)
1500 files_root_filetrans_default($1, dir)
1502 # Necessary for managing /boot/efi
1503 fs_manage_dos_files($1)
1505 mls_process_read_up($1)
1506 mls_file_read_all_levels($1)
1507 mls_file_upgrade($1)
1508 mls_file_downgrade($1)
1510 selinux_set_enforce_mode($1)
1511 selinux_set_all_booleans($1)
1512 selinux_set_parameters($1)
1513 selinux_read_policy($1)
1515 auth_relabel_all_files_except_shadow($1)
1516 auth_relabel_shadow($1)
1520 logging_send_syslog_msg($1)
1521 logging_read_audit_log($1)
1522 logging_read_generic_logs($1)
1523 logging_read_audit_config($1)
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)
1530 seutil_run_checkpolicy($1,$2)
1531 seutil_run_loadpolicy($1,$2)
1532 seutil_run_semanage($1,$2)
1533 seutil_run_setsebool($1,$2)
1534 seutil_run_setfiles($1, $2)
1536 seutil_manage_bin_policy($1)
1537 seutil_manage_default_contexts($1)
1538 seutil_manage_file_contexts($1)
1539 seutil_manage_module_store($1)
1540 seutil_manage_config($1)
1547 consoletype_exec($1)
1555 ipsec_run_setkey($1,$2)
1559 netlabel_run_mgmt($1,$2)
1567 ########################################
1569 ## Make the specified type usable in a
1570 ## user home directory.
1572 ## <param name="type">
1574 ## Type to be used as a file in the
1575 ## user home directory.
1579 interface(`userdom_user_home_content',`
1582 attribute user_home_type;
1585 allow $1 user_home_t:filesystem associate;
1587 ubac_constrained($1)
1589 files_poly_member($1)
1590 typeattribute $1 user_home_type;
1593 ########################################
1595 ## Make the specified type usable in a
1596 ## generic temporary directory.
1598 ## <param name="type">
1600 ## Type to be used as a file in the
1601 ## generic temporary directory.
1605 interface(`userdom_user_tmp_content',`
1607 attribute user_tmp_type;
1610 typeattribute $1 user_tmp_type;
1613 ubac_constrained($1)
1616 ########################################
1618 ## Make the specified type usable in a
1619 ## generic tmpfs_t directory.
1621 ## <param name="type">
1623 ## Type to be used as a file in the
1624 ## generic temporary directory.
1628 interface(`userdom_user_tmpfs_content',`
1630 attribute user_tmpfs_type;
1633 typeattribute $1 user_tmpfs_type;
1635 files_tmpfs_file($1)
1636 ubac_constrained($1)
1639 ########################################
1641 ## Allow domain to attach to TUN devices created by administrative users.
1643 ## <param name="domain">
1645 ## Domain allowed access.
1649 interface(`userdom_attach_admin_tun_iface',`
1651 attribute admindomain;
1654 allow $1 admindomain:tun_socket relabelfrom;
1655 allow $1 self:tun_socket relabelto;
1658 ########################################
1660 ## Set the attributes of a user pty.
1662 ## <param name="domain">
1664 ## Domain allowed access.
1668 interface(`userdom_setattr_user_ptys',`
1673 allow $1 user_devpts_t:chr_file setattr_chr_file_perms;
1676 ########################################
1678 ## Create a user pty.
1680 ## <param name="domain">
1682 ## Domain allowed access.
1686 interface(`userdom_create_user_pty',`
1691 term_create_pty($1, user_devpts_t)
1694 ########################################
1696 ## Get the attributes of user home directories.
1698 ## <param name="domain">
1700 ## Domain allowed access.
1704 interface(`userdom_getattr_user_home_dirs',`
1706 type user_home_dir_t;
1709 allow $1 user_home_dir_t:dir getattr_dir_perms;
1710 files_search_home($1)
1713 ########################################
1715 ## Do not audit attempts to get the attributes of user home directories.
1717 ## <param name="domain">
1719 ## Domain to not audit.
1723 interface(`userdom_dontaudit_getattr_user_home_dirs',`
1725 type user_home_dir_t;
1728 dontaudit $1 user_home_dir_t:dir getattr_dir_perms;
1731 ########################################
1733 ## Search user home directories.
1735 ## <param name="domain">
1737 ## Domain allowed access.
1741 interface(`userdom_search_user_home_dirs',`
1743 type user_home_dir_t;
1746 allow $1 user_home_dir_t:dir search_dir_perms;
1747 allow $1 user_home_dir_t:lnk_file read_lnk_file_perms;
1748 files_search_home($1)
1751 ########################################
1753 ## Do not audit attempts to search user home directories.
1757 ## Do not audit attempts to search user home directories.
1758 ## This will supress SELinux denial messages when the specified
1759 ## domain is denied the permission to search these directories.
1762 ## <param name="domain">
1764 ## Domain to not audit.
1767 ## <infoflow type="none"/>
1769 interface(`userdom_dontaudit_search_user_home_dirs',`
1771 type user_home_dir_t;
1774 dontaudit $1 user_home_dir_t:dir search_dir_perms;
1777 ########################################
1779 ## List user home directories.
1781 ## <param name="domain">
1783 ## Domain allowed access.
1787 interface(`userdom_list_user_home_dirs',`
1789 type user_home_dir_t;
1792 allow $1 user_home_dir_t:dir list_dir_perms;
1793 files_search_home($1)
1795 tunable_policy(`use_nfs_home_dirs',`
1799 tunable_policy(`use_samba_home_dirs',`
1804 ########################################
1806 ## Do not audit attempts to list user home subdirectories.
1808 ## <param name="domain">
1810 ## Domain to not audit.
1814 interface(`userdom_dontaudit_list_user_home_dirs',`
1816 type user_home_dir_t;
1820 dontaudit $1 user_home_dir_t:dir list_dir_perms;
1821 dontaudit $1 user_home_t:dir list_dir_perms;
1824 ########################################
1826 ## Create user home directories.
1828 ## <param name="domain">
1830 ## Domain allowed access.
1834 interface(`userdom_create_user_home_dirs',`
1836 type user_home_dir_t;
1839 allow $1 user_home_dir_t:dir create_dir_perms;
1842 ########################################
1844 ## Create user home directories.
1846 ## <param name="domain">
1848 ## Domain allowed access.
1852 interface(`userdom_manage_user_home_dirs',`
1854 type user_home_dir_t;
1857 allow $1 user_home_dir_t:dir manage_dir_perms;
1860 ########################################
1862 ## Relabel to user home directories.
1864 ## <param name="domain">
1866 ## Domain allowed access.
1870 interface(`userdom_relabelto_user_home_dirs',`
1872 type user_home_dir_t;
1875 allow $1 user_home_dir_t:dir relabelto;
1879 ########################################
1881 ## Relabel to user home files.
1883 ## <param name="domain">
1885 ## Domain allowed access.
1889 interface(`userdom_relabelto_user_home_files',`
1894 allow $1 user_home_t:file relabelto;
1896 ########################################
1898 ## Relabel user home files.
1900 ## <param name="domain">
1902 ## Domain allowed access.
1906 interface(`userdom_relabel_user_home_files',`
1911 allow $1 user_home_t:file relabel_file_perms;
1914 ########################################
1916 ## Create directories in the home dir root with
1917 ## the user home directory type.
1919 ## <param name="domain">
1921 ## Domain allowed access.
1925 interface(`userdom_home_filetrans_user_home_dir',`
1927 type user_home_dir_t;
1930 files_home_filetrans($1, user_home_dir_t, dir)
1933 ########################################
1935 ## Do a domain transition to the specified
1936 ## domain when executing a program in the
1937 ## user home directory.
1941 ## Do a domain transition to the specified
1942 ## domain when executing a program in the
1943 ## user home directory.
1946 ## No interprocess communication (signals, pipes,
1947 ## etc.) is provided by this interface since
1948 ## the domains are not owned by this module.
1951 ## <param name="source_domain">
1953 ## Domain allowed to transition.
1956 ## <param name="target_domain">
1958 ## Domain to transition to.
1962 interface(`userdom_user_home_domtrans',`
1964 type user_home_dir_t, user_home_t;
1967 domain_auto_trans($1, user_home_t, $2)
1968 allow $1 user_home_dir_t:dir search_dir_perms;
1969 files_search_home($1)
1972 ########################################
1974 ## Do not audit attempts to search user home content directories.
1976 ## <param name="domain">
1978 ## Domain to not audit.
1982 interface(`userdom_dontaudit_search_user_home_content',`
1987 dontaudit $1 user_home_t:dir search_dir_perms;
1988 fs_dontaudit_list_nfs($1)
1989 fs_dontaudit_list_cifs($1)
1992 ########################################
1994 ## List contents of users home directory.
1996 ## <param name="domain">
1998 ## Domain allowed access.
2002 interface(`userdom_list_user_home_content',`
2004 type user_home_dir_t;
2005 attribute user_home_type;
2009 allow $1 { user_home_dir_t user_home_type }:dir list_dir_perms;
2012 ########################################
2014 ## Create, read, write, and delete directories
2015 ## in a user home subdirectory.
2017 ## <param name="domain">
2019 ## Domain allowed access.
2023 interface(`userdom_manage_user_home_content_dirs',`
2025 type user_home_dir_t, user_home_t;
2028 manage_dirs_pattern($1, { user_home_dir_t user_home_t }, user_home_t)
2029 files_search_home($1)
2032 ########################################
2034 ## Delete directories in a user home subdirectory.
2036 ## <param name="domain">
2038 ## Domain allowed access.
2042 interface(`userdom_delete_user_home_content_dirs',`
2047 allow $1 user_home_t:dir delete_dir_perms;
2050 ########################################
2052 ## Set the attributes of user home files.
2054 ## <param name="domain">
2056 ## Domain allowed access.
2061 interface(`userdom_setattr_user_home_content_files',`
2066 allow $1 user_home_t:file setattr;
2069 ########################################
2071 ## Do not audit attempts to set the
2072 ## attributes of user home files.
2074 ## <param name="domain">
2076 ## Domain to not audit.
2080 interface(`userdom_dontaudit_setattr_user_home_content_files',`
2085 dontaudit $1 user_home_t:file setattr_file_perms;
2088 ########################################
2090 ## Mmap user home files.
2092 ## <param name="domain">
2094 ## Domain allowed access.
2098 interface(`userdom_mmap_user_home_content_files',`
2100 type user_home_dir_t, user_home_t;
2103 mmap_files_pattern($1, { user_home_dir_t user_home_t }, user_home_t)
2104 files_search_home($1)
2107 ########################################
2109 ## Read user home files.
2111 ## <param name="domain">
2113 ## Domain allowed access.
2117 interface(`userdom_read_user_home_content_files',`
2119 type user_home_dir_t, user_home_t;
2122 list_dirs_pattern($1, { user_home_dir_t user_home_t }, { user_home_dir_t user_home_t })
2123 read_files_pattern($1, { user_home_dir_t user_home_t }, user_home_t)
2124 files_search_home($1)
2127 ########################################
2129 ## Do not audit attempts to getattr user home files.
2131 ## <param name="domain">
2133 ## Domain to not audit.
2137 interface(`userdom_dontaudit_getattr_user_home_content',`
2139 attribute user_home_type;
2142 dontaudit $1 user_home_type:dir getattr;
2143 dontaudit $1 user_home_type:file getattr;
2146 ########################################
2148 ## Do not audit attempts to read user home files.
2150 ## <param name="domain">
2152 ## Domain to not audit.
2156 interface(`userdom_dontaudit_read_user_home_content_files',`
2158 attribute user_home_type;
2159 type user_home_dir_t;
2162 dontaudit $1 user_home_dir_t:dir list_dir_perms;
2163 dontaudit $1 user_home_type:dir list_dir_perms;
2164 dontaudit $1 user_home_type:file read_file_perms;
2165 dontaudit $1 user_home_type:lnk_file read_lnk_file_perms;
2168 ########################################
2170 ## Do not audit attempts to append user home files.
2172 ## <param name="domain">
2174 ## Domain to not audit.
2178 interface(`userdom_dontaudit_append_user_home_content_files',`
2183 dontaudit $1 user_home_t:file append_file_perms;
2186 ########################################
2188 ## Do not audit attempts to write user home files.
2190 ## <param name="domain">
2192 ## Domain to not audit.
2196 interface(`userdom_dontaudit_write_user_home_content_files',`
2201 dontaudit $1 user_home_t:file write_file_perms;
2204 ########################################
2206 ## Delete files in a user home subdirectory.
2208 ## <param name="domain">
2210 ## Domain allowed access.
2214 interface(`userdom_delete_user_home_content_files',`
2219 allow $1 user_home_t:file delete_file_perms;
2222 ########################################
2224 ## Delete sock files in a user home subdirectory.
2226 ## <param name="domain">
2228 ## Domain allowed access.
2232 interface(`userdom_delete_user_home_content_sock_files',`
2237 allow $1 user_home_t:sock_file delete_file_perms;
2240 ########################################
2242 ## Do not audit attempts to write user home files.
2244 ## <param name="domain">
2246 ## Domain to not audit.
2250 interface(`userdom_dontaudit_relabel_user_home_content_files',`
2255 dontaudit $1 user_home_t:file relabel_file_perms;
2258 ########################################
2260 ## Read user home subdirectory symbolic links.
2262 ## <param name="domain">
2264 ## Domain allowed access.
2268 interface(`userdom_read_user_home_content_symlinks',`
2270 type user_home_dir_t, user_home_t;
2273 allow $1 { user_home_dir_t user_home_t }:lnk_file read_lnk_file_perms;
2276 ########################################
2278 ## Execute user home files.
2280 ## <param name="domain">
2282 ## Domain allowed access.
2287 interface(`userdom_exec_user_home_content_files',`
2289 type user_home_dir_t;
2290 attribute user_home_type;
2293 files_search_home($1)
2294 exec_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
2295 dontaudit $1 user_home_type:sock_file execute;
2298 ########################################
2300 ## Do not audit attempts to execute user home files.
2302 ## <param name="domain">
2304 ## Domain to not audit.
2308 interface(`userdom_dontaudit_exec_user_home_content_files',`
2313 dontaudit $1 user_home_t:file exec_file_perms;
2316 ########################################
2318 ## Create, read, write, and delete files
2319 ## in a user home subdirectory.
2321 ## <param name="domain">
2323 ## Domain allowed access.
2327 interface(`userdom_manage_user_home_content_files',`
2329 type user_home_dir_t, user_home_t;
2332 manage_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 ## Do not audit attempts to create, read, write, and delete directories
2340 ## in a user home subdirectory.
2342 ## <param name="domain">
2344 ## Domain to not audit.
2348 interface(`userdom_dontaudit_manage_user_home_content_dirs',`
2350 type user_home_dir_t, user_home_t;
2353 dontaudit $1 user_home_t:dir manage_dir_perms;
2356 ########################################
2358 ## Create, read, write, and delete symbolic links
2359 ## in a user home subdirectory.
2361 ## <param name="domain">
2363 ## Domain allowed access.
2367 interface(`userdom_manage_user_home_content_symlinks',`
2369 type user_home_dir_t, user_home_t;
2372 manage_lnk_files_pattern($1, user_home_t, user_home_t)
2373 allow $1 user_home_dir_t:dir search_dir_perms;
2374 files_search_home($1)
2377 ########################################
2379 ## Delete symbolic links in a user home directory.
2381 ## <param name="domain">
2383 ## Domain allowed access.
2387 interface(`userdom_delete_user_home_content_symlinks',`
2392 allow $1 user_home_t:lnk_file delete_lnk_file_perms;
2395 ########################################
2397 ## Create, read, write, and delete named pipes
2398 ## in a user home subdirectory.
2400 ## <param name="domain">
2402 ## Domain allowed access.
2406 interface(`userdom_manage_user_home_content_pipes',`
2408 type user_home_dir_t, user_home_t;
2411 manage_fifo_files_pattern($1, user_home_t, user_home_t)
2412 allow $1 user_home_dir_t:dir search_dir_perms;
2413 files_search_home($1)
2416 ########################################
2418 ## Create, read, write, and delete named sockets
2419 ## in a user home subdirectory.
2421 ## <param name="domain">
2423 ## Domain allowed access.
2427 interface(`userdom_manage_user_home_content_sockets',`
2429 type user_home_dir_t, user_home_t;
2432 allow $1 user_home_dir_t:dir search_dir_perms;
2433 manage_sock_files_pattern($1, user_home_t, user_home_t)
2434 files_search_home($1)
2437 ########################################
2439 ## Create objects in a user home directory
2440 ## with an automatic type transition to
2441 ## a specified private type.
2443 ## <param name="domain">
2445 ## Domain allowed access.
2448 ## <param name="private_type">
2450 ## The type of the object to create.
2453 ## <param name="object_class">
2455 ## The class of the object to be created.
2459 interface(`userdom_user_home_dir_filetrans',`
2461 type user_home_dir_t;
2464 filetrans_pattern($1, user_home_dir_t, $2, $3, $4)
2465 files_search_home($1)
2468 ########################################
2470 ## Create objects in a user home directory
2471 ## with an automatic type transition to
2472 ## a specified private type.
2474 ## <param name="domain">
2476 ## Domain allowed access.
2479 ## <param name="private_type">
2481 ## The type of the object to create.
2484 ## <param name="object_class">
2486 ## The class of the object to be created.
2490 interface(`userdom_user_home_content_filetrans',`
2492 type user_home_dir_t, user_home_t;
2495 filetrans_pattern($1, user_home_t, $2, $3)
2496 allow $1 user_home_dir_t:dir search_dir_perms;
2497 files_search_home($1)
2500 ########################################
2502 ## Create objects in a user home directory
2503 ## with an automatic type transition to
2504 ## the user home file type.
2506 ## <param name="domain">
2508 ## Domain allowed access.
2511 ## <param name="object_class">
2513 ## The class of the object to be created.
2517 interface(`userdom_user_home_dir_filetrans_user_home_content',`
2519 type user_home_dir_t, user_home_t;
2522 filetrans_pattern($1, user_home_dir_t, user_home_t, $2)
2523 files_search_home($1)
2526 ########################################
2528 ## Write to user temporary named sockets.
2530 ## <param name="domain">
2532 ## Domain allowed access.
2536 interface(`userdom_write_user_tmp_sockets',`
2541 allow $1 user_tmp_t:sock_file write_sock_file_perms;
2542 files_search_tmp($1)
2545 ########################################
2547 ## List user temporary directories.
2549 ## <param name="domain">
2551 ## Domain allowed access.
2555 interface(`userdom_list_user_tmp',`
2560 allow $1 user_tmp_t:dir list_dir_perms;
2561 files_search_tmp($1)
2564 ########################################
2566 ## Do not audit attempts to list user
2567 ## temporary directories.
2569 ## <param name="domain">
2571 ## Domain to not audit.
2575 interface(`userdom_dontaudit_list_user_tmp',`
2580 dontaudit $1 user_tmp_t:dir list_dir_perms;
2583 ########################################
2585 ## Do not audit attempts to manage users
2586 ## temporary directories.
2588 ## <param name="domain">
2590 ## Domain to not audit.
2594 interface(`userdom_dontaudit_manage_user_tmp_dirs',`
2599 dontaudit $1 user_tmp_t:dir manage_dir_perms;
2602 ########################################
2604 ## Read user temporary files.
2606 ## <param name="domain">
2608 ## Domain allowed access.
2612 interface(`userdom_read_user_tmp_files',`
2617 read_files_pattern($1, user_tmp_t, user_tmp_t)
2618 allow $1 user_tmp_t:dir list_dir_perms;
2619 files_search_tmp($1)
2622 ########################################
2624 ## Do not audit attempts to read users
2627 ## <param name="domain">
2629 ## Domain to not audit.
2633 interface(`userdom_dontaudit_read_user_tmp_files',`
2638 dontaudit $1 user_tmp_t:file read_inherited_file_perms;
2641 ########################################
2643 ## Do not audit attempts to append users
2646 ## <param name="domain">
2648 ## Domain to not audit.
2652 interface(`userdom_dontaudit_append_user_tmp_files',`
2657 dontaudit $1 user_tmp_t:file append_file_perms;
2660 ########################################
2662 ## Read and write user temporary files.
2664 ## <param name="domain">
2666 ## Domain allowed access.
2670 interface(`userdom_rw_user_tmp_files',`
2675 allow $1 user_tmp_t:dir list_dir_perms;
2676 rw_files_pattern($1, user_tmp_t, user_tmp_t)
2677 files_search_tmp($1)
2680 ########################################
2682 ## Do not audit attempts to manage users
2685 ## <param name="domain">
2687 ## Domain to not audit.
2691 interface(`userdom_dontaudit_manage_user_tmp_files',`
2696 dontaudit $1 user_tmp_t:file manage_file_perms;
2699 ########################################
2701 ## Read user temporary symbolic links.
2703 ## <param name="domain">
2705 ## Domain allowed access.
2709 interface(`userdom_read_user_tmp_symlinks',`
2714 read_lnk_files_pattern($1, user_tmp_t, user_tmp_t)
2715 allow $1 user_tmp_t:dir list_dir_perms;
2716 files_search_tmp($1)
2719 ########################################
2721 ## Create, read, write, and delete user
2722 ## temporary directories.
2724 ## <param name="domain">
2726 ## Domain allowed access.
2730 interface(`userdom_manage_user_tmp_dirs',`
2735 manage_dirs_pattern($1, user_tmp_t, user_tmp_t)
2736 files_search_tmp($1)
2739 ########################################
2741 ## Create, read, write, and delete user
2744 ## <param name="domain">
2746 ## Domain allowed access.
2750 interface(`userdom_manage_user_tmp_files',`
2755 manage_files_pattern($1, user_tmp_t, user_tmp_t)
2756 files_search_tmp($1)
2759 ########################################
2761 ## Create, read, write, and delete user
2762 ## temporary symbolic links.
2764 ## <param name="domain">
2766 ## Domain allowed access.
2770 interface(`userdom_manage_user_tmp_symlinks',`
2775 manage_lnk_files_pattern($1, user_tmp_t, user_tmp_t)
2776 files_search_tmp($1)
2779 ########################################
2781 ## Create, read, write, and delete user
2782 ## temporary named pipes.
2784 ## <param name="domain">
2786 ## Domain allowed access.
2790 interface(`userdom_manage_user_tmp_pipes',`
2795 manage_fifo_files_pattern($1, user_tmp_t, user_tmp_t)
2796 files_search_tmp($1)
2799 ########################################
2801 ## Create, read, write, and delete user
2802 ## temporary named sockets.
2804 ## <param name="domain">
2806 ## Domain allowed access.
2810 interface(`userdom_manage_user_tmp_sockets',`
2815 manage_sock_files_pattern($1, user_tmp_t, user_tmp_t)
2816 files_search_tmp($1)
2819 ########################################
2821 ## Create objects in a user temporary directory
2822 ## with an automatic type transition to
2823 ## a specified private type.
2825 ## <param name="domain">
2827 ## Domain allowed access.
2830 ## <param name="private_type">
2832 ## The type of the object to create.
2835 ## <param name="object_class">
2837 ## The class of the object to be created.
2841 interface(`userdom_user_tmp_filetrans',`
2846 filetrans_pattern($1, user_tmp_t, $2, $3)
2847 files_search_tmp($1)
2850 ########################################
2852 ## Create objects in the temporary directory
2853 ## with an automatic type transition to
2854 ## the user temporary type.
2856 ## <param name="domain">
2858 ## Domain allowed access.
2861 ## <param name="object_class">
2863 ## The class of the object to be created.
2867 interface(`userdom_tmp_filetrans_user_tmp',`
2872 files_tmp_filetrans($1, user_tmp_t, $2)
2875 ########################################
2877 ## Read user tmpfs files.
2879 ## <param name="domain">
2881 ## Domain allowed access.
2885 interface(`userdom_read_user_tmpfs_files',`
2890 read_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
2891 read_lnk_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
2892 allow $1 user_tmpfs_t:dir list_dir_perms;
2896 ########################################
2898 ## Read/Write user tmpfs files.
2900 ## <param name="domain">
2902 ## Domain allowed access.
2906 interface(`userdom_rw_user_tmpfs_files',`
2911 rw_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
2912 read_lnk_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
2913 allow $1 user_tmpfs_t:dir list_dir_perms;
2917 ########################################
2919 ## Get the attributes of a user domain tty.
2921 ## <param name="domain">
2923 ## Domain allowed access.
2927 interface(`userdom_getattr_user_ttys',`
2929 type user_tty_device_t;
2932 allow $1 user_tty_device_t:chr_file getattr_chr_file_perms;
2935 ########################################
2937 ## Do not audit attempts to get the attributes of a user domain tty.
2939 ## <param name="domain">
2941 ## Domain to not audit.
2945 interface(`userdom_dontaudit_getattr_user_ttys',`
2947 type user_tty_device_t;
2950 dontaudit $1 user_tty_device_t:chr_file getattr_chr_file_perms;
2953 ########################################
2955 ## Set the attributes of a user domain tty.
2957 ## <param name="domain">
2959 ## Domain allowed access.
2963 interface(`userdom_setattr_user_ttys',`
2965 type user_tty_device_t;
2968 allow $1 user_tty_device_t:chr_file setattr_chr_file_perms;
2971 ########################################
2973 ## Do not audit attempts to set the attributes of a user domain tty.
2975 ## <param name="domain">
2977 ## Domain to not audit.
2981 interface(`userdom_dontaudit_setattr_user_ttys',`
2983 type user_tty_device_t;
2986 dontaudit $1 user_tty_device_t:chr_file setattr_chr_file_perms;
2989 ########################################
2991 ## Read and write a user domain tty.
2993 ## <param name="domain">
2995 ## Domain allowed access.
2999 interface(`userdom_use_user_ttys',`
3001 type user_tty_device_t;
3004 allow $1 user_tty_device_t:chr_file rw_term_perms;
3007 ########################################
3009 ## Read and write a inherited user domain tty.
3011 ## <param name="domain">
3013 ## Domain allowed access.
3017 interface(`userdom_use_inherited_user_ttys',`
3019 type user_tty_device_t;
3022 allow $1 user_tty_device_t:chr_file rw_inherited_term_perms;
3025 ########################################
3027 ## Read and write a user domain pty.
3029 ## <param name="domain">
3031 ## Domain allowed access.
3035 interface(`userdom_use_user_ptys',`
3040 allow $1 user_devpts_t:chr_file rw_term_perms;
3043 ########################################
3045 ## Read and write a inherited user domain pty.
3047 ## <param name="domain">
3049 ## Domain allowed access.
3053 interface(`userdom_use_inherited_user_ptys',`
3058 allow $1 user_devpts_t:chr_file rw_inherited_term_perms;
3061 ########################################
3063 ## Read and write a inherited user TTYs and PTYs.
3067 ## Allow the specified domain to read and write inherited user
3068 ## TTYs and PTYs. This will allow the domain to
3069 ## interact with the user via the terminal. Typically
3070 ## all interactive applications will require this
3074 ## <param name="domain">
3076 ## Domain allowed access.
3079 ## <infoflow type="both" weight="10"/>
3081 interface(`userdom_use_inherited_user_terminals',`
3083 type user_tty_device_t, user_devpts_t;
3086 allow $1 user_tty_device_t:chr_file rw_inherited_term_perms;
3087 allow $1 user_devpts_t:chr_file rw_inherited_term_perms;
3090 #######################################
3092 ## Allow attempts to read and write
3093 ## a user domain tty and pty.
3095 ## <param name="domain">
3097 ## Domain to not audit.
3101 interface(`userdom_use_user_terminals',`
3103 type user_tty_device_t, user_devpts_t;
3106 allow $1 user_tty_device_t:chr_file rw_term_perms;
3107 allow $1 user_devpts_t:chr_file rw_term_perms;
3110 ########################################
3112 ## Do not audit attempts to read and write
3113 ## a user domain tty and pty.
3115 ## <param name="domain">
3117 ## Domain to not audit.
3121 interface(`userdom_dontaudit_use_user_terminals',`
3123 type user_tty_device_t, user_devpts_t;
3126 dontaudit $1 user_tty_device_t:chr_file rw_term_perms;
3127 dontaudit $1 user_devpts_t:chr_file rw_term_perms;
3131 ########################################
3133 ## Get attributes of user domain tty and pty.
3135 ## <param name="domain">
3137 ## Domain allowed access.
3141 interface(`userdom_getattr_user_terminals',`
3143 type user_tty_device_t, user_devpts_t;
3146 allow $1 { user_tty_device_t user_devpts_t }:chr_file getattr_chr_file_perms;
3149 ########################################
3151 ## Execute a shell in all user domains. This
3152 ## is an explicit transition, requiring the
3153 ## caller to use setexeccon().
3155 ## <param name="domain">
3157 ## Domain allowed to transition.
3161 interface(`userdom_spec_domtrans_all_users',`
3163 attribute userdomain;
3166 corecmd_shell_spec_domtrans($1, userdomain)
3167 allow userdomain $1:fd use;
3168 allow userdomain $1:fifo_file rw_file_perms;
3169 allow userdomain $1:process sigchld;
3172 ########################################
3174 ## Execute an Xserver session in all unprivileged user domains. This
3175 ## is an explicit transition, requiring the
3176 ## caller to use setexeccon().
3178 ## <param name="domain">
3180 ## Domain allowed to transition.
3184 interface(`userdom_xsession_spec_domtrans_all_users',`
3186 attribute userdomain;
3189 xserver_xsession_spec_domtrans($1, userdomain)
3190 allow userdomain $1:fd use;
3191 allow userdomain $1:fifo_file rw_file_perms;
3192 allow userdomain $1:process sigchld;
3195 ########################################
3197 ## Execute a shell in all unprivileged user domains. This
3198 ## is an explicit transition, requiring the
3199 ## caller to use setexeccon().
3201 ## <param name="domain">
3203 ## Domain allowed to transition.
3207 interface(`userdom_spec_domtrans_unpriv_users',`
3209 attribute unpriv_userdomain;
3212 corecmd_shell_spec_domtrans($1, unpriv_userdomain)
3213 allow unpriv_userdomain $1:fd use;
3214 allow unpriv_userdomain $1:fifo_file rw_file_perms;
3215 allow unpriv_userdomain $1:process sigchld;
3218 ########################################
3220 ## Execute an Xserver session in all unprivileged user domains. This
3221 ## is an explicit transition, requiring the
3222 ## caller to use setexeccon().
3224 ## <param name="domain">
3226 ## Domain allowed to transition.
3230 interface(`userdom_xsession_spec_domtrans_unpriv_users',`
3232 attribute unpriv_userdomain;
3235 xserver_xsession_spec_domtrans($1, unpriv_userdomain)
3236 allow unpriv_userdomain $1:fd use;
3237 allow unpriv_userdomain $1:fifo_file rw_file_perms;
3238 allow unpriv_userdomain $1:process sigchld;
3241 ########################################
3243 ## Manage unpriviledged user SysV sempaphores.
3245 ## <param name="domain">
3247 ## Domain allowed access.
3251 interface(`userdom_manage_unpriv_user_semaphores',`
3253 attribute unpriv_userdomain;
3256 allow $1 unpriv_userdomain:sem create_sem_perms;
3259 ########################################
3261 ## Manage unpriviledged user SysV shared
3264 ## <param name="domain">
3266 ## Domain allowed access.
3270 interface(`userdom_manage_unpriv_user_shared_mem',`
3272 attribute unpriv_userdomain;
3275 allow $1 unpriv_userdomain:shm create_shm_perms;
3278 ########################################
3280 ## Execute bin_t in the unprivileged user domains. This
3281 ## is an explicit transition, requiring the
3282 ## caller to use setexeccon().
3284 ## <param name="domain">
3286 ## Domain allowed to transition.
3290 interface(`userdom_bin_spec_domtrans_unpriv_users',`
3292 attribute unpriv_userdomain;
3295 corecmd_bin_spec_domtrans($1, unpriv_userdomain)
3296 allow unpriv_userdomain $1:fd use;
3297 allow unpriv_userdomain $1:fifo_file rw_file_perms;
3298 allow unpriv_userdomain $1:process sigchld;
3301 ########################################
3303 ## Execute all entrypoint files in unprivileged user
3304 ## domains. This is an explicit transition, requiring the
3305 ## caller to use setexeccon().
3307 ## <param name="domain">
3309 ## Domain allowed access.
3313 interface(`userdom_entry_spec_domtrans_unpriv_users',`
3315 attribute unpriv_userdomain;
3318 domain_entry_file_spec_domtrans($1, unpriv_userdomain)
3319 allow unpriv_userdomain $1:fd use;
3320 allow unpriv_userdomain $1:fifo_file rw_fifo_file_perms;
3321 allow unpriv_userdomain $1:process sigchld;
3324 ########################################
3326 ## Search users home directories.
3328 ## <param name="domain">
3330 ## Domain allowed access.
3334 interface(`userdom_search_user_home_content',`
3336 type user_home_dir_t;
3337 attribute user_home_type;
3341 allow $1 { user_home_dir_t user_home_type }:dir search_dir_perms;
3342 allow $1 { user_home_dir_t user_home_type }:lnk_file read_lnk_file_perms;
3345 ########################################
3347 ## Send general signals to unprivileged user domains.
3349 ## <param name="domain">
3351 ## Domain allowed access.
3355 interface(`userdom_signal_unpriv_users',`
3357 attribute unpriv_userdomain;
3360 allow $1 unpriv_userdomain:process signal;
3363 ########################################
3365 ## Inherit the file descriptors from unprivileged user domains.
3367 ## <param name="domain">
3369 ## Domain allowed access.
3373 interface(`userdom_use_unpriv_users_fds',`
3375 attribute unpriv_userdomain;
3378 allow $1 unpriv_userdomain:fd use;
3381 ########################################
3383 ## Do not audit attempts to inherit the file descriptors
3384 ## from unprivileged user domains.
3388 ## Do not audit attempts to inherit the file descriptors
3389 ## from unprivileged user domains. This will supress
3390 ## SELinux denial messages when the specified domain is denied
3391 ## the permission to inherit these file descriptors.
3394 ## <param name="domain">
3396 ## Domain to not audit.
3399 ## <infoflow type="none"/>
3401 interface(`userdom_dontaudit_use_unpriv_user_fds',`
3403 attribute unpriv_userdomain;
3406 dontaudit $1 unpriv_userdomain:fd use;
3409 ########################################
3411 ## Do not audit attempts to use user ptys.
3413 ## <param name="domain">
3415 ## Domain to not audit.
3419 interface(`userdom_dontaudit_use_user_ptys',`
3424 dontaudit $1 user_devpts_t:chr_file rw_inherited_file_perms;
3427 ########################################
3429 ## Relabel files to unprivileged user pty types.
3431 ## <param name="domain">
3433 ## Domain allowed access.
3437 interface(`userdom_relabelto_user_ptys',`
3442 allow $1 user_devpts_t:chr_file relabelto;
3445 ########################################
3447 ## Do not audit attempts to relabel files from
3450 ## <param name="domain">
3452 ## Domain to not audit.
3456 interface(`userdom_dontaudit_relabelfrom_user_ptys',`
3461 dontaudit $1 user_devpts_t:chr_file relabelfrom;
3464 ########################################
3466 ## Write all users files in /tmp
3468 ## <param name="domain">
3470 ## Domain allowed access.
3474 interface(`userdom_write_user_tmp_files',`
3479 write_files_pattern($1, user_tmp_t, user_tmp_t)
3482 ########################################
3484 ## Do not audit attempts to write users
3487 ## <param name="domain">
3489 ## Domain to not audit.
3493 interface(`userdom_dontaudit_write_user_tmp_files',`
3498 dontaudit $1 user_tmp_t:file write;
3501 ########################################
3503 ## Do not audit attempts to read/write users
3504 ## temporary fifo files.
3506 ## <param name="domain">
3508 ## Domain to not audit.
3512 interface(`userdom_dontaudit_rw_user_tmp_pipes',`
3517 dontaudit $1 user_tmp_t:fifo_file rw_inherited_fifo_file_perms;
3520 ########################################
3522 ## Do not audit attempts to use user ttys.
3524 ## <param name="domain">
3526 ## Domain to not audit.
3530 interface(`userdom_dontaudit_use_user_ttys',`
3532 type user_tty_device_t;
3535 dontaudit $1 user_tty_device_t:chr_file rw_file_perms;
3538 ########################################
3540 ## Read the process state of all user domains.
3542 ## <param name="domain">
3544 ## Domain allowed access.
3548 interface(`userdom_read_all_users_state',`
3550 attribute userdomain;
3553 read_files_pattern($1, userdomain, userdomain)
3554 read_lnk_files_pattern($1,userdomain,userdomain)
3555 kernel_search_proc($1)
3558 ########################################
3560 ## Get the attributes of all user domains.
3562 ## <param name="domain">
3564 ## Domain allowed access.
3568 interface(`userdom_getattr_all_users',`
3570 attribute userdomain;
3573 allow $1 userdomain:process getattr;
3576 ########################################
3578 ## Inherit the file descriptors from all user domains
3580 ## <param name="domain">
3582 ## Domain allowed access.
3586 interface(`userdom_use_all_users_fds',`
3588 attribute userdomain;
3591 allow $1 userdomain:fd use;
3594 ########################################
3596 ## Do not audit attempts to inherit the file
3597 ## descriptors from any user domains.
3599 ## <param name="domain">
3601 ## Domain to not audit.
3605 interface(`userdom_dontaudit_use_all_users_fds',`
3607 attribute userdomain;
3610 dontaudit $1 userdomain:fd use;
3613 ########################################
3615 ## Send general signals to all user domains.
3617 ## <param name="domain">
3619 ## Domain allowed access.
3623 interface(`userdom_signal_all_users',`
3625 attribute userdomain;
3628 allow $1 userdomain:process signal;
3631 ########################################
3633 ## Send kill signals to all user domains.
3635 ## <param name="domain">
3637 ## Domain allowed access.
3641 interface(`userdom_kill_all_users',`
3643 attribute userdomain;
3646 allow $1 userdomain:process sigkill;
3649 ########################################
3651 ## Send a SIGCHLD signal to all user domains.
3653 ## <param name="domain">
3655 ## Domain allowed access.
3659 interface(`userdom_sigchld_all_users',`
3661 attribute userdomain;
3664 allow $1 userdomain:process sigchld;
3667 ########################################
3669 ## Create keys for all user domains.
3671 ## <param name="domain">
3673 ## Domain allowed access.
3677 interface(`userdom_create_all_users_keys',`
3679 attribute userdomain;
3682 allow $1 userdomain:key create;
3685 ########################################
3687 ## Send a dbus message to all user domains.
3689 ## <param name="domain">
3691 ## Domain allowed access.
3695 interface(`userdom_dbus_send_all_users',`
3697 attribute userdomain;
3698 class dbus send_msg;
3701 allow $1 userdomain:dbus send_msg;
3704 ########################################
3706 ## Allow apps to set rlimits on userdomain
3708 ## <param name="domain">
3710 ## Domain allowed access.
3714 interface(`userdom_set_rlimitnh',`
3716 attribute userdomain;
3719 allow $1 userdomain:process rlimitinh;
3722 ########################################
3724 ## Define this type as a Allow apps to set rlimits on userdomain
3726 ## <param name="domain">
3728 ## Domain allowed access.
3731 ## <param name="userdomain_prefix">
3733 ## The prefix of the user domain (e.g., user
3734 ## is the prefix for user_t).
3737 ## <param name="domain">
3739 ## Domain allowed access.
3743 template(`userdom_unpriv_usertype',`
3745 attribute unpriv_userdomain, userdomain;
3746 attribute $1_usertype;
3748 typeattribute $2 $1_usertype;
3749 typeattribute $2 unpriv_userdomain;
3750 typeattribute $2 userdomain;
3752 ubac_constrained($2)
3755 ########################################
3757 ## Connect to users over an unix stream socket.
3759 ## <param name="domain">
3761 ## Domain allowed access.
3765 interface(`userdom_stream_connect',`
3768 attribute userdomain;
3771 stream_connect_pattern($1, user_tmp_t, user_tmp_t, userdomain)
3774 ########################################
3776 ## Ptrace user domains.
3778 ## <param name="domain">
3780 ## Domain allowed access.
3784 interface(`userdom_ptrace_all_users',`
3786 attribute userdomain;
3789 allow $1 userdomain:process ptrace;
3792 ########################################
3794 ## dontaudit Search /root
3796 ## <param name="domain">
3798 ## Domain to not audit.
3802 interface(`userdom_dontaudit_search_admin_dir',`
3807 dontaudit $1 admin_home_t:dir search_dir_perms;
3810 ########################################
3812 ## dontaudit list /root
3814 ## <param name="domain">
3816 ## Domain to not audit.
3820 interface(`userdom_dontaudit_list_admin_dir',`
3825 dontaudit $1 admin_home_t:dir list_dir_perms;
3828 ########################################
3830 ## Allow domain to list /root
3832 ## <param name="domain">
3834 ## Domain allowed access.
3838 interface(`userdom_list_admin_dir',`
3843 allow $1 admin_home_t:dir list_dir_perms;
3846 ########################################
3848 ## Allow Search /root
3850 ## <param name="domain">
3852 ## Domain allowed access.
3856 interface(`userdom_search_admin_dir',`
3861 allow $1 admin_home_t:dir search_dir_perms;
3864 ########################################
3866 ## RW unpriviledged user SysV sempaphores.
3868 ## <param name="domain">
3870 ## Domain allowed access.
3874 interface(`userdom_rw_semaphores',`
3876 attribute unpriv_userdomain;
3879 allow $1 unpriv_userdomain:sem rw_sem_perms;
3882 ########################################
3884 ## Send a message to unpriv users over a unix domain
3887 ## <param name="domain">
3889 ## Domain allowed access.
3893 interface(`userdom_dgram_send',`
3895 attribute unpriv_userdomain;
3898 allow $1 unpriv_userdomain:unix_dgram_socket sendto;
3901 ######################################
3903 ## Send a message to users over a unix domain
3906 ## <param name="domain">
3908 ## Domain allowed access.
3912 interface(`userdom_users_dgram_send',`
3914 attribute userdomain;
3917 allow $1 userdomain:unix_dgram_socket sendto;
3920 #######################################
3922 ## Allow execmod on files in homedirectory
3924 ## <param name="domain">
3926 ## Domain allowed access.
3931 interface(`userdom_execmod_user_home_files',`
3933 type user_home_type;
3936 allow $1 user_home_type:file execmod;
3939 ########################################
3941 ## Read admin home files.
3943 ## <param name="domain">
3945 ## Domain allowed access.
3950 interface(`userdom_read_admin_home_files',`
3955 read_files_pattern($1, admin_home_t, admin_home_t)
3958 ########################################
3960 ## Execute admin home files.
3962 ## <param name="domain">
3964 ## Domain allowed access.
3969 interface(`userdom_exec_admin_home_files',`
3974 exec_files_pattern($1, admin_home_t, admin_home_t)
3977 ########################################
3979 ## Append files inherited
3980 ## in the /root directory.
3982 ## <param name="domain">
3984 ## Domain allowed access.
3988 interface(`userdom_inherit_append_admin_home_files',`
3993 allow $1 admin_home_t:file { getattr append };
3997 #######################################
3999 ## Manage all files/directories in the homedir
4001 ## <param name="userdomain">
4008 interface(`userdom_manage_user_home_content',`
4010 type user_home_dir_t, user_home_t;
4011 attribute user_home_type;
4015 manage_dirs_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
4016 manage_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
4017 manage_lnk_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
4018 manage_sock_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
4019 manage_fifo_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
4020 filetrans_pattern($1, user_home_dir_t, user_home_t, { dir file lnk_file sock_file fifo_file })
4025 ########################################
4027 ## Create objects in a user home directory
4028 ## with an automatic type transition to
4029 ## the user home file type.
4031 ## <param name="domain">
4033 ## Domain allowed access.
4036 ## <param name="object_class">
4038 ## The class of the object to be created.
4042 interface(`userdom_user_home_dir_filetrans_pattern',`
4044 type user_home_dir_t, user_home_t;
4047 type_transition $1 user_home_dir_t:$2 user_home_t;
4050 ########################################
4052 ## Create objects in the /root directory
4053 ## with an automatic type transition to
4054 ## a specified private type.
4056 ## <param name="domain">
4058 ## Domain allowed access.
4061 ## <param name="private_type">
4063 ## The type of the object to create.
4066 ## <param name="object_class">
4068 ## The class of the object to be created.
4072 interface(`userdom_admin_home_dir_filetrans',`
4077 filetrans_pattern($1, admin_home_t, $2, $3, $4)
4080 ########################################
4082 ## Send signull to unprivileged user domains.
4084 ## <param name="domain">
4086 ## Domain allowed access.
4090 interface(`userdom_signull_unpriv_users',`
4092 attribute unpriv_userdomain;
4095 allow $1 unpriv_userdomain:process signull;
4098 ########################################
4100 ## Write all users files in /tmp
4102 ## <param name="domain">
4104 ## Domain allowed access.
4108 interface(`userdom_write_user_tmp_dirs',`
4113 write_files_pattern($1, user_tmp_t, user_tmp_t)
4116 ########################################
4118 ## Manage keys for all user domains.
4120 ## <param name="domain">
4122 ## Domain allowed access.
4126 interface(`userdom_manage_all_users_keys',`
4128 attribute userdomain;
4131 allow $1 userdomain:key manage_key_perms;
4135 ########################################
4137 ## Do not audit attempts to read and write
4138 ## unserdomain stream.
4140 ## <param name="domain">
4142 ## Domain to not audit.
4146 interface(`userdom_dontaudit_rw_stream',`
4148 attribute userdomain;
4151 dontaudit $1 userdomain:unix_stream_socket rw_socket_perms;
4154 ########################################
4156 ## Do not audit attempts to read and write
4157 ## unserdomain datagram socket.
4159 ## <param name="domain">
4161 ## Domain to not audit.
4165 interface(`userdom_dontaudit_rw_dgram_socket',`
4167 attribute userdomain;
4170 dontaudit $1 userdomain:unix_dgram_socket { read write };
4173 ########################################
4176 ## in a user home subdirectory.
4178 ## <param name="domain">
4180 ## Domain allowed access.
4184 interface(`userdom_append_user_home_content_files',`
4186 type user_home_dir_t, user_home_t;
4189 append_files_pattern($1, user_home_t, user_home_t)
4190 allow $1 user_home_dir_t:dir search_dir_perms;
4191 files_search_home($1)
4194 ########################################
4196 ## Read files inherited
4197 ## in a user home subdirectory.
4199 ## <param name="domain">
4201 ## Domain allowed access.
4205 interface(`userdom_read_inherited_user_home_content_files',`
4207 attribute user_home_type;
4210 allow $1 user_home_type:file { getattr read };
4213 ########################################
4215 ## Append files inherited
4216 ## in a user home subdirectory.
4218 ## <param name="domain">
4220 ## Domain allowed access.
4224 interface(`userdom_inherit_append_user_home_content_files',`
4229 allow $1 user_home_t:file { getattr append };
4232 ########################################
4234 ## Append files inherited
4235 ## in a user tmp files.
4237 ## <param name="domain">
4239 ## Domain allowed access.
4243 interface(`userdom_inherit_append_user_tmp_files',`
4248 allow $1 user_tmp_t:file { getattr append };
4251 ######################################
4253 ## Read audio files in the users homedir.
4255 ## <param name="domain">
4257 ## Domain allowed access.
4262 interface(`userdom_read_home_audio_files',`
4267 userdom_search_user_home_dirs($1)
4268 allow $1 audio_home_t:dir list_dir_perms;
4269 read_files_pattern($1, audio_home_t, audio_home_t)
4270 read_lnk_files_pattern($1, audio_home_t, audio_home_t)
4273 ########################################
4275 ## Do not audit attempts to write all user home content files.
4277 ## <param name="domain">
4279 ## Domain to not audit.
4283 interface(`userdom_dontaudit_write_all_user_home_content_files',`
4285 attribute user_home_type;
4288 dontaudit $1 user_home_type:file write_file_perms;
4291 ########################################
4293 ## Do not audit attempts to write all user tmp content files.
4295 ## <param name="domain">
4297 ## Domain to not audit.
4301 interface(`userdom_dontaudit_write_all_user_tmp_content_files',`
4303 attribute user_tmp_type;
4306 dontaudit $1 user_tmp_type:file write_file_perms;
4309 ########################################
4311 ## Manage all user temporary content.
4313 ## <param name="domain">
4315 ## Domain allowed access.
4319 interface(`userdom_manage_all_user_tmp_content',`
4321 attribute user_tmp_type;
4324 manage_dirs_pattern($1, user_tmp_type, user_tmp_type)
4325 manage_files_pattern($1, user_tmp_type, user_tmp_type)
4326 manage_lnk_files_pattern($1, user_tmp_type, user_tmp_type)
4327 manage_sock_files_pattern($1, user_tmp_type, user_tmp_type)
4328 manage_fifo_files_pattern($1, user_tmp_type, user_tmp_type)
4329 files_search_tmp($1)
4332 ########################################
4334 ## List all user temporary content.
4336 ## <param name="domain">
4338 ## Domain allowed access.
4342 interface(`userdom_list_all_user_tmp_content',`
4344 attribute user_tmp_type;
4347 list_dirs_pattern($1, user_tmp_type, user_tmp_type)
4348 getattr_files_pattern($1, user_tmp_type, user_tmp_type)
4349 read_lnk_files_pattern($1, user_tmp_type, user_tmp_type)
4350 getattr_sock_files_pattern($1, user_tmp_type, user_tmp_type)
4351 getattr_fifo_files_pattern($1, user_tmp_type, user_tmp_type)
4352 files_search_var($1)
4353 files_search_tmp($1)
4356 ########################################
4358 ## Manage all user tmpfs content.
4360 ## <param name="domain">
4362 ## Domain allowed access.
4366 interface(`userdom_manage_all_user_tmpfs_content',`
4368 attribute user_tmpfs_type;
4371 manage_dirs_pattern($1, user_tmpfs_type, user_tmpfs_type)
4372 manage_files_pattern($1, user_tmpfs_type, user_tmpfs_type)
4373 manage_lnk_files_pattern($1, user_tmpfs_type, user_tmpfs_type)
4374 manage_sock_files_pattern($1, user_tmpfs_type, user_tmpfs_type)
4375 manage_fifo_files_pattern($1, user_tmpfs_type, user_tmpfs_type)
4379 ########################################
4381 ## Delete all user temporary content.
4383 ## <param name="domain">
4385 ## Domain allowed access.
4389 interface(`userdom_delete_all_user_tmp_content',`
4391 attribute user_tmp_type;
4394 delete_dirs_pattern($1, user_tmp_type, user_tmp_type)
4395 delete_files_pattern($1, user_tmp_type, user_tmp_type)
4396 delete_lnk_files_pattern($1, user_tmp_type, user_tmp_type)
4397 delete_sock_files_pattern($1, user_tmp_type, user_tmp_type)
4398 delete_fifo_files_pattern($1, user_tmp_type, user_tmp_type)
4400 files_search_var($1)
4401 files_delete_tmp_dir_entry($1)
4404 ########################################
4406 ## Read system SSL certificates in the users homedir.
4408 ## <param name="domain">
4410 ## Domain allowed access.
4414 interface(`userdom_read_home_certs',`
4419 userdom_search_user_home_content($1)
4420 allow $1 home_cert_t:dir list_dir_perms;
4421 read_files_pattern($1, home_cert_t, home_cert_t)
4422 read_lnk_files_pattern($1, home_cert_t, home_cert_t)
4425 #######################################
4427 ## Dontaudit Write system SSL certificates in the users homedir.
4429 ## <param name="domain">
4431 ## Domain to not audit.
4435 interface(`userdom_dontaudit_write_home_certs',`
4440 dontaudit $1 home_cert_t:file write;
4443 ########################################
4445 ## dontaudit Search getatrr /root files
4447 ## <param name="domain">
4449 ## Domain to not audit.
4453 interface(`userdom_dontaudit_getattr_admin_home_files',`
4458 dontaudit $1 admin_home_t:file getattr;
4461 ########################################
4463 ## dontaudit read /root lnk files
4465 ## <param name="domain">
4467 ## Domain to not audit.
4471 interface(`userdom_dontaudit_read_admin_home_lnk_files',`
4476 dontaudit $1 admin_home_t:lnk_file read;
4479 ########################################
4481 ## dontaudit read /root files
4483 ## <param name="domain">
4485 ## Domain to not audit.
4489 interface(`userdom_dontaudit_read_admin_home_files',`
4494 dontaudit $1 admin_home_t:file read_file_perms;
4497 ########################################
4499 ## Create, read, write, and delete user
4500 ## temporary chr files.
4502 ## <param name="domain">
4504 ## Domain allowed access.
4508 interface(`userdom_manage_user_tmp_chr_files',`
4513 manage_chr_files_pattern($1, user_tmp_t, user_tmp_t)
4514 files_search_tmp($1)
4517 ########################################
4519 ## Create, read, write, and delete user
4520 ## temporary blk files.
4522 ## <param name="domain">
4524 ## Domain allowed access.
4528 interface(`userdom_manage_user_tmp_blk_files',`
4533 manage_blk_files_pattern($1, user_tmp_t, user_tmp_t)
4534 files_search_tmp($1)
4537 ########################################
4539 ## Dontaudit attempt to set attributes on user temporary directories.
4541 ## <param name="domain">
4543 ## Domain to not audit.
4547 interface(`userdom_dontaudit_setattr_user_tmp',`
4552 dontaudit $1 user_tmp_t:dir setattr;
4555 ########################################
4557 ## Write all inherited users files in /tmp
4559 ## <param name="domain">
4561 ## Domain allowed access.
4565 interface(`userdom_write_inherited_user_tmp_files',`
4570 allow $1 user_tmp_t:file write;
4573 ########################################
4575 ## Delete all users files in /tmp
4577 ## <param name="domain">
4579 ## Domain allowed access.
4583 interface(`userdom_delete_user_tmp_files',`
4588 allow $1 user_tmp_t:file delete_file_perms;
4591 ########################################
4593 ## Delete user tmpfs files.
4595 ## <param name="domain">
4597 ## Domain allowed access.
4601 interface(`userdom_delete_user_tmpfs_files',`
4606 allow $1 user_tmpfs_t:file delete_file_perms;
4609 ########################################
4611 ## Read/Write unpriviledged user SysV shared
4614 ## <param name="domain">
4616 ## Domain allowed access.
4620 interface(`userdom_rw_unpriv_user_shared_mem',`
4622 attribute unpriv_userdomain;
4625 allow $1 unpriv_userdomain:shm rw_shm_perms;
4628 ########################################
4630 ## Do not audit attempts to search user
4631 ## temporary directories.
4633 ## <param name="domain">
4635 ## Domain to not audit.
4639 interface(`userdom_dontaudit_search_user_tmp',`
4644 dontaudit $1 user_tmp_t:dir search_dir_perms;
4647 ########################################
4649 ## Execute a file in a user home directory
4650 ## in the specified domain.
4654 ## Execute a file in a user home directory
4655 ## in the specified domain.
4658 ## No interprocess communication (signals, pipes,
4659 ## etc.) is provided by this interface since
4660 ## the domains are not owned by this module.
4663 ## <param name="domain">
4665 ## Domain allowed access.
4668 ## <param name="target_domain">
4670 ## The type of the new process.
4674 interface(`userdom_domtrans_user_home',`
4679 read_lnk_files_pattern($1, user_home_t, user_home_t)
4680 domain_transition_pattern($1, user_home_t, $2)
4681 type_transition $1 user_home_t:process $2;
4684 ########################################
4686 ## Execute a file in a user tmp directory
4687 ## in the specified domain.
4691 ## Execute a file in a user tmp directory
4692 ## in the specified domain.
4695 ## No interprocess communication (signals, pipes,
4696 ## etc.) is provided by this interface since
4697 ## the domains are not owned by this module.
4700 ## <param name="domain">
4702 ## Domain allowed access.
4705 ## <param name="target_domain">
4707 ## The type of the new process.
4711 interface(`userdom_domtrans_user_tmp',`
4716 files_search_tmp($1)
4717 read_lnk_files_pattern($1, user_tmp_t, user_tmp_t)
4718 domain_transition_pattern($1, user_tmp_t, $2)
4719 type_transition $1 user_tmp_t:process $2;
4722 ########################################
4724 ## Do not audit attempts to read all user home content files.
4726 ## <param name="domain">
4728 ## Domain to not audit.
4732 interface(`userdom_dontaudit_read_all_user_home_content_files',`
4734 attribute user_home_type;
4737 dontaudit $1 user_home_type:file read_file_perms;
4740 ########################################
4742 ## Do not audit attempts to read all user tmp content files.
4744 ## <param name="domain">
4746 ## Domain to not audit.
4750 interface(`userdom_dontaudit_read_all_user_tmp_content_files',`
4752 attribute user_tmp_type;
4755 dontaudit $1 user_tmp_type:file read_file_perms;