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)
1141 pulseaudio_filetrans_admin_home_content($1_usertype)
1142 pulseaudio_filetrans_home_content($1_usertype)
1146 rtkit_scheduled($1_usertype)
1150 setroubleshoot_dontaudit_stream_connect($1_t)
1154 udev_read_db($1_usertype)
1158 wm_role_template($1, $1_r, $1_t)
1162 #######################################
1164 ## The template for creating a unprivileged user roughly
1165 ## equivalent to a regular linux user.
1169 ## The template for creating a unprivileged user roughly
1170 ## equivalent to a regular linux user.
1173 ## This template creates a user domain, types, and
1174 ## rules for the user's tty, pty, home directories,
1175 ## tmp, and tmpfs files.
1178 ## <param name="userdomain_prefix">
1180 ## The prefix of the user domain (e.g., user
1181 ## is the prefix for user_t).
1185 template(`userdom_unpriv_user_template', `
1187 ##############################
1192 # Inherit rules for ordinary users.
1193 userdom_restricted_xwindows_user_template($1)
1194 userdom_common_user_template($1)
1196 ##############################
1201 # port access is audited even if dac would not have allowed it, so dontaudit it here
1202 # corenet_dontaudit_tcp_bind_all_reserved_ports($1_t)
1203 # Need the following rule to allow users to run vpnc
1204 corenet_tcp_bind_xserver_port($1_t)
1205 corenet_tcp_bind_generic_node($1_usertype)
1207 storage_rw_fuse($1_t)
1209 miscfiles_read_hwdata($1_usertype)
1211 # Allow users to run TCP servers (bind to ports and accept connection from
1212 # the same domain and outside users) disabling this forces FTP passive mode
1213 # and may change other protocols
1215 tunable_policy(`user_share_music',`
1216 corenet_tcp_bind_daap_port($1_usertype)
1219 tunable_policy(`user_tcp_server',`
1220 corenet_tcp_bind_all_unreserved_ports($1_usertype)
1223 tunable_policy(`user_setrlimit',`
1224 allow $1_usertype self:process setrlimit;
1228 cdrecord_role($1_r, $1_t)
1232 cron_role($1_r, $1_t)
1236 games_rw_data($1_usertype)
1240 gpg_role($1_r, $1_usertype)
1244 gnomeclock_dbus_chat($1_t)
1248 gpm_stream_connect($1_usertype)
1252 execmem_role_template($1, $1_r, $1_t)
1256 java_role_template($1, $1_r, $1_t)
1260 mono_role_template($1, $1_r, $1_t)
1264 mount_run_fusermount($1_t, $1_r)
1265 mount_read_pid_files($1_t)
1269 wine_role_template($1, $1_r, $1_t)
1273 postfix_run_postdrop($1_t, $1_r)
1276 # Run pppd in pppd_t by default for user
1278 ppp_run_cond($1_t, $1_r)
1282 #######################################
1284 ## The template for creating an administrative user.
1288 ## This template creates a user domain, types, and
1289 ## rules for the user's tty, pty, home directories,
1290 ## tmp, and tmpfs files.
1293 ## The privileges given to administrative users are:
1295 ## <li>Raw disk access</li>
1296 ## <li>Set all sysctls</li>
1297 ## <li>All kernel ring buffer controls</li>
1298 ## <li>Create, read, write, and delete all files but shadow</li>
1299 ## <li>Manage source and binary format SELinux policy</li>
1300 ## <li>Run insmod</li>
1304 ## <param name="userdomain_prefix">
1306 ## The prefix of the user domain (e.g., sysadm
1307 ## is the prefix for sysadm_t).
1311 template(`userdom_admin_user_template',`
1313 attribute admindomain;
1314 class passwd { passwd chfn chsh rootok crontab };
1317 ##############################
1322 # Inherit rules for ordinary users.
1323 userdom_login_user_template($1)
1324 userdom_common_user_template($1)
1326 domain_obj_id_change_exemption($1_t)
1327 role system_r types $1_t;
1329 typeattribute $1_t admindomain;
1331 ifdef(`direct_sysadm_daemon',`
1332 domain_system_change_exemption($1_t)
1335 ##############################
1340 allow $1_t self:capability ~{ sys_module audit_control audit_write };
1341 allow $1_t self:capability2 syslog;
1342 allow $1_t self:process { setexec setfscreate };
1343 allow $1_t self:netlink_audit_socket nlmsg_readpriv;
1344 allow $1_t self:tun_socket create;
1345 # Set password information for other users.
1346 allow $1_t self:passwd { passwd chfn chsh };
1347 # Skip authentication when pam_rootok is specified.
1348 allow $1_t self:passwd rootok;
1350 # Manipulate other users crontab.
1351 allow $1_t self:passwd crontab;
1353 kernel_read_software_raid_state($1_t)
1354 kernel_getattr_core_if($1_t)
1355 kernel_getattr_message_if($1_t)
1356 kernel_change_ring_buffer_level($1_t)
1357 kernel_clear_ring_buffer($1_t)
1358 kernel_read_ring_buffer($1_t)
1359 kernel_get_sysvipc_info($1_t)
1360 kernel_rw_all_sysctls($1_t)
1361 # signal unlabeled processes:
1362 kernel_kill_unlabeled($1_t)
1363 kernel_signal_unlabeled($1_t)
1364 kernel_sigstop_unlabeled($1_t)
1365 kernel_signull_unlabeled($1_t)
1366 kernel_sigchld_unlabeled($1_t)
1369 corenet_tcp_bind_generic_port($1_t)
1370 # allow setting up tunnels
1371 corenet_rw_tun_tap_dev($1_t)
1373 dev_getattr_generic_blk_files($1_t)
1374 dev_getattr_generic_chr_files($1_t)
1376 dev_getattr_mtrr_dev($1_t)
1377 # Allow MAKEDEV to work
1378 dev_create_all_blk_files($1_t)
1379 dev_create_all_chr_files($1_t)
1380 dev_delete_all_blk_files($1_t)
1381 dev_delete_all_chr_files($1_t)
1382 dev_rename_all_blk_files($1_t)
1383 dev_rename_all_chr_files($1_t)
1384 dev_create_generic_symlinks($1_t)
1385 dev_rw_generic_usb_dev($1_t)
1388 domain_setpriority_all_domains($1_t)
1389 domain_read_all_domains_state($1_t)
1390 domain_getattr_all_domains($1_t)
1391 domain_getcap_all_domains($1_t)
1392 domain_dontaudit_ptrace_all_domains($1_t)
1393 # signal all domains:
1394 domain_kill_all_domains($1_t)
1395 domain_signal_all_domains($1_t)
1396 domain_signull_all_domains($1_t)
1397 domain_sigstop_all_domains($1_t)
1398 domain_sigstop_all_domains($1_t)
1399 domain_sigchld_all_domains($1_t)
1401 domain_getattr_all_sockets($1_t)
1402 domain_dontaudit_getattr_all_sockets($1_t)
1404 files_exec_usr_src_files($1_t)
1406 fs_getattr_all_fs($1_t)
1407 fs_getattr_all_files($1_t)
1409 fs_set_all_quotas($1_t)
1410 fs_exec_noxattr($1_t)
1412 storage_raw_read_removable_device($1_t)
1413 storage_raw_write_removable_device($1_t)
1414 storage_dontaudit_read_fixed_disk($1_t)
1416 term_use_all_inherited_terms($1_t)
1417 term_use_unallocated_ttys($1_t)
1419 auth_getattr_shadow($1_t)
1420 # Manage almost all files
1421 auth_manage_all_files_except_shadow($1_t)
1422 # Relabel almost all files
1423 auth_relabel_all_files_except_shadow($1_t)
1427 logging_send_syslog_msg($1_t)
1430 modutils_domtrans_insmod($1_t)
1431 modutils_domtrans_depmod($1_t)
1434 # The following rule is temporary until such time that a complete
1435 # policy management infrastructure is in place so that an administrator
1436 # cannot directly manipulate policy files with arbitrary programs.
1437 seutil_manage_src_policy($1_t)
1438 # Violates the goal of limiting write access to checkpolicy.
1439 # But presently necessary for installing the file_contexts file.
1440 seutil_manage_bin_policy($1_t)
1442 userdom_manage_user_home_content_dirs($1_t)
1443 userdom_manage_user_home_content_files($1_t)
1444 userdom_manage_user_home_content_symlinks($1_t)
1445 userdom_manage_user_home_content_pipes($1_t)
1446 userdom_manage_user_home_content_sockets($1_t)
1447 userdom_user_home_dir_filetrans_user_home_content($1_t, { dir file lnk_file fifo_file sock_file })
1449 tunable_policy(`user_rw_noexattrfile',`
1450 fs_manage_noxattr_fs_files($1_t)
1451 fs_manage_noxattr_fs_dirs($1_t)
1453 fs_read_noxattr_fs_files($1_t)
1457 postgresql_unconfined($1_t)
1461 userhelper_exec($1_t)
1465 ########################################
1467 ## Allow user to run as a secadm
1471 ## Create objects in a user home directory
1472 ## with an automatic type transition to
1473 ## a specified private type.
1476 ## This is a templated interface, and should only
1477 ## be called from a per-userdomain template.
1480 ## <param name="domain">
1482 ## Domain allowed access.
1485 ## <param name="role">
1487 ## The role of the object to create.
1491 template(`userdom_security_admin_template',`
1492 allow $1 self:capability { dac_read_search dac_override };
1494 corecmd_exec_shell($1)
1496 domain_obj_id_change_exemption($1)
1498 dev_relabel_all_dev_nodes($1)
1500 files_create_boot_flag($1)
1501 files_create_default_dir($1)
1502 files_root_filetrans_default($1, dir)
1504 # Necessary for managing /boot/efi
1505 fs_manage_dos_files($1)
1507 mls_process_read_up($1)
1508 mls_file_read_all_levels($1)
1509 mls_file_upgrade($1)
1510 mls_file_downgrade($1)
1512 selinux_set_enforce_mode($1)
1513 selinux_set_all_booleans($1)
1514 selinux_set_parameters($1)
1515 selinux_read_policy($1)
1517 auth_relabel_all_files_except_shadow($1)
1518 auth_relabel_shadow($1)
1522 logging_send_syslog_msg($1)
1523 logging_read_audit_log($1)
1524 logging_read_generic_logs($1)
1525 logging_read_audit_config($1)
1527 seutil_manage_bin_policy($1)
1528 seutil_manage_default_contexts($1)
1529 seutil_manage_file_contexts($1)
1530 seutil_manage_module_store($1)
1531 seutil_manage_config($1)
1532 seutil_run_checkpolicy($1,$2)
1533 seutil_run_loadpolicy($1,$2)
1534 seutil_run_semanage($1,$2)
1535 seutil_run_setsebool($1,$2)
1536 seutil_run_setfiles($1, $2)
1538 seutil_manage_bin_policy($1)
1539 seutil_manage_default_contexts($1)
1540 seutil_manage_file_contexts($1)
1541 seutil_manage_module_store($1)
1542 seutil_manage_config($1)
1549 consoletype_exec($1)
1557 ipsec_run_setkey($1,$2)
1561 netlabel_run_mgmt($1,$2)
1569 ########################################
1571 ## Make the specified type usable in a
1572 ## user home directory.
1574 ## <param name="type">
1576 ## Type to be used as a file in the
1577 ## user home directory.
1581 interface(`userdom_user_home_content',`
1584 attribute user_home_type;
1587 allow $1 user_home_t:filesystem associate;
1589 ubac_constrained($1)
1591 files_poly_member($1)
1592 typeattribute $1 user_home_type;
1595 ########################################
1597 ## Make the specified type usable in a
1598 ## generic temporary directory.
1600 ## <param name="type">
1602 ## Type to be used as a file in the
1603 ## generic temporary directory.
1607 interface(`userdom_user_tmp_content',`
1609 attribute user_tmp_type;
1612 typeattribute $1 user_tmp_type;
1615 ubac_constrained($1)
1618 ########################################
1620 ## Make the specified type usable in a
1621 ## generic tmpfs_t directory.
1623 ## <param name="type">
1625 ## Type to be used as a file in the
1626 ## generic temporary directory.
1630 interface(`userdom_user_tmpfs_content',`
1632 attribute user_tmpfs_type;
1635 typeattribute $1 user_tmpfs_type;
1637 files_tmpfs_file($1)
1638 ubac_constrained($1)
1641 ########################################
1643 ## Allow domain to attach to TUN devices created by administrative users.
1645 ## <param name="domain">
1647 ## Domain allowed access.
1651 interface(`userdom_attach_admin_tun_iface',`
1653 attribute admindomain;
1656 allow $1 admindomain:tun_socket relabelfrom;
1657 allow $1 self:tun_socket relabelto;
1660 ########################################
1662 ## Set the attributes of a user pty.
1664 ## <param name="domain">
1666 ## Domain allowed access.
1670 interface(`userdom_setattr_user_ptys',`
1675 allow $1 user_devpts_t:chr_file setattr_chr_file_perms;
1678 ########################################
1680 ## Create a user pty.
1682 ## <param name="domain">
1684 ## Domain allowed access.
1688 interface(`userdom_create_user_pty',`
1693 term_create_pty($1, user_devpts_t)
1696 ########################################
1698 ## Get the attributes of user home directories.
1700 ## <param name="domain">
1702 ## Domain allowed access.
1706 interface(`userdom_getattr_user_home_dirs',`
1708 type user_home_dir_t;
1711 allow $1 user_home_dir_t:dir getattr_dir_perms;
1712 files_search_home($1)
1715 ########################################
1717 ## Do not audit attempts to get the attributes of user home directories.
1719 ## <param name="domain">
1721 ## Domain to not audit.
1725 interface(`userdom_dontaudit_getattr_user_home_dirs',`
1727 type user_home_dir_t;
1730 dontaudit $1 user_home_dir_t:dir getattr_dir_perms;
1733 ########################################
1735 ## Search user home directories.
1737 ## <param name="domain">
1739 ## Domain allowed access.
1743 interface(`userdom_search_user_home_dirs',`
1745 type user_home_dir_t;
1748 allow $1 user_home_dir_t:dir search_dir_perms;
1749 allow $1 user_home_dir_t:lnk_file read_lnk_file_perms;
1750 files_search_home($1)
1753 ########################################
1755 ## Do not audit attempts to search user home directories.
1759 ## Do not audit attempts to search user home directories.
1760 ## This will supress SELinux denial messages when the specified
1761 ## domain is denied the permission to search these directories.
1764 ## <param name="domain">
1766 ## Domain to not audit.
1769 ## <infoflow type="none"/>
1771 interface(`userdom_dontaudit_search_user_home_dirs',`
1773 type user_home_dir_t;
1776 dontaudit $1 user_home_dir_t:dir search_dir_perms;
1779 ########################################
1781 ## List user home directories.
1783 ## <param name="domain">
1785 ## Domain allowed access.
1789 interface(`userdom_list_user_home_dirs',`
1791 type user_home_dir_t;
1794 allow $1 user_home_dir_t:dir list_dir_perms;
1795 files_search_home($1)
1797 tunable_policy(`use_nfs_home_dirs',`
1801 tunable_policy(`use_samba_home_dirs',`
1806 ########################################
1808 ## Do not audit attempts to list user home subdirectories.
1810 ## <param name="domain">
1812 ## Domain to not audit.
1816 interface(`userdom_dontaudit_list_user_home_dirs',`
1818 type user_home_dir_t;
1822 dontaudit $1 user_home_dir_t:dir list_dir_perms;
1823 dontaudit $1 user_home_t:dir list_dir_perms;
1826 ########################################
1828 ## Create user home directories.
1830 ## <param name="domain">
1832 ## Domain allowed access.
1836 interface(`userdom_create_user_home_dirs',`
1838 type user_home_dir_t;
1841 allow $1 user_home_dir_t:dir create_dir_perms;
1844 ########################################
1846 ## Create user home directories.
1848 ## <param name="domain">
1850 ## Domain allowed access.
1854 interface(`userdom_manage_user_home_dirs',`
1856 type user_home_dir_t;
1859 allow $1 user_home_dir_t:dir manage_dir_perms;
1862 ########################################
1864 ## Relabel to user home directories.
1866 ## <param name="domain">
1868 ## Domain allowed access.
1872 interface(`userdom_relabelto_user_home_dirs',`
1874 type user_home_dir_t;
1877 allow $1 user_home_dir_t:dir relabelto;
1881 ########################################
1883 ## Relabel to user home files.
1885 ## <param name="domain">
1887 ## Domain allowed access.
1891 interface(`userdom_relabelto_user_home_files',`
1896 allow $1 user_home_t:file relabelto;
1898 ########################################
1900 ## Relabel user home files.
1902 ## <param name="domain">
1904 ## Domain allowed access.
1908 interface(`userdom_relabel_user_home_files',`
1913 allow $1 user_home_t:file relabel_file_perms;
1916 ########################################
1918 ## Create directories in the home dir root with
1919 ## the user home directory type.
1921 ## <param name="domain">
1923 ## Domain allowed access.
1927 interface(`userdom_home_filetrans_user_home_dir',`
1929 type user_home_dir_t;
1932 files_home_filetrans($1, user_home_dir_t, dir)
1935 ########################################
1937 ## Do a domain transition to the specified
1938 ## domain when executing a program in the
1939 ## user home directory.
1943 ## Do a domain transition to the specified
1944 ## domain when executing a program in the
1945 ## user home directory.
1948 ## No interprocess communication (signals, pipes,
1949 ## etc.) is provided by this interface since
1950 ## the domains are not owned by this module.
1953 ## <param name="source_domain">
1955 ## Domain allowed to transition.
1958 ## <param name="target_domain">
1960 ## Domain to transition to.
1964 interface(`userdom_user_home_domtrans',`
1966 type user_home_dir_t, user_home_t;
1969 domain_auto_trans($1, user_home_t, $2)
1970 allow $1 user_home_dir_t:dir search_dir_perms;
1971 files_search_home($1)
1974 ########################################
1976 ## Do not audit attempts to search user home content directories.
1978 ## <param name="domain">
1980 ## Domain to not audit.
1984 interface(`userdom_dontaudit_search_user_home_content',`
1989 dontaudit $1 user_home_t:dir search_dir_perms;
1990 fs_dontaudit_list_nfs($1)
1991 fs_dontaudit_list_cifs($1)
1994 ########################################
1996 ## List contents of users home directory.
1998 ## <param name="domain">
2000 ## Domain allowed access.
2004 interface(`userdom_list_user_home_content',`
2006 type user_home_dir_t;
2007 attribute user_home_type;
2011 allow $1 { user_home_dir_t user_home_type }:dir list_dir_perms;
2014 ########################################
2016 ## Create, read, write, and delete directories
2017 ## in a user home subdirectory.
2019 ## <param name="domain">
2021 ## Domain allowed access.
2025 interface(`userdom_manage_user_home_content_dirs',`
2027 type user_home_dir_t, user_home_t;
2030 manage_dirs_pattern($1, { user_home_dir_t user_home_t }, user_home_t)
2031 files_search_home($1)
2034 ########################################
2036 ## Delete directories in a user home subdirectory.
2038 ## <param name="domain">
2040 ## Domain allowed access.
2044 interface(`userdom_delete_user_home_content_dirs',`
2049 allow $1 user_home_t:dir delete_dir_perms;
2052 ########################################
2054 ## Set the attributes of user home files.
2056 ## <param name="domain">
2058 ## Domain allowed access.
2063 interface(`userdom_setattr_user_home_content_files',`
2068 allow $1 user_home_t:file setattr;
2071 ########################################
2073 ## Do not audit attempts to set the
2074 ## attributes of user home files.
2076 ## <param name="domain">
2078 ## Domain to not audit.
2082 interface(`userdom_dontaudit_setattr_user_home_content_files',`
2087 dontaudit $1 user_home_t:file setattr_file_perms;
2090 ########################################
2092 ## Mmap user home files.
2094 ## <param name="domain">
2096 ## Domain allowed access.
2100 interface(`userdom_mmap_user_home_content_files',`
2102 type user_home_dir_t, user_home_t;
2105 mmap_files_pattern($1, { user_home_dir_t user_home_t }, user_home_t)
2106 files_search_home($1)
2109 ########################################
2111 ## Read user home files.
2113 ## <param name="domain">
2115 ## Domain allowed access.
2119 interface(`userdom_read_user_home_content_files',`
2121 type user_home_dir_t, user_home_t;
2124 list_dirs_pattern($1, { user_home_dir_t user_home_t }, { user_home_dir_t user_home_t })
2125 read_files_pattern($1, { user_home_dir_t user_home_t }, user_home_t)
2126 files_search_home($1)
2129 ########################################
2131 ## Do not audit attempts to getattr user home files.
2133 ## <param name="domain">
2135 ## Domain to not audit.
2139 interface(`userdom_dontaudit_getattr_user_home_content',`
2141 attribute user_home_type;
2144 dontaudit $1 user_home_type:dir getattr;
2145 dontaudit $1 user_home_type:file getattr;
2148 ########################################
2150 ## Do not audit attempts to read user home files.
2152 ## <param name="domain">
2154 ## Domain to not audit.
2158 interface(`userdom_dontaudit_read_user_home_content_files',`
2160 attribute user_home_type;
2161 type user_home_dir_t;
2164 dontaudit $1 user_home_dir_t:dir list_dir_perms;
2165 dontaudit $1 user_home_type:dir list_dir_perms;
2166 dontaudit $1 user_home_type:file read_file_perms;
2167 dontaudit $1 user_home_type:lnk_file read_lnk_file_perms;
2170 ########################################
2172 ## Do not audit attempts to append user home files.
2174 ## <param name="domain">
2176 ## Domain to not audit.
2180 interface(`userdom_dontaudit_append_user_home_content_files',`
2185 dontaudit $1 user_home_t:file append_file_perms;
2188 ########################################
2190 ## Do not audit attempts to write user home files.
2192 ## <param name="domain">
2194 ## Domain to not audit.
2198 interface(`userdom_dontaudit_write_user_home_content_files',`
2203 dontaudit $1 user_home_t:file write_file_perms;
2206 ########################################
2208 ## Delete files in a user home subdirectory.
2210 ## <param name="domain">
2212 ## Domain allowed access.
2216 interface(`userdom_delete_user_home_content_files',`
2221 allow $1 user_home_t:file delete_file_perms;
2224 ########################################
2226 ## Delete sock files in a user home subdirectory.
2228 ## <param name="domain">
2230 ## Domain allowed access.
2234 interface(`userdom_delete_user_home_content_sock_files',`
2239 allow $1 user_home_t:sock_file delete_file_perms;
2242 ########################################
2244 ## Do not audit attempts to write user home files.
2246 ## <param name="domain">
2248 ## Domain to not audit.
2252 interface(`userdom_dontaudit_relabel_user_home_content_files',`
2257 dontaudit $1 user_home_t:file relabel_file_perms;
2260 ########################################
2262 ## Read user home subdirectory symbolic links.
2264 ## <param name="domain">
2266 ## Domain allowed access.
2270 interface(`userdom_read_user_home_content_symlinks',`
2272 type user_home_dir_t, user_home_t;
2275 allow $1 { user_home_dir_t user_home_t }:lnk_file read_lnk_file_perms;
2278 ########################################
2280 ## Execute user home files.
2282 ## <param name="domain">
2284 ## Domain allowed access.
2289 interface(`userdom_exec_user_home_content_files',`
2291 type user_home_dir_t;
2292 attribute user_home_type;
2295 files_search_home($1)
2296 exec_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
2297 dontaudit $1 user_home_type:sock_file execute;
2300 ########################################
2302 ## Do not audit attempts to execute user home files.
2304 ## <param name="domain">
2306 ## Domain to not audit.
2310 interface(`userdom_dontaudit_exec_user_home_content_files',`
2315 dontaudit $1 user_home_t:file exec_file_perms;
2318 ########################################
2320 ## Create, read, write, and delete files
2321 ## in a user home subdirectory.
2323 ## <param name="domain">
2325 ## Domain allowed access.
2329 interface(`userdom_manage_user_home_content_files',`
2331 type user_home_dir_t, user_home_t;
2334 manage_files_pattern($1, user_home_t, user_home_t)
2335 allow $1 user_home_dir_t:dir search_dir_perms;
2336 files_search_home($1)
2339 ########################################
2341 ## Do not audit attempts to create, read, write, and delete directories
2342 ## in a user home subdirectory.
2344 ## <param name="domain">
2346 ## Domain to not audit.
2350 interface(`userdom_dontaudit_manage_user_home_content_dirs',`
2352 type user_home_dir_t, user_home_t;
2355 dontaudit $1 user_home_t:dir manage_dir_perms;
2358 ########################################
2360 ## Create, read, write, and delete symbolic links
2361 ## in a user home subdirectory.
2363 ## <param name="domain">
2365 ## Domain allowed access.
2369 interface(`userdom_manage_user_home_content_symlinks',`
2371 type user_home_dir_t, user_home_t;
2374 manage_lnk_files_pattern($1, user_home_t, user_home_t)
2375 allow $1 user_home_dir_t:dir search_dir_perms;
2376 files_search_home($1)
2379 ########################################
2381 ## Delete symbolic links in a user home directory.
2383 ## <param name="domain">
2385 ## Domain allowed access.
2389 interface(`userdom_delete_user_home_content_symlinks',`
2394 allow $1 user_home_t:lnk_file delete_lnk_file_perms;
2397 ########################################
2399 ## Create, read, write, and delete named pipes
2400 ## in a user home subdirectory.
2402 ## <param name="domain">
2404 ## Domain allowed access.
2408 interface(`userdom_manage_user_home_content_pipes',`
2410 type user_home_dir_t, user_home_t;
2413 manage_fifo_files_pattern($1, user_home_t, user_home_t)
2414 allow $1 user_home_dir_t:dir search_dir_perms;
2415 files_search_home($1)
2418 ########################################
2420 ## Create, read, write, and delete named sockets
2421 ## in a user home subdirectory.
2423 ## <param name="domain">
2425 ## Domain allowed access.
2429 interface(`userdom_manage_user_home_content_sockets',`
2431 type user_home_dir_t, user_home_t;
2434 allow $1 user_home_dir_t:dir search_dir_perms;
2435 manage_sock_files_pattern($1, user_home_t, user_home_t)
2436 files_search_home($1)
2439 ########################################
2441 ## Create objects in a user home directory
2442 ## with an automatic type transition to
2443 ## a specified private type.
2445 ## <param name="domain">
2447 ## Domain allowed access.
2450 ## <param name="private_type">
2452 ## The type of the object to create.
2455 ## <param name="object_class">
2457 ## The class of the object to be created.
2461 interface(`userdom_user_home_dir_filetrans',`
2463 type user_home_dir_t;
2466 filetrans_pattern($1, user_home_dir_t, $2, $3, $4)
2467 files_search_home($1)
2470 ########################################
2472 ## Create objects in a user home directory
2473 ## with an automatic type transition to
2474 ## a specified private type.
2476 ## <param name="domain">
2478 ## Domain allowed access.
2481 ## <param name="private_type">
2483 ## The type of the object to create.
2486 ## <param name="object_class">
2488 ## The class of the object to be created.
2492 interface(`userdom_user_home_content_filetrans',`
2494 type user_home_dir_t, user_home_t;
2497 filetrans_pattern($1, user_home_t, $2, $3)
2498 allow $1 user_home_dir_t:dir search_dir_perms;
2499 files_search_home($1)
2502 ########################################
2504 ## Create objects in a user home directory
2505 ## with an automatic type transition to
2506 ## the user home file type.
2508 ## <param name="domain">
2510 ## Domain allowed access.
2513 ## <param name="object_class">
2515 ## The class of the object to be created.
2519 interface(`userdom_user_home_dir_filetrans_user_home_content',`
2521 type user_home_dir_t, user_home_t;
2524 filetrans_pattern($1, user_home_dir_t, user_home_t, $2)
2525 files_search_home($1)
2528 ########################################
2530 ## Write to user temporary named sockets.
2532 ## <param name="domain">
2534 ## Domain allowed access.
2538 interface(`userdom_write_user_tmp_sockets',`
2543 allow $1 user_tmp_t:sock_file write_sock_file_perms;
2544 files_search_tmp($1)
2547 ########################################
2549 ## List user temporary directories.
2551 ## <param name="domain">
2553 ## Domain allowed access.
2557 interface(`userdom_list_user_tmp',`
2562 allow $1 user_tmp_t:dir list_dir_perms;
2563 files_search_tmp($1)
2566 ########################################
2568 ## Do not audit attempts to list user
2569 ## temporary directories.
2571 ## <param name="domain">
2573 ## Domain to not audit.
2577 interface(`userdom_dontaudit_list_user_tmp',`
2582 dontaudit $1 user_tmp_t:dir list_dir_perms;
2585 ########################################
2587 ## Do not audit attempts to manage users
2588 ## temporary directories.
2590 ## <param name="domain">
2592 ## Domain to not audit.
2596 interface(`userdom_dontaudit_manage_user_tmp_dirs',`
2601 dontaudit $1 user_tmp_t:dir manage_dir_perms;
2604 ########################################
2606 ## Read user temporary files.
2608 ## <param name="domain">
2610 ## Domain allowed access.
2614 interface(`userdom_read_user_tmp_files',`
2619 read_files_pattern($1, user_tmp_t, user_tmp_t)
2620 allow $1 user_tmp_t:dir list_dir_perms;
2621 files_search_tmp($1)
2624 ########################################
2626 ## Do not audit attempts to read users
2629 ## <param name="domain">
2631 ## Domain to not audit.
2635 interface(`userdom_dontaudit_read_user_tmp_files',`
2640 dontaudit $1 user_tmp_t:file read_inherited_file_perms;
2643 ########################################
2645 ## Do not audit attempts to append users
2648 ## <param name="domain">
2650 ## Domain to not audit.
2654 interface(`userdom_dontaudit_append_user_tmp_files',`
2659 dontaudit $1 user_tmp_t:file append_file_perms;
2662 ########################################
2664 ## Read and write user temporary files.
2666 ## <param name="domain">
2668 ## Domain allowed access.
2672 interface(`userdom_rw_user_tmp_files',`
2677 allow $1 user_tmp_t:dir list_dir_perms;
2678 rw_files_pattern($1, user_tmp_t, user_tmp_t)
2679 files_search_tmp($1)
2682 ########################################
2684 ## Do not audit attempts to manage users
2687 ## <param name="domain">
2689 ## Domain to not audit.
2693 interface(`userdom_dontaudit_manage_user_tmp_files',`
2698 dontaudit $1 user_tmp_t:file manage_file_perms;
2701 ########################################
2703 ## Read user temporary symbolic links.
2705 ## <param name="domain">
2707 ## Domain allowed access.
2711 interface(`userdom_read_user_tmp_symlinks',`
2716 read_lnk_files_pattern($1, user_tmp_t, user_tmp_t)
2717 allow $1 user_tmp_t:dir list_dir_perms;
2718 files_search_tmp($1)
2721 ########################################
2723 ## Create, read, write, and delete user
2724 ## temporary directories.
2726 ## <param name="domain">
2728 ## Domain allowed access.
2732 interface(`userdom_manage_user_tmp_dirs',`
2737 manage_dirs_pattern($1, user_tmp_t, user_tmp_t)
2738 files_search_tmp($1)
2741 ########################################
2743 ## Create, read, write, and delete user
2746 ## <param name="domain">
2748 ## Domain allowed access.
2752 interface(`userdom_manage_user_tmp_files',`
2757 manage_files_pattern($1, user_tmp_t, user_tmp_t)
2758 files_search_tmp($1)
2761 ########################################
2763 ## Create, read, write, and delete user
2764 ## temporary symbolic links.
2766 ## <param name="domain">
2768 ## Domain allowed access.
2772 interface(`userdom_manage_user_tmp_symlinks',`
2777 manage_lnk_files_pattern($1, user_tmp_t, user_tmp_t)
2778 files_search_tmp($1)
2781 ########################################
2783 ## Create, read, write, and delete user
2784 ## temporary named pipes.
2786 ## <param name="domain">
2788 ## Domain allowed access.
2792 interface(`userdom_manage_user_tmp_pipes',`
2797 manage_fifo_files_pattern($1, user_tmp_t, user_tmp_t)
2798 files_search_tmp($1)
2801 ########################################
2803 ## Create, read, write, and delete user
2804 ## temporary named sockets.
2806 ## <param name="domain">
2808 ## Domain allowed access.
2812 interface(`userdom_manage_user_tmp_sockets',`
2817 manage_sock_files_pattern($1, user_tmp_t, user_tmp_t)
2818 files_search_tmp($1)
2821 ########################################
2823 ## Create objects in a user temporary directory
2824 ## with an automatic type transition to
2825 ## a specified private type.
2827 ## <param name="domain">
2829 ## Domain allowed access.
2832 ## <param name="private_type">
2834 ## The type of the object to create.
2837 ## <param name="object_class">
2839 ## The class of the object to be created.
2843 interface(`userdom_user_tmp_filetrans',`
2848 filetrans_pattern($1, user_tmp_t, $2, $3)
2849 files_search_tmp($1)
2852 ########################################
2854 ## Create objects in the temporary directory
2855 ## with an automatic type transition to
2856 ## the user temporary type.
2858 ## <param name="domain">
2860 ## Domain allowed access.
2863 ## <param name="object_class">
2865 ## The class of the object to be created.
2869 interface(`userdom_tmp_filetrans_user_tmp',`
2874 files_tmp_filetrans($1, user_tmp_t, $2)
2877 ########################################
2879 ## Read user tmpfs files.
2881 ## <param name="domain">
2883 ## Domain allowed access.
2887 interface(`userdom_read_user_tmpfs_files',`
2892 read_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
2893 read_lnk_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
2894 allow $1 user_tmpfs_t:dir list_dir_perms;
2898 ########################################
2900 ## Read/Write user tmpfs files.
2902 ## <param name="domain">
2904 ## Domain allowed access.
2908 interface(`userdom_rw_user_tmpfs_files',`
2913 rw_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
2914 read_lnk_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
2915 allow $1 user_tmpfs_t:dir list_dir_perms;
2919 ########################################
2921 ## Get the attributes of a user domain tty.
2923 ## <param name="domain">
2925 ## Domain allowed access.
2929 interface(`userdom_getattr_user_ttys',`
2931 type user_tty_device_t;
2934 allow $1 user_tty_device_t:chr_file getattr_chr_file_perms;
2937 ########################################
2939 ## Do not audit attempts to get the attributes of a user domain tty.
2941 ## <param name="domain">
2943 ## Domain to not audit.
2947 interface(`userdom_dontaudit_getattr_user_ttys',`
2949 type user_tty_device_t;
2952 dontaudit $1 user_tty_device_t:chr_file getattr_chr_file_perms;
2955 ########################################
2957 ## Set the attributes of a user domain tty.
2959 ## <param name="domain">
2961 ## Domain allowed access.
2965 interface(`userdom_setattr_user_ttys',`
2967 type user_tty_device_t;
2970 allow $1 user_tty_device_t:chr_file setattr_chr_file_perms;
2973 ########################################
2975 ## Do not audit attempts to set the attributes of a user domain tty.
2977 ## <param name="domain">
2979 ## Domain to not audit.
2983 interface(`userdom_dontaudit_setattr_user_ttys',`
2985 type user_tty_device_t;
2988 dontaudit $1 user_tty_device_t:chr_file setattr_chr_file_perms;
2991 ########################################
2993 ## Read and write a user domain tty.
2995 ## <param name="domain">
2997 ## Domain allowed access.
3001 interface(`userdom_use_user_ttys',`
3003 type user_tty_device_t;
3006 allow $1 user_tty_device_t:chr_file rw_term_perms;
3009 ########################################
3011 ## Read and write a inherited user domain tty.
3013 ## <param name="domain">
3015 ## Domain allowed access.
3019 interface(`userdom_use_inherited_user_ttys',`
3021 type user_tty_device_t;
3024 allow $1 user_tty_device_t:chr_file rw_inherited_term_perms;
3027 ########################################
3029 ## Read and write a user domain pty.
3031 ## <param name="domain">
3033 ## Domain allowed access.
3037 interface(`userdom_use_user_ptys',`
3042 allow $1 user_devpts_t:chr_file rw_term_perms;
3045 ########################################
3047 ## Read and write a inherited user domain pty.
3049 ## <param name="domain">
3051 ## Domain allowed access.
3055 interface(`userdom_use_inherited_user_ptys',`
3060 allow $1 user_devpts_t:chr_file rw_inherited_term_perms;
3063 ########################################
3065 ## Read and write a inherited user TTYs and PTYs.
3069 ## Allow the specified domain to read and write inherited user
3070 ## TTYs and PTYs. This will allow the domain to
3071 ## interact with the user via the terminal. Typically
3072 ## all interactive applications will require this
3076 ## <param name="domain">
3078 ## Domain allowed access.
3081 ## <infoflow type="both" weight="10"/>
3083 interface(`userdom_use_inherited_user_terminals',`
3085 type user_tty_device_t, user_devpts_t;
3088 allow $1 user_tty_device_t:chr_file rw_inherited_term_perms;
3089 allow $1 user_devpts_t:chr_file rw_inherited_term_perms;
3092 #######################################
3094 ## Allow attempts to read and write
3095 ## a user domain tty and pty.
3097 ## <param name="domain">
3099 ## Domain to not audit.
3103 interface(`userdom_use_user_terminals',`
3105 type user_tty_device_t, user_devpts_t;
3108 allow $1 user_tty_device_t:chr_file rw_term_perms;
3109 allow $1 user_devpts_t:chr_file rw_term_perms;
3112 ########################################
3114 ## Do not audit attempts to read and write
3115 ## a user domain tty and pty.
3117 ## <param name="domain">
3119 ## Domain to not audit.
3123 interface(`userdom_dontaudit_use_user_terminals',`
3125 type user_tty_device_t, user_devpts_t;
3128 dontaudit $1 user_tty_device_t:chr_file rw_term_perms;
3129 dontaudit $1 user_devpts_t:chr_file rw_term_perms;
3133 ########################################
3135 ## Get attributes of user domain tty and pty.
3137 ## <param name="domain">
3139 ## Domain allowed access.
3143 interface(`userdom_getattr_user_terminals',`
3145 type user_tty_device_t, user_devpts_t;
3148 allow $1 { user_tty_device_t user_devpts_t }:chr_file getattr_chr_file_perms;
3151 ########################################
3153 ## Execute a shell in all user domains. This
3154 ## is an explicit transition, requiring the
3155 ## caller to use setexeccon().
3157 ## <param name="domain">
3159 ## Domain allowed to transition.
3163 interface(`userdom_spec_domtrans_all_users',`
3165 attribute userdomain;
3168 corecmd_shell_spec_domtrans($1, userdomain)
3169 allow userdomain $1:fd use;
3170 allow userdomain $1:fifo_file rw_file_perms;
3171 allow userdomain $1:process sigchld;
3174 ########################################
3176 ## Execute an Xserver session in all unprivileged user domains. This
3177 ## is an explicit transition, requiring the
3178 ## caller to use setexeccon().
3180 ## <param name="domain">
3182 ## Domain allowed to transition.
3186 interface(`userdom_xsession_spec_domtrans_all_users',`
3188 attribute userdomain;
3191 xserver_xsession_spec_domtrans($1, userdomain)
3192 allow userdomain $1:fd use;
3193 allow userdomain $1:fifo_file rw_file_perms;
3194 allow userdomain $1:process sigchld;
3197 ########################################
3199 ## Execute a shell in all unprivileged user domains. This
3200 ## is an explicit transition, requiring the
3201 ## caller to use setexeccon().
3203 ## <param name="domain">
3205 ## Domain allowed to transition.
3209 interface(`userdom_spec_domtrans_unpriv_users',`
3211 attribute unpriv_userdomain;
3214 corecmd_shell_spec_domtrans($1, unpriv_userdomain)
3215 allow unpriv_userdomain $1:fd use;
3216 allow unpriv_userdomain $1:fifo_file rw_file_perms;
3217 allow unpriv_userdomain $1:process sigchld;
3220 ########################################
3222 ## Execute an Xserver session in all unprivileged user domains. This
3223 ## is an explicit transition, requiring the
3224 ## caller to use setexeccon().
3226 ## <param name="domain">
3228 ## Domain allowed to transition.
3232 interface(`userdom_xsession_spec_domtrans_unpriv_users',`
3234 attribute unpriv_userdomain;
3237 xserver_xsession_spec_domtrans($1, unpriv_userdomain)
3238 allow unpriv_userdomain $1:fd use;
3239 allow unpriv_userdomain $1:fifo_file rw_file_perms;
3240 allow unpriv_userdomain $1:process sigchld;
3243 ########################################
3245 ## Manage unpriviledged user SysV sempaphores.
3247 ## <param name="domain">
3249 ## Domain allowed access.
3253 interface(`userdom_manage_unpriv_user_semaphores',`
3255 attribute unpriv_userdomain;
3258 allow $1 unpriv_userdomain:sem create_sem_perms;
3261 ########################################
3263 ## Manage unpriviledged user SysV shared
3266 ## <param name="domain">
3268 ## Domain allowed access.
3272 interface(`userdom_manage_unpriv_user_shared_mem',`
3274 attribute unpriv_userdomain;
3277 allow $1 unpriv_userdomain:shm create_shm_perms;
3280 ########################################
3282 ## Execute bin_t in the unprivileged user domains. This
3283 ## is an explicit transition, requiring the
3284 ## caller to use setexeccon().
3286 ## <param name="domain">
3288 ## Domain allowed to transition.
3292 interface(`userdom_bin_spec_domtrans_unpriv_users',`
3294 attribute unpriv_userdomain;
3297 corecmd_bin_spec_domtrans($1, unpriv_userdomain)
3298 allow unpriv_userdomain $1:fd use;
3299 allow unpriv_userdomain $1:fifo_file rw_file_perms;
3300 allow unpriv_userdomain $1:process sigchld;
3303 ########################################
3305 ## Execute all entrypoint files in unprivileged user
3306 ## domains. This is an explicit transition, requiring the
3307 ## caller to use setexeccon().
3309 ## <param name="domain">
3311 ## Domain allowed access.
3315 interface(`userdom_entry_spec_domtrans_unpriv_users',`
3317 attribute unpriv_userdomain;
3320 domain_entry_file_spec_domtrans($1, unpriv_userdomain)
3321 allow unpriv_userdomain $1:fd use;
3322 allow unpriv_userdomain $1:fifo_file rw_fifo_file_perms;
3323 allow unpriv_userdomain $1:process sigchld;
3326 ########################################
3328 ## Search users home directories.
3330 ## <param name="domain">
3332 ## Domain allowed access.
3336 interface(`userdom_search_user_home_content',`
3338 type user_home_dir_t;
3339 attribute user_home_type;
3343 allow $1 { user_home_dir_t user_home_type }:dir search_dir_perms;
3344 allow $1 { user_home_dir_t user_home_type }:lnk_file read_lnk_file_perms;
3347 ########################################
3349 ## Send general signals to unprivileged user domains.
3351 ## <param name="domain">
3353 ## Domain allowed access.
3357 interface(`userdom_signal_unpriv_users',`
3359 attribute unpriv_userdomain;
3362 allow $1 unpriv_userdomain:process signal;
3365 ########################################
3367 ## Inherit the file descriptors from unprivileged user domains.
3369 ## <param name="domain">
3371 ## Domain allowed access.
3375 interface(`userdom_use_unpriv_users_fds',`
3377 attribute unpriv_userdomain;
3380 allow $1 unpriv_userdomain:fd use;
3383 ########################################
3385 ## Do not audit attempts to inherit the file descriptors
3386 ## from unprivileged user domains.
3390 ## Do not audit attempts to inherit the file descriptors
3391 ## from unprivileged user domains. This will supress
3392 ## SELinux denial messages when the specified domain is denied
3393 ## the permission to inherit these file descriptors.
3396 ## <param name="domain">
3398 ## Domain to not audit.
3401 ## <infoflow type="none"/>
3403 interface(`userdom_dontaudit_use_unpriv_user_fds',`
3405 attribute unpriv_userdomain;
3408 dontaudit $1 unpriv_userdomain:fd use;
3411 ########################################
3413 ## Do not audit attempts to use user ptys.
3415 ## <param name="domain">
3417 ## Domain to not audit.
3421 interface(`userdom_dontaudit_use_user_ptys',`
3426 dontaudit $1 user_devpts_t:chr_file rw_inherited_file_perms;
3429 ########################################
3431 ## Relabel files to unprivileged user pty types.
3433 ## <param name="domain">
3435 ## Domain allowed access.
3439 interface(`userdom_relabelto_user_ptys',`
3444 allow $1 user_devpts_t:chr_file relabelto;
3447 ########################################
3449 ## Do not audit attempts to relabel files from
3452 ## <param name="domain">
3454 ## Domain to not audit.
3458 interface(`userdom_dontaudit_relabelfrom_user_ptys',`
3463 dontaudit $1 user_devpts_t:chr_file relabelfrom;
3466 ########################################
3468 ## Write all users files in /tmp
3470 ## <param name="domain">
3472 ## Domain allowed access.
3476 interface(`userdom_write_user_tmp_files',`
3481 write_files_pattern($1, user_tmp_t, user_tmp_t)
3484 ########################################
3486 ## Do not audit attempts to write users
3489 ## <param name="domain">
3491 ## Domain to not audit.
3495 interface(`userdom_dontaudit_write_user_tmp_files',`
3500 dontaudit $1 user_tmp_t:file write;
3503 ########################################
3505 ## Do not audit attempts to read/write users
3506 ## temporary fifo files.
3508 ## <param name="domain">
3510 ## Domain to not audit.
3514 interface(`userdom_dontaudit_rw_user_tmp_pipes',`
3519 dontaudit $1 user_tmp_t:fifo_file rw_inherited_fifo_file_perms;
3522 ########################################
3524 ## Do not audit attempts to use user ttys.
3526 ## <param name="domain">
3528 ## Domain to not audit.
3532 interface(`userdom_dontaudit_use_user_ttys',`
3534 type user_tty_device_t;
3537 dontaudit $1 user_tty_device_t:chr_file rw_file_perms;
3540 ########################################
3542 ## Read the process state of all user domains.
3544 ## <param name="domain">
3546 ## Domain allowed access.
3550 interface(`userdom_read_all_users_state',`
3552 attribute userdomain;
3555 read_files_pattern($1, userdomain, userdomain)
3556 read_lnk_files_pattern($1,userdomain,userdomain)
3557 kernel_search_proc($1)
3560 ########################################
3562 ## Get the attributes of all user domains.
3564 ## <param name="domain">
3566 ## Domain allowed access.
3570 interface(`userdom_getattr_all_users',`
3572 attribute userdomain;
3575 allow $1 userdomain:process getattr;
3578 ########################################
3580 ## Inherit the file descriptors from all user domains
3582 ## <param name="domain">
3584 ## Domain allowed access.
3588 interface(`userdom_use_all_users_fds',`
3590 attribute userdomain;
3593 allow $1 userdomain:fd use;
3596 ########################################
3598 ## Do not audit attempts to inherit the file
3599 ## descriptors from any user domains.
3601 ## <param name="domain">
3603 ## Domain to not audit.
3607 interface(`userdom_dontaudit_use_all_users_fds',`
3609 attribute userdomain;
3612 dontaudit $1 userdomain:fd use;
3615 ########################################
3617 ## Send general signals to all user domains.
3619 ## <param name="domain">
3621 ## Domain allowed access.
3625 interface(`userdom_signal_all_users',`
3627 attribute userdomain;
3630 allow $1 userdomain:process signal;
3633 ########################################
3635 ## Send kill signals to all user domains.
3637 ## <param name="domain">
3639 ## Domain allowed access.
3643 interface(`userdom_kill_all_users',`
3645 attribute userdomain;
3648 allow $1 userdomain:process sigkill;
3651 ########################################
3653 ## Send a SIGCHLD signal to all user domains.
3655 ## <param name="domain">
3657 ## Domain allowed access.
3661 interface(`userdom_sigchld_all_users',`
3663 attribute userdomain;
3666 allow $1 userdomain:process sigchld;
3669 ########################################
3671 ## Create keys for all user domains.
3673 ## <param name="domain">
3675 ## Domain allowed access.
3679 interface(`userdom_create_all_users_keys',`
3681 attribute userdomain;
3684 allow $1 userdomain:key create;
3687 ########################################
3689 ## Send a dbus message to all user domains.
3691 ## <param name="domain">
3693 ## Domain allowed access.
3697 interface(`userdom_dbus_send_all_users',`
3699 attribute userdomain;
3700 class dbus send_msg;
3703 allow $1 userdomain:dbus send_msg;
3706 ########################################
3708 ## Allow apps to set rlimits on userdomain
3710 ## <param name="domain">
3712 ## Domain allowed access.
3716 interface(`userdom_set_rlimitnh',`
3718 attribute userdomain;
3721 allow $1 userdomain:process rlimitinh;
3724 ########################################
3726 ## Define this type as a Allow apps to set rlimits on userdomain
3728 ## <param name="domain">
3730 ## Domain allowed access.
3733 ## <param name="userdomain_prefix">
3735 ## The prefix of the user domain (e.g., user
3736 ## is the prefix for user_t).
3739 ## <param name="domain">
3741 ## Domain allowed access.
3745 template(`userdom_unpriv_usertype',`
3747 attribute unpriv_userdomain, userdomain;
3748 attribute $1_usertype;
3750 typeattribute $2 $1_usertype;
3751 typeattribute $2 unpriv_userdomain;
3752 typeattribute $2 userdomain;
3754 ubac_constrained($2)
3757 ########################################
3759 ## Connect to users over an unix stream socket.
3761 ## <param name="domain">
3763 ## Domain allowed access.
3767 interface(`userdom_stream_connect',`
3770 attribute userdomain;
3773 stream_connect_pattern($1, user_tmp_t, user_tmp_t, userdomain)
3776 ########################################
3778 ## Ptrace user domains.
3780 ## <param name="domain">
3782 ## Domain allowed access.
3786 interface(`userdom_ptrace_all_users',`
3788 attribute userdomain;
3791 allow $1 userdomain:process ptrace;
3794 ########################################
3796 ## dontaudit Search /root
3798 ## <param name="domain">
3800 ## Domain to not audit.
3804 interface(`userdom_dontaudit_search_admin_dir',`
3809 dontaudit $1 admin_home_t:dir search_dir_perms;
3812 ########################################
3814 ## dontaudit list /root
3816 ## <param name="domain">
3818 ## Domain to not audit.
3822 interface(`userdom_dontaudit_list_admin_dir',`
3827 dontaudit $1 admin_home_t:dir list_dir_perms;
3830 ########################################
3832 ## Allow domain to list /root
3834 ## <param name="domain">
3836 ## Domain allowed access.
3840 interface(`userdom_list_admin_dir',`
3845 allow $1 admin_home_t:dir list_dir_perms;
3848 ########################################
3850 ## Allow Search /root
3852 ## <param name="domain">
3854 ## Domain allowed access.
3858 interface(`userdom_search_admin_dir',`
3863 allow $1 admin_home_t:dir search_dir_perms;
3866 ########################################
3868 ## RW unpriviledged user SysV sempaphores.
3870 ## <param name="domain">
3872 ## Domain allowed access.
3876 interface(`userdom_rw_semaphores',`
3878 attribute unpriv_userdomain;
3881 allow $1 unpriv_userdomain:sem rw_sem_perms;
3884 ########################################
3886 ## Send a message to unpriv users over a unix domain
3889 ## <param name="domain">
3891 ## Domain allowed access.
3895 interface(`userdom_dgram_send',`
3897 attribute unpriv_userdomain;
3900 allow $1 unpriv_userdomain:unix_dgram_socket sendto;
3903 ######################################
3905 ## Send a message to users over a unix domain
3908 ## <param name="domain">
3910 ## Domain allowed access.
3914 interface(`userdom_users_dgram_send',`
3916 attribute userdomain;
3919 allow $1 userdomain:unix_dgram_socket sendto;
3922 #######################################
3924 ## Allow execmod on files in homedirectory
3926 ## <param name="domain">
3928 ## Domain allowed access.
3933 interface(`userdom_execmod_user_home_files',`
3935 type user_home_type;
3938 allow $1 user_home_type:file execmod;
3941 ########################################
3943 ## Read admin home files.
3945 ## <param name="domain">
3947 ## Domain allowed access.
3952 interface(`userdom_read_admin_home_files',`
3957 read_files_pattern($1, admin_home_t, admin_home_t)
3960 ########################################
3962 ## Execute admin home files.
3964 ## <param name="domain">
3966 ## Domain allowed access.
3971 interface(`userdom_exec_admin_home_files',`
3976 exec_files_pattern($1, admin_home_t, admin_home_t)
3979 ########################################
3981 ## Append files inherited
3982 ## in the /root directory.
3984 ## <param name="domain">
3986 ## Domain allowed access.
3990 interface(`userdom_inherit_append_admin_home_files',`
3995 allow $1 admin_home_t:file { getattr append };
3999 #######################################
4001 ## Manage all files/directories in the homedir
4003 ## <param name="userdomain">
4010 interface(`userdom_manage_user_home_content',`
4012 type user_home_dir_t, user_home_t;
4013 attribute user_home_type;
4017 manage_dirs_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
4018 manage_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
4019 manage_lnk_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
4020 manage_sock_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
4021 manage_fifo_files_pattern($1, { user_home_dir_t user_home_type }, user_home_type)
4022 filetrans_pattern($1, user_home_dir_t, user_home_t, { dir file lnk_file sock_file fifo_file })
4027 ########################################
4029 ## Create objects in a user home directory
4030 ## with an automatic type transition to
4031 ## the user home file type.
4033 ## <param name="domain">
4035 ## Domain allowed access.
4038 ## <param name="object_class">
4040 ## The class of the object to be created.
4044 interface(`userdom_user_home_dir_filetrans_pattern',`
4046 type user_home_dir_t, user_home_t;
4049 type_transition $1 user_home_dir_t:$2 user_home_t;
4052 ########################################
4054 ## Create objects in the /root directory
4055 ## with an automatic type transition to
4056 ## a specified private type.
4058 ## <param name="domain">
4060 ## Domain allowed access.
4063 ## <param name="private_type">
4065 ## The type of the object to create.
4068 ## <param name="object_class">
4070 ## The class of the object to be created.
4074 interface(`userdom_admin_home_dir_filetrans',`
4079 filetrans_pattern($1, admin_home_t, $2, $3, $4)
4082 ########################################
4084 ## Send signull to unprivileged user domains.
4086 ## <param name="domain">
4088 ## Domain allowed access.
4092 interface(`userdom_signull_unpriv_users',`
4094 attribute unpriv_userdomain;
4097 allow $1 unpriv_userdomain:process signull;
4100 ########################################
4102 ## Write all users files in /tmp
4104 ## <param name="domain">
4106 ## Domain allowed access.
4110 interface(`userdom_write_user_tmp_dirs',`
4115 write_files_pattern($1, user_tmp_t, user_tmp_t)
4118 ########################################
4120 ## Manage keys for all user domains.
4122 ## <param name="domain">
4124 ## Domain allowed access.
4128 interface(`userdom_manage_all_users_keys',`
4130 attribute userdomain;
4133 allow $1 userdomain:key manage_key_perms;
4137 ########################################
4139 ## Do not audit attempts to read and write
4140 ## unserdomain stream.
4142 ## <param name="domain">
4144 ## Domain to not audit.
4148 interface(`userdom_dontaudit_rw_stream',`
4150 attribute userdomain;
4153 dontaudit $1 userdomain:unix_stream_socket rw_socket_perms;
4156 ########################################
4158 ## Do not audit attempts to read and write
4159 ## unserdomain datagram socket.
4161 ## <param name="domain">
4163 ## Domain to not audit.
4167 interface(`userdom_dontaudit_rw_dgram_socket',`
4169 attribute userdomain;
4172 dontaudit $1 userdomain:unix_dgram_socket { read write };
4175 ########################################
4178 ## in a user home subdirectory.
4180 ## <param name="domain">
4182 ## Domain allowed access.
4186 interface(`userdom_append_user_home_content_files',`
4188 type user_home_dir_t, user_home_t;
4191 append_files_pattern($1, user_home_t, user_home_t)
4192 allow $1 user_home_dir_t:dir search_dir_perms;
4193 files_search_home($1)
4196 ########################################
4198 ## Read files inherited
4199 ## in a user home subdirectory.
4201 ## <param name="domain">
4203 ## Domain allowed access.
4207 interface(`userdom_read_inherited_user_home_content_files',`
4209 attribute user_home_type;
4212 allow $1 user_home_type:file { getattr read };
4215 ########################################
4217 ## Append files inherited
4218 ## in a user home subdirectory.
4220 ## <param name="domain">
4222 ## Domain allowed access.
4226 interface(`userdom_inherit_append_user_home_content_files',`
4231 allow $1 user_home_t:file { getattr append };
4234 ########################################
4236 ## Append files inherited
4237 ## in a user tmp files.
4239 ## <param name="domain">
4241 ## Domain allowed access.
4245 interface(`userdom_inherit_append_user_tmp_files',`
4250 allow $1 user_tmp_t:file { getattr append };
4253 ######################################
4255 ## Read audio files in the users homedir.
4257 ## <param name="domain">
4259 ## Domain allowed access.
4264 interface(`userdom_read_home_audio_files',`
4269 userdom_search_user_home_dirs($1)
4270 allow $1 audio_home_t:dir list_dir_perms;
4271 read_files_pattern($1, audio_home_t, audio_home_t)
4272 read_lnk_files_pattern($1, audio_home_t, audio_home_t)
4275 ########################################
4277 ## Do not audit attempts to write all user home content files.
4279 ## <param name="domain">
4281 ## Domain to not audit.
4285 interface(`userdom_dontaudit_write_all_user_home_content_files',`
4287 attribute user_home_type;
4290 dontaudit $1 user_home_type:file write_file_perms;
4293 ########################################
4295 ## Do not audit attempts to write all user tmp content files.
4297 ## <param name="domain">
4299 ## Domain to not audit.
4303 interface(`userdom_dontaudit_write_all_user_tmp_content_files',`
4305 attribute user_tmp_type;
4308 dontaudit $1 user_tmp_type:file write_file_perms;
4311 ########################################
4313 ## Manage all user temporary content.
4315 ## <param name="domain">
4317 ## Domain allowed access.
4321 interface(`userdom_manage_all_user_tmp_content',`
4323 attribute user_tmp_type;
4326 manage_dirs_pattern($1, user_tmp_type, user_tmp_type)
4327 manage_files_pattern($1, user_tmp_type, user_tmp_type)
4328 manage_lnk_files_pattern($1, user_tmp_type, user_tmp_type)
4329 manage_sock_files_pattern($1, user_tmp_type, user_tmp_type)
4330 manage_fifo_files_pattern($1, user_tmp_type, user_tmp_type)
4331 files_search_tmp($1)
4334 ########################################
4336 ## List all user temporary content.
4338 ## <param name="domain">
4340 ## Domain allowed access.
4344 interface(`userdom_list_all_user_tmp_content',`
4346 attribute user_tmp_type;
4349 list_dirs_pattern($1, user_tmp_type, user_tmp_type)
4350 getattr_files_pattern($1, user_tmp_type, user_tmp_type)
4351 read_lnk_files_pattern($1, user_tmp_type, user_tmp_type)
4352 getattr_sock_files_pattern($1, user_tmp_type, user_tmp_type)
4353 getattr_fifo_files_pattern($1, user_tmp_type, user_tmp_type)
4354 files_search_var($1)
4355 files_search_tmp($1)
4358 ########################################
4360 ## Manage all user tmpfs content.
4362 ## <param name="domain">
4364 ## Domain allowed access.
4368 interface(`userdom_manage_all_user_tmpfs_content',`
4370 attribute user_tmpfs_type;
4373 manage_dirs_pattern($1, user_tmpfs_type, user_tmpfs_type)
4374 manage_files_pattern($1, user_tmpfs_type, user_tmpfs_type)
4375 manage_lnk_files_pattern($1, user_tmpfs_type, user_tmpfs_type)
4376 manage_sock_files_pattern($1, user_tmpfs_type, user_tmpfs_type)
4377 manage_fifo_files_pattern($1, user_tmpfs_type, user_tmpfs_type)
4381 ########################################
4383 ## Delete all user temporary content.
4385 ## <param name="domain">
4387 ## Domain allowed access.
4391 interface(`userdom_delete_all_user_tmp_content',`
4393 attribute user_tmp_type;
4396 delete_dirs_pattern($1, user_tmp_type, user_tmp_type)
4397 delete_files_pattern($1, user_tmp_type, user_tmp_type)
4398 delete_lnk_files_pattern($1, user_tmp_type, user_tmp_type)
4399 delete_sock_files_pattern($1, user_tmp_type, user_tmp_type)
4400 delete_fifo_files_pattern($1, user_tmp_type, user_tmp_type)
4402 files_search_var($1)
4403 files_delete_tmp_dir_entry($1)
4406 ########################################
4408 ## Read system SSL certificates in the users homedir.
4410 ## <param name="domain">
4412 ## Domain allowed access.
4416 interface(`userdom_read_home_certs',`
4421 userdom_search_user_home_content($1)
4422 allow $1 home_cert_t:dir list_dir_perms;
4423 read_files_pattern($1, home_cert_t, home_cert_t)
4424 read_lnk_files_pattern($1, home_cert_t, home_cert_t)
4427 #######################################
4429 ## Dontaudit Write system SSL certificates in the users homedir.
4431 ## <param name="domain">
4433 ## Domain to not audit.
4437 interface(`userdom_dontaudit_write_home_certs',`
4442 dontaudit $1 home_cert_t:file write;
4445 ########################################
4447 ## dontaudit Search getatrr /root files
4449 ## <param name="domain">
4451 ## Domain to not audit.
4455 interface(`userdom_dontaudit_getattr_admin_home_files',`
4460 dontaudit $1 admin_home_t:file getattr;
4463 ########################################
4465 ## dontaudit read /root lnk files
4467 ## <param name="domain">
4469 ## Domain to not audit.
4473 interface(`userdom_dontaudit_read_admin_home_lnk_files',`
4478 dontaudit $1 admin_home_t:lnk_file read;
4481 ########################################
4483 ## dontaudit read /root files
4485 ## <param name="domain">
4487 ## Domain to not audit.
4491 interface(`userdom_dontaudit_read_admin_home_files',`
4496 dontaudit $1 admin_home_t:file read_file_perms;
4499 ########################################
4501 ## Create, read, write, and delete user
4502 ## temporary chr files.
4504 ## <param name="domain">
4506 ## Domain allowed access.
4510 interface(`userdom_manage_user_tmp_chr_files',`
4515 manage_chr_files_pattern($1, user_tmp_t, user_tmp_t)
4516 files_search_tmp($1)
4519 ########################################
4521 ## Create, read, write, and delete user
4522 ## temporary blk files.
4524 ## <param name="domain">
4526 ## Domain allowed access.
4530 interface(`userdom_manage_user_tmp_blk_files',`
4535 manage_blk_files_pattern($1, user_tmp_t, user_tmp_t)
4536 files_search_tmp($1)
4539 ########################################
4541 ## Dontaudit attempt to set attributes on user temporary directories.
4543 ## <param name="domain">
4545 ## Domain to not audit.
4549 interface(`userdom_dontaudit_setattr_user_tmp',`
4554 dontaudit $1 user_tmp_t:dir setattr;
4557 ########################################
4559 ## Write all inherited users files in /tmp
4561 ## <param name="domain">
4563 ## Domain allowed access.
4567 interface(`userdom_write_inherited_user_tmp_files',`
4572 allow $1 user_tmp_t:file write;
4575 ########################################
4577 ## Delete all users files in /tmp
4579 ## <param name="domain">
4581 ## Domain allowed access.
4585 interface(`userdom_delete_user_tmp_files',`
4590 allow $1 user_tmp_t:file delete_file_perms;
4593 ########################################
4595 ## Delete user tmpfs files.
4597 ## <param name="domain">
4599 ## Domain allowed access.
4603 interface(`userdom_delete_user_tmpfs_files',`
4608 allow $1 user_tmpfs_t:file delete_file_perms;
4611 ########################################
4613 ## Read/Write unpriviledged user SysV shared
4616 ## <param name="domain">
4618 ## Domain allowed access.
4622 interface(`userdom_rw_unpriv_user_shared_mem',`
4624 attribute unpriv_userdomain;
4627 allow $1 unpriv_userdomain:shm rw_shm_perms;
4630 ########################################
4632 ## Do not audit attempts to search user
4633 ## temporary directories.
4635 ## <param name="domain">
4637 ## Domain to not audit.
4641 interface(`userdom_dontaudit_search_user_tmp',`
4646 dontaudit $1 user_tmp_t:dir search_dir_perms;
4649 ########################################
4651 ## Execute a file in a user home directory
4652 ## in the specified domain.
4656 ## Execute a file in a user home directory
4657 ## in the specified domain.
4660 ## No interprocess communication (signals, pipes,
4661 ## etc.) is provided by this interface since
4662 ## the domains are not owned by this module.
4665 ## <param name="domain">
4667 ## Domain allowed access.
4670 ## <param name="target_domain">
4672 ## The type of the new process.
4676 interface(`userdom_domtrans_user_home',`
4681 read_lnk_files_pattern($1, user_home_t, user_home_t)
4682 domain_transition_pattern($1, user_home_t, $2)
4683 type_transition $1 user_home_t:process $2;
4686 ########################################
4688 ## Execute a file in a user tmp directory
4689 ## in the specified domain.
4693 ## Execute a file in a user tmp directory
4694 ## in the specified domain.
4697 ## No interprocess communication (signals, pipes,
4698 ## etc.) is provided by this interface since
4699 ## the domains are not owned by this module.
4702 ## <param name="domain">
4704 ## Domain allowed access.
4707 ## <param name="target_domain">
4709 ## The type of the new process.
4713 interface(`userdom_domtrans_user_tmp',`
4718 files_search_tmp($1)
4719 read_lnk_files_pattern($1, user_tmp_t, user_tmp_t)
4720 domain_transition_pattern($1, user_tmp_t, $2)
4721 type_transition $1 user_tmp_t:process $2;
4724 ########################################
4726 ## Do not audit attempts to read all user home content files.
4728 ## <param name="domain">
4730 ## Domain to not audit.
4734 interface(`userdom_dontaudit_read_all_user_home_content_files',`
4736 attribute user_home_type;
4739 dontaudit $1 user_home_type:file read_file_perms;
4742 ########################################
4744 ## Do not audit attempts to read all user tmp content files.
4746 ## <param name="domain">
4748 ## Domain to not audit.
4752 interface(`userdom_dontaudit_read_all_user_tmp_content_files',`
4754 attribute user_tmp_type;
4757 dontaudit $1 user_tmp_type:file read_file_perms;