Chris PeBenito 17de1b
Chris PeBenito 6246e7
policy_module(xserver, 3.3.2)
Chris PeBenito 296273
Chris PeBenito 296273
gen_require(`
Chris PeBenito 296273
	class x_drawable all_x_drawable_perms;
Chris PeBenito 296273
	class x_screen all_x_screen_perms;
Chris PeBenito 296273
	class x_gc all_x_gc_perms;
Chris PeBenito 296273
	class x_font all_x_font_perms;
Chris PeBenito 296273
	class x_colormap all_x_colormap_perms;
Chris PeBenito 296273
	class x_property all_x_property_perms;
Chris PeBenito 296273
	class x_selection all_x_selection_perms;
Chris PeBenito 296273
	class x_cursor all_x_cursor_perms;
Chris PeBenito 296273
	class x_client all_x_client_perms;
Chris PeBenito 296273
	class x_device all_x_device_perms;
Eamon Walsh f267f8
	class x_pointer all_x_pointer_perms;
Eamon Walsh f267f8
	class x_keyboard all_x_keyboard_perms;
Chris PeBenito 296273
	class x_server all_x_server_perms;
Chris PeBenito 296273
	class x_extension all_x_extension_perms;
Chris PeBenito 296273
	class x_resource all_x_resource_perms;
Chris PeBenito 296273
	class x_event all_x_event_perms;
Chris PeBenito 296273
	class x_synthetic_event all_x_synthetic_event_perms;
Chris PeBenito 296273
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 56e1b3
## <desc>
Chris PeBenito 56e1b3
## 

Chris PeBenito 56e1b3
## Allows clients to write to the X server shared
Chris PeBenito 56e1b3
## memory segments.
Chris PeBenito 56e1b3
## 

Chris PeBenito 56e1b3
## </desc>
Chris PeBenito 0bfccd
gen_tunable(allow_write_xshm, false)
Chris PeBenito 56e1b3
Chris PeBenito 56e1b3
## <desc>
Chris PeBenito 56e1b3
## 

Chris PeBenito 56e1b3
## Allow xdm logins as sysadm
Chris PeBenito 56e1b3
## 

Chris PeBenito 56e1b3
## </desc>
Chris PeBenito 0bfccd
gen_tunable(xdm_sysadm_login, false)
Chris PeBenito 56e1b3
Chris PeBenito 2c12b4
## <desc>
Chris PeBenito 2c12b4
## 

Chris PeBenito 2c12b4
## Support X userspace object manager
Chris PeBenito 2c12b4
## 

Chris PeBenito 2c12b4
## </desc>
Chris PeBenito 0bfccd
gen_tunable(xserver_object_manager, false)
Chris PeBenito 2c12b4
Chris PeBenito 2c12b4
attribute x_domain;
Chris PeBenito 2c12b4
Eamon Walsh f267f8
# X Events
Eamon Walsh f267f8
attribute xevent_type;
Eamon Walsh f267f8
attribute input_xevent_type;
Eamon Walsh f267f8
type xevent_t, xevent_type;
Chris PeBenito 9448ca
typealias xevent_t alias { user_property_xevent_t staff_property_xevent_t sysadm_property_xevent_t };
Chris PeBenito 9448ca
typealias xevent_t alias { auditadm_property_xevent_t secadm_property_xevent_t };
Chris PeBenito 9448ca
typealias xevent_t alias { user_focus_xevent_t staff_focus_xevent_t sysadm_focus_xevent_t };
Chris PeBenito 9448ca
typealias xevent_t alias { auditadm_focus_xevent_t secadm_focus_xevent_t };
Chris PeBenito 9448ca
typealias xevent_t alias { user_manage_xevent_t staff_manage_xevent_t sysadm_manage_xevent_t };
Chris PeBenito 9448ca
typealias xevent_t alias { auditadm_manage_xevent_t secadm_manage_xevent_t };
Chris PeBenito 9448ca
typealias xevent_t alias { user_default_xevent_t staff_default_xevent_t sysadm_default_xevent_t };
Chris PeBenito 9448ca
typealias xevent_t alias { auditadm_default_xevent_t secadm_default_xevent_t };
Chris PeBenito 9448ca
Chris PeBenito 2c12b4
type client_xevent_t, xevent_type;
Chris PeBenito 9448ca
typealias client_xevent_t alias { user_client_xevent_t staff_client_xevent_t sysadm_client_xevent_t };
Chris PeBenito 9448ca
typealias client_xevent_t alias { auditadm_client_xevent_t secadm_client_xevent_t };
Chris PeBenito 9448ca
Eamon Walsh f267f8
type input_xevent_t, xevent_type, input_xevent_type;
Eamon Walsh f267f8
Eamon Walsh f267f8
# X Extensions
Eamon Walsh f267f8
attribute xextension_type;
Eamon Walsh f267f8
type xextension_t, xextension_type;
Eamon Walsh f267f8
type security_xextension_t, xextension_type;
Eamon Walsh f267f8
Eamon Walsh f267f8
# X Properties
Eamon Walsh f267f8
attribute xproperty_type;
Eamon Walsh f267f8
type xproperty_t, xproperty_type;
Eamon Walsh f267f8
type seclabel_xproperty_t, xproperty_type;
Chris PeBenito 2c12b4
type clipboard_xproperty_t, xproperty_type;
Chris PeBenito 2c12b4
Eamon Walsh f267f8
# X Selections
Eamon Walsh f267f8
attribute xselection_type;
Eamon Walsh f267f8
type xselection_t, xselection_type;
Eamon Walsh f267f8
type clipboard_xselection_t, xselection_type;
Eamon Walsh f267f8
#type settings_xselection_t, xselection_type;
Eamon Walsh f267f8
#type dbus_xselection_t, xselection_type;
Chris PeBenito 296273
Eamon Walsh f267f8
# X Drawables
Eamon Walsh f267f8
attribute xdrawable_type;
Eamon Walsh f267f8
attribute xcolormap_type;
Eamon Walsh f267f8
type root_xdrawable_t, xdrawable_type;
Eamon Walsh f267f8
type root_xcolormap_t, xcolormap_type;
Chris PeBenito 17de1b
Eamon Walsh f267f8
attribute xserver_unconfined_type;
Chris PeBenito 296273
Eamon Walsh f267f8
xserver_object_types_template(root)
Chris PeBenito 296273
xserver_object_types_template(user)
Eamon Walsh f267f8
Chris PeBenito 296273
typealias user_xproperty_t alias { staff_xproperty_t sysadm_xproperty_t };
Chris PeBenito 296273
typealias user_xproperty_t alias { auditadm_xproperty_t secadm_xproperty_t };
Chris PeBenito 296273
typealias user_input_xevent_t alias { staff_input_xevent_t sysadm_input_xevent_t };
Chris PeBenito 296273
typealias user_input_xevent_t alias { auditadm_input_xevent_t secadm_input_xevent_t };
Eamon Walsh f267f8
Eamon Walsh f267f8
type remote_t;
Eamon Walsh f267f8
xserver_object_types_template(remote)
Eamon Walsh f267f8
xserver_common_x_domain_template(remote,remote_t)
Chris PeBenito 296273
Chris PeBenito 296273
type user_fonts_t;
Chris PeBenito 296273
typealias user_fonts_t alias { staff_fonts_t sysadm_fonts_t };
Chris PeBenito 296273
typealias user_fonts_t alias { auditadm_fonts_t secadm_fonts_t };
Chris PeBenito 296273
userdom_user_home_content(user_fonts_t)
Chris PeBenito 296273
Chris PeBenito 296273
type user_fonts_cache_t;
Chris PeBenito 296273
typealias user_fonts_cache_t alias { staff_fonts_cache_t sysadm_fonts_cache_t };
Chris PeBenito 296273
typealias user_fonts_cache_t alias { auditadm_fonts_cache_t secadm_fonts_cache_t };
Chris PeBenito 296273
userdom_user_home_content(user_fonts_cache_t)
Chris PeBenito 296273
Chris PeBenito 296273
type user_fonts_config_t;
Chris PeBenito 296273
typealias user_fonts_config_t alias { staff_fonts_config_t sysadm_fonts_config_t };
Chris PeBenito 296273
typealias user_fonts_config_t alias { auditadm_fonts_config_t secadm_fonts_config_t };
Chris PeBenito 73c77e
userdom_user_home_content(user_fonts_config_t)
Chris PeBenito 296273
Eamon Walsh f267f8
type iceauth_t;
Eamon Walsh f267f8
type iceauth_exec_t;
Eamon Walsh f267f8
typealias iceauth_t alias { user_iceauth_t staff_iceauth_t sysadm_iceauth_t };
Eamon Walsh f267f8
typealias iceauth_t alias { auditadm_iceauth_t secadm_iceauth_t };
Eamon Walsh f267f8
application_domain(iceauth_t, iceauth_exec_t)
Eamon Walsh f267f8
ubac_constrained(iceauth_t)
Eamon Walsh f267f8
Eamon Walsh f267f8
type iceauth_home_t;
Eamon Walsh f267f8
typealias iceauth_home_t alias { user_iceauth_home_t staff_iceauth_home_t sysadm_iceauth_home_t };
Eamon Walsh f267f8
typealias iceauth_home_t alias { auditadm_iceauth_home_t secadm_iceauth_home_t };
Eamon Walsh f267f8
files_poly_member(iceauth_home_t)
Eamon Walsh f267f8
userdom_user_home_content(iceauth_home_t)
Chris PeBenito 2c12b4
Chris PeBenito 296273
type xauth_t;
Chris PeBenito 17de1b
type xauth_exec_t;
Chris PeBenito 296273
typealias xauth_t alias { user_xauth_t staff_xauth_t sysadm_xauth_t };
Chris PeBenito 296273
typealias xauth_t alias { auditadm_xauth_t secadm_xauth_t };
Chris PeBenito 296273
application_domain(xauth_t, xauth_exec_t)
Chris PeBenito 296273
ubac_constrained(xauth_t)
Chris PeBenito 296273
Chris PeBenito 296273
type xauth_home_t;
Chris PeBenito 296273
typealias xauth_home_t alias { user_xauth_home_t staff_xauth_home_t sysadm_xauth_home_t };
Chris PeBenito 296273
typealias xauth_home_t alias { auditadm_xauth_home_t secadm_xauth_home_t };
Chris PeBenito 296273
files_poly_member(xauth_home_t)
Chris PeBenito 296273
userdom_user_home_content(xauth_home_t)
Chris PeBenito 296273
Chris PeBenito 296273
type xauth_tmp_t;
Chris PeBenito 296273
typealias xauth_tmp_t alias { user_xauth_tmp_t staff_xauth_tmp_t sysadm_xauth_tmp_t };
Chris PeBenito 296273
typealias xauth_tmp_t alias { auditadm_xauth_tmp_t secadm_xauth_tmp_t };
Chris PeBenito 296273
files_tmp_file(xauth_tmp_t)
Chris PeBenito 296273
ubac_constrained(xauth_tmp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# this is not actually a device, its a pipe
Chris PeBenito 17de1b
type xconsole_device_t;
Chris PeBenito 17de1b
files_type(xconsole_device_t)
Chris PeBenito 17de1b
fs_associate_tmpfs(xconsole_device_t)
Chris PeBenito 17de1b
files_associate_tmp(xconsole_device_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type xdm_t;
Chris PeBenito e070dd
type xdm_exec_t;
Chris PeBenito 4b3b46
auth_login_pgm_domain(xdm_t)
Chris PeBenito 0bfccd
init_domain(xdm_t, xdm_exec_t)
Chris PeBenito 0bfccd
init_daemon_domain(xdm_t, xdm_exec_t)
Eamon Walsh f267f8
xserver_object_types_template(xdm)
Eamon Walsh f267f8
xserver_common_x_domain_template(xdm, xdm_t)
Eamon Walsh f267f8
xserver_unconfined(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type xdm_lock_t;
Chris PeBenito 17de1b
files_lock_file(xdm_lock_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type xdm_rw_etc_t;
Chris PeBenito 17de1b
files_type(xdm_rw_etc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type xdm_var_lib_t;
Chris PeBenito 17de1b
files_type(xdm_var_lib_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type xdm_var_run_t;
Chris PeBenito 17de1b
files_pid_file(xdm_var_run_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type xdm_tmp_t;
Chris PeBenito 17de1b
files_tmp_file(xdm_tmp_t)
Chris PeBenito 6b19be
typealias xdm_tmp_t alias ice_tmp_t;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type xdm_tmpfs_t;
Chris PeBenito 17de1b
files_tmpfs_file(xdm_tmpfs_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# type for /var/lib/xkb
Chris PeBenito 17de1b
type xkb_var_lib_t;
Chris PeBenito 17de1b
files_type(xkb_var_lib_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Type for the executable used to start the X server, e.g. Xwrapper.
Chris PeBenito 296273
type xserver_t;
Chris PeBenito 17de1b
type xserver_exec_t;
Chris PeBenito 296273
typealias xserver_t alias { user_xserver_t staff_xserver_t sysadm_xserver_t };
Chris PeBenito e33591
typealias xserver_t alias { auditadm_xserver_t secadm_xserver_t xdm_xserver_t };
Chris PeBenito 296273
init_system_domain(xserver_t, xserver_exec_t)
Chris PeBenito 296273
ubac_constrained(xserver_t)
Chris PeBenito 296273
Chris PeBenito 296273
type xserver_tmp_t;
Chris PeBenito 296273
typealias xserver_tmp_t alias { user_xserver_tmp_t staff_xserver_tmp_t sysadm_xserver_tmp_t };
Chris PeBenito e33591
typealias xserver_tmp_t alias { auditadm_xserver_tmp_t secadm_xserver_tmp_t xdm_xserver_tmp_t };
Chris PeBenito 296273
files_tmp_file(xserver_tmp_t)
Chris PeBenito 296273
ubac_constrained(xserver_tmp_t)
Chris PeBenito 296273
Chris PeBenito 296273
type xserver_tmpfs_t;
Chris PeBenito 296273
typealias xserver_tmpfs_t alias { user_xserver_tmpfs_t staff_xserver_tmpfs_t sysadm_xserver_tmpfs_t };
Chris PeBenito e33591
typealias xserver_tmpfs_t alias { auditadm_xserver_tmpfs_t secadm_xserver_tmpfs_t xdm_xserver_tmpfs_t };
Chris PeBenito 296273
files_tmpfs_file(xserver_tmpfs_t)
Chris PeBenito 296273
ubac_constrained(xserver_tmpfs_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type xsession_exec_t;
Chris PeBenito 17de1b
corecmd_executable_file(xsession_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Type for the X server log file.
Chris PeBenito 17de1b
type xserver_log_t;
Chris PeBenito 17de1b
logging_log_file(xserver_log_t)
Chris PeBenito 17de1b
Chris PeBenito e070dd
ifdef(`enable_mcs',`
Chris PeBenito 3f67f7
	init_ranged_domain(xdm_t, xdm_exec_t, s0 - mcs_systemhigh)
Chris PeBenito 3f67f7
	init_ranged_daemon_domain(xdm_t, xdm_exec_t, s0 - mcs_systemhigh)
Chris PeBenito e070dd
')
Chris PeBenito e070dd
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	prelink_object_file(xkb_var_lib_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 296273
# Iceauth local policy
Chris PeBenito 296273
#
Chris PeBenito 296273
Chris PeBenito 296273
allow iceauth_t iceauth_home_t:file manage_file_perms;
Chris PeBenito 296273
userdom_user_home_dir_filetrans(iceauth_t, iceauth_home_t, file)
Chris PeBenito 296273
Chris PeBenito 296273
allow xdm_t iceauth_home_t:file read_file_perms;
Chris PeBenito 296273
Chris PeBenito 296273
fs_search_auto_mountpoints(iceauth_t)
Chris PeBenito 296273
Chris PeBenito 296273
userdom_use_user_terminals(iceauth_t)
Chris PeBenito 296273
Chris PeBenito 296273
tunable_policy(`use_nfs_home_dirs',`
Chris PeBenito 296273
	fs_manage_nfs_files(iceauth_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
tunable_policy(`use_samba_home_dirs',`
Chris PeBenito 296273
	fs_manage_cifs_files(iceauth_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
########################################
Chris PeBenito 296273
#
Chris PeBenito 296273
# Xauth local policy
Chris PeBenito 296273
#
Chris PeBenito 296273
Chris PeBenito 296273
allow xauth_t self:process signal;
Chris PeBenito 296273
allow xauth_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 296273
Chris PeBenito 296273
allow xauth_t xauth_home_t:file manage_file_perms;
Chris PeBenito 296273
userdom_user_home_dir_filetrans(xauth_t, xauth_home_t, file)
Chris PeBenito 296273
Chris PeBenito 296273
manage_dirs_pattern(xauth_t, xauth_tmp_t, xauth_tmp_t)
Chris PeBenito 296273
manage_files_pattern(xauth_t, xauth_tmp_t, xauth_tmp_t)
Chris PeBenito 296273
files_tmp_filetrans(xauth_t, xauth_tmp_t, { file dir })
Chris PeBenito 296273
Chris PeBenito 296273
allow xdm_t xauth_home_t:file manage_file_perms;
Chris PeBenito 296273
userdom_user_home_dir_filetrans(xdm_t, xauth_home_t, file)
Chris PeBenito 296273
Chris PeBenito 296273
domain_use_interactive_fds(xauth_t)
Chris PeBenito 296273
Chris PeBenito 296273
files_read_etc_files(xauth_t)
Chris PeBenito 296273
files_search_pids(xauth_t)
Chris PeBenito 296273
Chris PeBenito 296273
fs_getattr_xattr_fs(xauth_t)
Chris PeBenito 296273
fs_search_auto_mountpoints(xauth_t)
Chris PeBenito 296273
Chris PeBenito 296273
# cjp: why?
Chris PeBenito 296273
term_use_ptmx(xauth_t)
Chris PeBenito 296273
Chris PeBenito 296273
auth_use_nsswitch(xauth_t)
Chris PeBenito 296273
Chris PeBenito 296273
userdom_use_user_terminals(xauth_t)
Chris PeBenito 296273
userdom_read_user_tmp_files(xauth_t)
Chris PeBenito 296273
Chris PeBenito 296273
xserver_rw_xdm_tmp_files(xauth_t)
Chris PeBenito 296273
Chris PeBenito 296273
tunable_policy(`use_nfs_home_dirs',`
Chris PeBenito 296273
	fs_manage_nfs_files(xauth_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
tunable_policy(`use_samba_home_dirs',`
Chris PeBenito 296273
	fs_manage_cifs_files(xauth_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
optional_policy(`
Chris PeBenito 296273
	ssh_sigchld(xauth_t)
Chris PeBenito 296273
	ssh_read_pipes(xauth_t)
Chris PeBenito 296273
	ssh_dontaudit_rw_tcp_sockets(xauth_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
########################################
Chris PeBenito 296273
#
Chris PeBenito 17de1b
# XDM Local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow xdm_t self:capability { setgid setuid sys_resource kill sys_tty_config mknod chown dac_override dac_read_search fowner fsetid ipc_owner sys_nice sys_rawio net_bind_service };
Chris PeBenito a5e213
allow xdm_t self:process { setexec setpgid getsched setsched setrlimit signal_perms setkeycreate };
Chris PeBenito c0868a
allow xdm_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 17de1b
allow xdm_t self:shm create_shm_perms;
Chris PeBenito 17de1b
allow xdm_t self:sem create_sem_perms;
Chris PeBenito 17de1b
allow xdm_t self:unix_stream_socket { connectto create_stream_socket_perms };
Chris PeBenito 17de1b
allow xdm_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 17de1b
allow xdm_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow xdm_t self:udp_socket create_socket_perms;
Chris PeBenito a5e213
allow xdm_t self:socket create_socket_perms;
Chris PeBenito a5e213
allow xdm_t self:appletalk_socket create_socket_perms;
Chris PeBenito a5e213
allow xdm_t self:key { search link write };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow xdm_t xconsole_device_t:fifo_file { getattr setattr };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Allow gdm to run gdm-binary
Chris PeBenito 17de1b
can_exec(xdm_t, xdm_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 6b19be
allow xdm_t xdm_lock_t:file manage_file_perms;
Chris PeBenito 0bfccd
files_lock_filetrans(xdm_t, xdm_lock_t, file)
Chris PeBenito 6b19be
Chris PeBenito 17de1b
# wdm has its own config dir /etc/X11/wdm
Chris PeBenito 17de1b
# this is ugly, daemons should not create files under /etc!
Chris PeBenito 0bfccd
manage_files_pattern(xdm_t, xdm_rw_etc_t, xdm_rw_etc_t)
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
manage_dirs_pattern(xdm_t, xdm_tmp_t, xdm_tmp_t)
Chris PeBenito 0bfccd
manage_files_pattern(xdm_t, xdm_tmp_t, xdm_tmp_t)
Chris PeBenito 0bfccd
manage_sock_files_pattern(xdm_t, xdm_tmp_t, xdm_tmp_t)
Chris PeBenito 6b19be
files_tmp_filetrans(xdm_t, xdm_tmp_t, { file dir sock_file })
Chris PeBenito 6b19be
Chris PeBenito 0bfccd
manage_dirs_pattern(xdm_t, xdm_tmpfs_t, xdm_tmpfs_t)
Chris PeBenito 0bfccd
manage_files_pattern(xdm_t, xdm_tmpfs_t, xdm_tmpfs_t)
Chris PeBenito 0bfccd
manage_lnk_files_pattern(xdm_t, xdm_tmpfs_t, xdm_tmpfs_t)
Chris PeBenito 0bfccd
manage_fifo_files_pattern(xdm_t, xdm_tmpfs_t, xdm_tmpfs_t)
Chris PeBenito 0bfccd
manage_sock_files_pattern(xdm_t, xdm_tmpfs_t, xdm_tmpfs_t)
Chris PeBenito 0bfccd
fs_tmpfs_filetrans(xdm_t, xdm_tmpfs_t,{ dir file lnk_file sock_file fifo_file })
Chris PeBenito 6b19be
Chris PeBenito 0bfccd
manage_dirs_pattern(xdm_t, xdm_var_lib_t, xdm_var_lib_t)	
Chris PeBenito 0bfccd
manage_files_pattern(xdm_t, xdm_var_lib_t, xdm_var_lib_t)
Chris PeBenito 0bfccd
files_var_lib_filetrans(xdm_t, xdm_var_lib_t, file)
Chris PeBenito 6b19be
Chris PeBenito 0bfccd
manage_dirs_pattern(xdm_t, xdm_var_run_t, xdm_var_run_t)
Chris PeBenito 0bfccd
manage_files_pattern(xdm_t, xdm_var_run_t, xdm_var_run_t)
Chris PeBenito 0bfccd
manage_fifo_files_pattern(xdm_t, xdm_var_run_t, xdm_var_run_t)
Chris PeBenito 0bfccd
files_pid_filetrans(xdm_t, xdm_var_run_t, { dir file fifo_file })
Chris PeBenito 6b19be
Chris PeBenito 296273
allow xdm_t xserver_t:process signal;
Chris PeBenito 296273
allow xdm_t xserver_t:unix_stream_socket connectto;
Chris PeBenito 6b19be
Chris PeBenito 296273
allow xdm_t xserver_tmp_t:sock_file rw_sock_file_perms;
Chris PeBenito 296273
allow xdm_t xserver_tmp_t:dir { setattr list_dir_perms };
Chris PeBenito 6b19be
Chris PeBenito 6b19be
# transition to the xdm xserver
Chris PeBenito 296273
domtrans_pattern(xdm_t, xserver_exec_t, xserver_t)
Chris PeBenito 296273
allow xserver_t xdm_t:process signal;
Chris PeBenito 296273
allow xdm_t xserver_t:process { noatsecure siginh rlimitinh signal sigkill };
Chris PeBenito 6b19be
Chris PeBenito 296273
allow xdm_t xserver_t:shm rw_shm_perms;
Chris PeBenito 6b19be
Chris PeBenito 6b19be
# connect to xdm xserver over stream socket
Chris PeBenito 3f67f7
stream_connect_pattern(xdm_t, xserver_tmp_t, xserver_tmp_t, xserver_t)
Chris PeBenito 6b19be
Chris PeBenito 6b19be
# Remove /tmp/.X11-unix/X0.
Chris PeBenito 3f67f7
delete_files_pattern(xdm_t, xserver_tmp_t, xserver_tmp_t)
Chris PeBenito 3f67f7
delete_sock_files_pattern(xdm_t, xserver_tmp_t, xserver_tmp_t)
Chris PeBenito 6b19be
Chris PeBenito 0bfccd
manage_dirs_pattern(xdm_t, xserver_log_t, xserver_log_t)
Chris PeBenito 0bfccd
manage_files_pattern(xdm_t, xserver_log_t, xserver_log_t)
Chris PeBenito 0bfccd
manage_fifo_files_pattern(xdm_t, xserver_log_t, xserver_log_t)
Chris PeBenito 0bfccd
logging_log_filetrans(xdm_t, xserver_log_t, file)
Chris PeBenito 6b19be
Chris PeBenito 17de1b
kernel_read_system_state(xdm_t)
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(xdm_t)
Chris PeBenito a5e213
kernel_read_net_sysctls(xdm_t)
Chris PeBenito a5e213
kernel_read_network_state(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
corecmd_exec_shell(xdm_t)
Chris PeBenito 17de1b
corecmd_exec_bin(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 190066
corenet_all_recvfrom_unlabeled(xdm_t)
Chris PeBenito 190066
corenet_all_recvfrom_netlabel(xdm_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_generic_if(xdm_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_generic_if(xdm_t)
Chris PeBenito c12621
corenet_tcp_sendrecv_generic_node(xdm_t)
Chris PeBenito c12621
corenet_udp_sendrecv_generic_node(xdm_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_ports(xdm_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_ports(xdm_t)
Chris PeBenito c12621
corenet_tcp_bind_generic_node(xdm_t)
Chris PeBenito c12621
corenet_udp_bind_generic_node(xdm_t)
Chris PeBenito 17de1b
corenet_tcp_connect_all_ports(xdm_t)
Chris PeBenito 17de1b
corenet_sendrecv_all_client_packets(xdm_t)
Chris PeBenito 17de1b
# xdm tries to bind to biff_port_t
Chris PeBenito 17de1b
corenet_dontaudit_tcp_bind_all_ports(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_rand(xdm_t)
Chris PeBenito 17de1b
dev_read_sysfs(xdm_t)
Chris PeBenito 17de1b
dev_getattr_framebuffer_dev(xdm_t)
Chris PeBenito 17de1b
dev_setattr_framebuffer_dev(xdm_t)
Chris PeBenito 17de1b
dev_getattr_mouse_dev(xdm_t)
Chris PeBenito 17de1b
dev_setattr_mouse_dev(xdm_t)
Chris PeBenito 17de1b
dev_rw_apm_bios(xdm_t)
Chris PeBenito 17de1b
dev_setattr_apm_bios_dev(xdm_t)
Chris PeBenito 17de1b
dev_rw_dri(xdm_t)
Chris PeBenito 17de1b
dev_rw_agp(xdm_t)
Chris PeBenito 17de1b
dev_getattr_xserver_misc_dev(xdm_t)
Chris PeBenito 17de1b
dev_setattr_xserver_misc_dev(xdm_t)
Chris PeBenito 17de1b
dev_getattr_misc_dev(xdm_t)
Chris PeBenito 17de1b
dev_setattr_misc_dev(xdm_t)
Chris PeBenito 17de1b
dev_dontaudit_rw_misc(xdm_t)
Chris PeBenito 17de1b
dev_getattr_video_dev(xdm_t)
Chris PeBenito 17de1b
dev_setattr_video_dev(xdm_t)
Chris PeBenito 17de1b
dev_getattr_scanner_dev(xdm_t)
Chris PeBenito 17de1b
dev_setattr_scanner_dev(xdm_t)
Chris PeBenito 17de1b
dev_getattr_sound_dev(xdm_t)
Chris PeBenito 17de1b
dev_setattr_sound_dev(xdm_t)
Chris PeBenito 17de1b
dev_getattr_power_mgmt_dev(xdm_t)
Chris PeBenito 17de1b
dev_setattr_power_mgmt_dev(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_use_interactive_fds(xdm_t)
Chris PeBenito 17de1b
# Do not audit denied probes of /proc.
Chris PeBenito 17de1b
domain_dontaudit_read_all_domains_state(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_read_etc_files(xdm_t)
Chris PeBenito a5e213
files_read_var_files(xdm_t)
Chris PeBenito 17de1b
files_read_etc_runtime_files(xdm_t)
Chris PeBenito 17de1b
files_exec_etc_files(xdm_t)
Chris PeBenito 17de1b
files_list_mnt(xdm_t)
Chris PeBenito 17de1b
# Read /usr/share/terminfo/l/linux and /usr/share/icons/default/index.theme...
Chris PeBenito 17de1b
files_read_usr_files(xdm_t)
Chris PeBenito 17de1b
# Poweroff wants to create the /poweroff file when run from xdm
Chris PeBenito 17de1b
files_create_boot_flag(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
fs_getattr_all_fs(xdm_t)
Chris PeBenito 17de1b
fs_search_auto_mountpoints(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
storage_dontaudit_read_fixed_disk(xdm_t)
Chris PeBenito 17de1b
storage_dontaudit_write_fixed_disk(xdm_t)
Chris PeBenito 17de1b
storage_dontaudit_setattr_fixed_disk_dev(xdm_t)
Chris PeBenito 17de1b
storage_dontaudit_raw_read_removable_device(xdm_t)
Chris PeBenito 17de1b
storage_dontaudit_raw_write_removable_device(xdm_t)
Chris PeBenito 17de1b
storage_dontaudit_setattr_removable_dev(xdm_t)
Chris PeBenito 17de1b
storage_dontaudit_rw_scsi_generic(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
term_setattr_console(xdm_t)
Chris PeBenito 17de1b
term_use_unallocated_ttys(xdm_t)
Chris PeBenito 17de1b
term_setattr_unallocated_ttys(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 6b19be
auth_domtrans_pam_console(xdm_t)
Chris PeBenito 17de1b
auth_manage_pam_pid(xdm_t)
Chris PeBenito 17de1b
auth_manage_pam_console_data(xdm_t)
Chris PeBenito a5e213
auth_rw_faillog(xdm_t)
Chris PeBenito a5e213
auth_write_login_records(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Run telinit->init to shutdown.
Chris PeBenito a5f5eb
init_telinit(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
libs_exec_lib_files(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_read_generic_logs(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(xdm_t)
Chris PeBenito 17de1b
miscfiles_read_fonts(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
sysnet_read_config(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
userdom_dontaudit_use_unpriv_user_fds(xdm_t)
Chris PeBenito 17de1b
userdom_create_all_users_keys(xdm_t)
Chris PeBenito 17de1b
# for .dmrc
Chris PeBenito 296273
userdom_read_user_home_content_files(xdm_t)
Chris PeBenito 17de1b
# Search /proc for any user domain processes.
Chris PeBenito 17de1b
userdom_read_all_users_state(xdm_t)
Chris PeBenito 17de1b
userdom_signal_all_users(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 3f67f7
xserver_rw_session(xdm_t, xdm_tmpfs_t)
Chris PeBenito 2c12b4
xserver_unconfined(xdm_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
tunable_policy(`use_nfs_home_dirs',`
Chris PeBenito 17de1b
	fs_manage_nfs_dirs(xdm_t)
Chris PeBenito 17de1b
	fs_manage_nfs_files(xdm_t)
Chris PeBenito 17de1b
	fs_manage_nfs_symlinks(xdm_t)
Chris PeBenito 17de1b
	fs_exec_nfs_files(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
tunable_policy(`use_samba_home_dirs',`
Chris PeBenito 17de1b
	fs_manage_cifs_dirs(xdm_t)
Chris PeBenito 17de1b
	fs_manage_cifs_files(xdm_t)
Chris PeBenito 17de1b
	fs_manage_cifs_symlinks(xdm_t)
Chris PeBenito 17de1b
	fs_exec_cifs_files(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 6b19be
tunable_policy(`xdm_sysadm_login',`
Chris PeBenito 6b19be
	userdom_xsession_spec_domtrans_all_users(xdm_t)
Chris PeBenito 6b19be
	# FIXME:
Chris PeBenito 6b19be
#	xserver_rw_session_template(xdm,userdomain)
Chris PeBenito 6b19be
',`
Chris PeBenito 6b19be
	userdom_xsession_spec_domtrans_unpriv_users(xdm_t)
Chris PeBenito 6b19be
	# FIXME:
Chris PeBenito 6b19be
#	xserver_rw_session_template(xdm,unpriv_userdomain)
Chris PeBenito 296273
#	dontaudit xserver_t sysadm_t:shm { unix_read unix_write };
Chris PeBenito 296273
#	allow xserver_t xdm_tmpfs_t:file rw_file_perms;
Chris PeBenito 6b19be
')
Chris PeBenito 6b19be
Chris PeBenito 6b19be
optional_policy(`
Chris PeBenito 6b19be
	alsa_domtrans(xdm_t)
Chris PeBenito 6b19be
')
Chris PeBenito 6b19be
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito e66689
	consolekit_dbus_chat(xdm_t)
Chris PeBenito e66689
')
Chris PeBenito e66689
Chris PeBenito e66689
optional_policy(`
Chris PeBenito 465510
	consoletype_exec(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	# Talk to the console mouse server.
Chris PeBenito 17de1b
	gpm_stream_connect(xdm_t)
Chris PeBenito 17de1b
	gpm_setattr_gpmctl(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	hostname_exec(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	loadkeys_exec(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	locallogin_signull(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	# Do not audit attempts to check whether user root has email
Chris PeBenito 17de1b
	mta_dontaudit_getattr_spool_files(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 296273
	resmgr_stream_connect(xdm_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
optional_policy(`
Chris PeBenito 17de1b
	seutil_sigchld_newrole(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	udev_read_db(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 350b6a
	unconfined_domain(xdm_t)
Chris PeBenito 350b6a
	unconfined_domtrans(xdm_t)
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	ifndef(`distro_redhat',`
Chris PeBenito 350b6a
		allow xdm_t self:process { execheap execmem };
Chris PeBenito 350b6a
	')
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	ifdef(`distro_rhel4',`
Chris PeBenito 350b6a
		allow xdm_t self:process { execheap execmem };
Chris PeBenito 350b6a
	')
Chris PeBenito 350b6a
')
Chris PeBenito 350b6a
Chris PeBenito 350b6a
optional_policy(`
Chris PeBenito 17de1b
	userhelper_dontaudit_search_config(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	usermanage_read_crack_db(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	xfs_stream_connect(xdm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 296273
# X server local policy
Chris PeBenito 296273
#
Chris PeBenito 296273
Eamon Walsh f267f8
# X Object Manager rules
Eamon Walsh f267f8
type_transition xserver_t xserver_t:x_drawable root_xdrawable_t;
Eamon Walsh f267f8
type_transition xserver_t xserver_t:x_colormap root_xcolormap_t;
Eamon Walsh f267f8
type_transition root_xdrawable_t input_xevent_t:x_event root_input_xevent_t;
Eamon Walsh f267f8
Eamon Walsh f267f8
allow xserver_t { root_xdrawable_t x_domain }:x_drawable send;
Eamon Walsh f267f8
allow xserver_t input_xevent_t:x_event send;
Eamon Walsh f267f8
Chris PeBenito 296273
# setuid/setgid for the wrapper program to change UID
Chris PeBenito 296273
# sys_rawio is for iopl access - should not be needed for frame-buffer
Chris PeBenito 296273
# sys_admin, locking shared mem?  chowning IPC message queues or semaphores?
Chris PeBenito 296273
# admin of APM bios?
Chris PeBenito 296273
# sys_nice is so that the X server can set a negative nice value
Chris PeBenito 296273
# execheap needed until the X module loader is fixed.
Chris PeBenito 296273
# NVIDIA Needs execstack
Chris PeBenito 296273
Chris PeBenito 296273
allow xserver_t self:capability { dac_override fowner fsetid setgid setuid ipc_owner sys_rawio sys_admin sys_nice sys_tty_config mknod net_bind_service };
Chris PeBenito 296273
dontaudit xserver_t self:capability chown;
Chris PeBenito 296273
allow xserver_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
Chris PeBenito 296273
allow xserver_t self:memprotect mmap_zero;
Chris PeBenito 296273
allow xserver_t self:fd use;
Chris PeBenito 296273
allow xserver_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 296273
allow xserver_t self:sock_file read_sock_file_perms;
Chris PeBenito 296273
allow xserver_t self:shm create_shm_perms;
Chris PeBenito 296273
allow xserver_t self:sem create_sem_perms;
Chris PeBenito 296273
allow xserver_t self:msgq create_msgq_perms;
Chris PeBenito 296273
allow xserver_t self:msg { send receive };
Chris PeBenito 296273
allow xserver_t self:unix_dgram_socket { create_socket_perms sendto };
Chris PeBenito 296273
allow xserver_t self:unix_stream_socket { create_stream_socket_perms connectto };
Chris PeBenito 296273
allow xserver_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 296273
allow xserver_t self:udp_socket create_socket_perms;
Chris PeBenito 296273
Chris PeBenito 296273
manage_dirs_pattern(xserver_t, xserver_tmp_t, xserver_tmp_t)
Chris PeBenito 296273
manage_files_pattern(xserver_t, xserver_tmp_t, xserver_tmp_t)
Chris PeBenito 296273
manage_sock_files_pattern(xserver_t, xserver_tmp_t, xserver_tmp_t)
Chris PeBenito 296273
files_tmp_filetrans(xserver_t, xserver_tmp_t, { file dir sock_file })
Chris PeBenito 296273
Chris PeBenito 3f67f7
filetrans_pattern(xserver_t, xserver_tmp_t, xserver_tmp_t, sock_file)
Chris PeBenito 296273
Chris PeBenito 296273
manage_dirs_pattern(xserver_t, xserver_tmpfs_t, xserver_tmpfs_t)
Chris PeBenito 296273
manage_files_pattern(xserver_t, xserver_tmpfs_t, xserver_tmpfs_t)
Chris PeBenito 296273
manage_lnk_files_pattern(xserver_t, xserver_tmpfs_t, xserver_tmpfs_t)
Chris PeBenito 296273
manage_fifo_files_pattern(xserver_t, xserver_tmpfs_t, xserver_tmpfs_t)
Chris PeBenito 296273
manage_sock_files_pattern(xserver_t, xserver_tmpfs_t, xserver_tmpfs_t)
Chris PeBenito 296273
fs_tmpfs_filetrans(xserver_t, xserver_tmpfs_t, { dir file lnk_file sock_file fifo_file })
Chris PeBenito 296273
Chris PeBenito 296273
manage_files_pattern(xserver_t, xkb_var_lib_t, xkb_var_lib_t)
Chris PeBenito 296273
manage_lnk_files_pattern(xserver_t, xkb_var_lib_t, xkb_var_lib_t)
Chris PeBenito 296273
files_search_var_lib(xserver_t)
Chris PeBenito 296273
Eamon Walsh f267f8
domtrans_pattern(xserver_t, xauth_exec_t, xauth_t)
Eamon Walsh f267f8
allow xserver_t xauth_home_t:file read_file_perms;
Eamon Walsh f267f8
Chris PeBenito 296273
# Create files in /var/log with the xserver_log_t type.
Chris PeBenito 296273
manage_files_pattern(xserver_t, xserver_log_t, xserver_log_t)
Chris PeBenito 3f67f7
logging_log_filetrans(xserver_t, xserver_log_t, file)
Chris PeBenito 296273
Chris PeBenito 296273
kernel_read_system_state(xserver_t)
Chris PeBenito 296273
kernel_read_device_sysctls(xserver_t)
Chris PeBenito 296273
kernel_read_modprobe_sysctls(xserver_t)
Chris PeBenito 296273
# Xorg wants to check if kernel is tainted
Chris PeBenito 296273
kernel_read_kernel_sysctls(xserver_t)
Chris PeBenito 296273
kernel_write_proc_files(xserver_t)
Chris PeBenito 296273
Chris PeBenito 296273
# Run helper programs in xserver_t.
Chris PeBenito 296273
corecmd_exec_bin(xserver_t)
Chris PeBenito 296273
corecmd_exec_shell(xserver_t)
Chris PeBenito 296273
Chris PeBenito 296273
corenet_all_recvfrom_unlabeled(xserver_t)
Chris PeBenito 296273
corenet_all_recvfrom_netlabel(xserver_t)
Chris PeBenito 296273
corenet_tcp_sendrecv_generic_if(xserver_t)
Chris PeBenito 296273
corenet_udp_sendrecv_generic_if(xserver_t)
Chris PeBenito c12621
corenet_tcp_sendrecv_generic_node(xserver_t)
Chris PeBenito c12621
corenet_udp_sendrecv_generic_node(xserver_t)
Chris PeBenito 296273
corenet_tcp_sendrecv_all_ports(xserver_t)
Chris PeBenito 296273
corenet_udp_sendrecv_all_ports(xserver_t)
Chris PeBenito c12621
corenet_tcp_bind_generic_node(xserver_t)
Chris PeBenito 296273
corenet_tcp_bind_xserver_port(xserver_t)
Chris PeBenito 296273
corenet_tcp_connect_all_ports(xserver_t)
Chris PeBenito 296273
corenet_sendrecv_xserver_server_packets(xserver_t)
Chris PeBenito 296273
corenet_sendrecv_all_client_packets(xserver_t)
Chris PeBenito 296273
Chris PeBenito 296273
dev_rw_sysfs(xserver_t)
Chris PeBenito 296273
dev_rw_mouse(xserver_t)
Chris PeBenito 296273
dev_rw_mtrr(xserver_t)
Chris PeBenito 296273
dev_rw_apm_bios(xserver_t)
Chris PeBenito 296273
dev_rw_agp(xserver_t)
Chris PeBenito 296273
dev_rw_framebuffer(xserver_t)
Chris PeBenito 296273
dev_manage_dri_dev(xserver_t)
Chris PeBenito 693474
dev_filetrans_dri(xserver_t)
Chris PeBenito 296273
dev_create_generic_dirs(xserver_t)
Chris PeBenito 296273
dev_setattr_generic_dirs(xserver_t)
Chris PeBenito 296273
# raw memory access is needed if not using the frame buffer
Chris PeBenito 296273
dev_read_raw_memory(xserver_t)
Chris PeBenito 296273
dev_wx_raw_memory(xserver_t)
Chris PeBenito 296273
# for other device nodes such as the NVidia binary-only driver
Chris PeBenito 296273
dev_rw_xserver_misc(xserver_t)
Chris PeBenito 296273
# read events - the synaptics touchpad driver reads raw events
Chris PeBenito 296273
dev_rw_input_dev(xserver_t)
Chris PeBenito 296273
dev_rwx_zero(xserver_t)
Chris PeBenito 296273
Chris PeBenito 296273
domain_mmap_low(xserver_t)
Chris PeBenito 296273
Chris PeBenito 296273
files_read_etc_files(xserver_t)
Chris PeBenito 296273
files_read_etc_runtime_files(xserver_t)
Chris PeBenito 296273
files_read_usr_files(xserver_t)
Chris PeBenito 296273
Chris PeBenito 296273
# brought on by rhgb
Chris PeBenito 296273
files_search_mnt(xserver_t)
Chris PeBenito 296273
# for nscd
Chris PeBenito 296273
files_dontaudit_search_pids(xserver_t)
Chris PeBenito 296273
Chris PeBenito 296273
fs_getattr_xattr_fs(xserver_t)
Chris PeBenito 296273
fs_search_nfs(xserver_t)
Chris PeBenito 296273
fs_search_auto_mountpoints(xserver_t)
Chris PeBenito 296273
fs_search_ramfs(xserver_t)
Chris PeBenito 296273
Chris PeBenito 296273
mls_xwin_read_to_clearance(xserver_t)
Chris PeBenito 296273
Chris PeBenito 296273
selinux_validate_context(xserver_t)
Chris PeBenito 296273
selinux_compute_access_vector(xserver_t)
Chris PeBenito 296273
selinux_compute_create_context(xserver_t)
Chris PeBenito 296273
Chris PeBenito 296273
auth_use_nsswitch(xserver_t)
Chris PeBenito 296273
Chris PeBenito 296273
init_getpgid(xserver_t)
Chris PeBenito 296273
Chris PeBenito 296273
term_setattr_unallocated_ttys(xserver_t)
Chris PeBenito 296273
term_use_unallocated_ttys(xserver_t)
Chris PeBenito 296273
Chris PeBenito 296273
getty_use_fds(xserver_t)
Chris PeBenito 296273
Chris PeBenito 296273
locallogin_use_fds(xserver_t)
Chris PeBenito 296273
Chris PeBenito 296273
logging_send_syslog_msg(xserver_t)
Chris PeBenito 296273
logging_send_audit_msgs(xserver_t)
Chris PeBenito 296273
Chris PeBenito 296273
miscfiles_read_localization(xserver_t)
Chris PeBenito 296273
miscfiles_read_fonts(xserver_t)
Chris PeBenito 296273
Chris PeBenito 296273
modutils_domtrans_insmod(xserver_t)
Chris PeBenito 296273
Chris PeBenito 296273
# read x_contexts
Chris PeBenito 296273
seutil_read_default_contexts(xserver_t)
Chris PeBenito 296273
Chris PeBenito 296273
userdom_search_user_home_dirs(xserver_t)
Chris PeBenito 296273
userdom_use_user_ttys(xserver_t)
Chris PeBenito 296273
userdom_setattr_user_ttys(xserver_t)
Chris PeBenito 296273
userdom_rw_user_tmpfs_files(xserver_t)
Chris PeBenito 296273
Chris PeBenito 296273
xserver_use_user_fonts(xserver_t)
Chris PeBenito 296273
Chris PeBenito 296273
ifndef(`distro_redhat',`
Chris PeBenito 296273
	allow xserver_t self:process { execmem execheap execstack };
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
ifdef(`distro_rhel4',`
Chris PeBenito 296273
	allow xserver_t self:process { execmem execheap execstack };
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
ifdef(`enable_mls',`
Chris PeBenito 296273
	range_transition xserver_t xserver_tmp_t:sock_file s0 - mls_systemhigh;
Chris PeBenito 7f4919
	range_transition xserver_t xserver_t:x_drawable s0 - mls_systemhigh;
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
tunable_policy(`!xserver_object_manager',`
Chris PeBenito 296273
	# should be xserver_unconfined(xserver_t),
Chris PeBenito 296273
	# but typeattribute doesnt work in conditionals
Chris PeBenito 296273
Chris PeBenito 296273
	allow xserver_t xserver_t:x_server *;
Eamon Walsh f267f8
	allow xserver_t { x_domain root_xdrawable_t }:x_drawable *;
Chris PeBenito 296273
	allow xserver_t xserver_t:x_screen *;
Chris PeBenito 296273
	allow xserver_t x_domain:x_gc *;
Eamon Walsh f267f8
	allow xserver_t { x_domain root_xcolormap_t }:x_colormap *;
Chris PeBenito 296273
	allow xserver_t xproperty_type:x_property *;
Chris PeBenito 296273
	allow xserver_t xselection_type:x_selection *;
Chris PeBenito 296273
	allow xserver_t x_domain:x_cursor *;
Eamon Walsh f267f8
	allow xserver_t x_domain:x_client *;
Chris PeBenito 296273
	allow xserver_t { x_domain xserver_t }:x_device *;
Eamon Walsh f267f8
	allow xserver_t { x_domain xserver_t }:x_pointer *;
Eamon Walsh f267f8
	allow xserver_t { x_domain xserver_t }:x_keyboard *;
Chris PeBenito 296273
	allow xserver_t xextension_type:x_extension *;
Chris PeBenito 296273
	allow xserver_t { x_domain xserver_t }:x_resource *;
Chris PeBenito 296273
	allow xserver_t xevent_type:{ x_event x_synthetic_event } *;
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
optional_policy(`
Chris PeBenito 296273
	apm_stream_connect(xserver_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
optional_policy(`
Chris PeBenito 296273
	auth_search_pam_console_data(xserver_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
optional_policy(`
Chris PeBenito 296273
	rhgb_getpgid(xserver_t)
Chris PeBenito 296273
	rhgb_signal(xserver_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
optional_policy(`
Chris PeBenito 296273
	unconfined_domain_noaudit(xserver_t)
Chris PeBenito 296273
	unconfined_domtrans(xserver_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
optional_policy(`
Chris PeBenito 296273
	userhelper_search_config(xserver_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
optional_policy(`
Chris PeBenito 296273
	xfs_stream_connect(xserver_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
########################################
Chris PeBenito 296273
#
Chris PeBenito 17de1b
# XDM Xserver local policy
Chris PeBenito 17de1b
#
Chris PeBenito 296273
# cjp: when xdm is configurable via tunable these
Chris PeBenito 296273
# rules will be enabled only when xdm is enabled
Chris PeBenito 17de1b
Chris PeBenito 296273
allow xserver_t xdm_t:process { signal getpgid };
Chris PeBenito 296273
allow xserver_t xdm_t:shm rw_shm_perms;
Chris PeBenito 17de1b
Chris PeBenito 296273
# NB we do NOT allow xserver_t xdm_var_lib_t:dir, only access to an open
Chris PeBenito 17de1b
# handle of a file inside the dir!!!
Chris PeBenito 296273
allow xserver_t xdm_var_lib_t:file { getattr read };
Chris PeBenito 296273
dontaudit xserver_t xdm_var_lib_t:dir search;
Chris PeBenito 17de1b
Chris PeBenito 296273
allow xserver_t xdm_var_run_t:file read_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Label pid and temporary files with derived types.
Chris PeBenito 296273
manage_files_pattern(xserver_t, xdm_tmp_t, xdm_tmp_t)
Chris PeBenito 296273
manage_lnk_files_pattern(xserver_t, xdm_tmp_t, xdm_tmp_t)
Chris PeBenito 296273
manage_sock_files_pattern(xserver_t, xdm_tmp_t, xdm_tmp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Run xkbcomp.
Chris PeBenito 296273
allow xserver_t xkb_var_lib_t:lnk_file read;
Chris PeBenito 296273
can_exec(xserver_t, xkb_var_lib_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# VNC v4 module in X server
Chris PeBenito 296273
corenet_tcp_bind_vnc_port(xserver_t)
Chris PeBenito 17de1b
Chris PeBenito 296273
init_use_fds(xserver_t)
Chris PeBenito 17de1b
Chris PeBenito 6b19be
# FIXME: After per user fonts are properly working
Chris PeBenito 296273
# xserver_t may no longer have any reason
Chris PeBenito 6b19be
# to read ROLE_home_t - examine this in more detail
Chris PeBenito 6b19be
# (xauth?)
Chris PeBenito 296273
userdom_read_user_home_content_files(xserver_t)
Chris PeBenito 6b19be
Chris PeBenito 296273
xserver_use_user_fonts(xserver_t)
Chris PeBenito 6b19be
Chris PeBenito 17de1b
tunable_policy(`use_nfs_home_dirs',`
Chris PeBenito 296273
	fs_manage_nfs_dirs(xserver_t)
Chris PeBenito 296273
	fs_manage_nfs_files(xserver_t)
Chris PeBenito 296273
	fs_manage_nfs_symlinks(xserver_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
tunable_policy(`use_samba_home_dirs',`
Chris PeBenito 296273
	fs_manage_cifs_dirs(xserver_t)
Chris PeBenito 296273
	fs_manage_cifs_files(xserver_t)
Chris PeBenito 296273
	fs_manage_cifs_symlinks(xserver_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 350b6a
optional_policy(`
Chris PeBenito 296273
	dbus_system_bus_client(xserver_t)
Chris PeBenito 296273
	hal_dbus_chat(xserver_t)
Chris PeBenito ef55a1
')
Chris PeBenito ef55a1
Chris PeBenito ef55a1
optional_policy(`
Chris PeBenito 350b6a
	resmgr_stream_connect(xdm_t)
Chris PeBenito 350b6a
')
Chris PeBenito 350b6a
Chris PeBenito 350b6a
optional_policy(`
Chris PeBenito 296273
	rhgb_rw_shm(xserver_t)
Chris PeBenito 296273
	rhgb_rw_tmpfs_files(xserver_t)
Chris PeBenito 350b6a
')
Chris PeBenito 350b6a
Chris PeBenito 296273
########################################
Chris PeBenito 296273
#
Chris PeBenito 296273
# Rules common to all X window domains
Chris PeBenito 296273
#
Chris PeBenito eac818
Chris PeBenito 296273
# Hacks
Chris PeBenito 296273
# everyone can do override-redirect windows.
Chris PeBenito 296273
# this could be used to spoof labels
Chris PeBenito 296273
allow x_domain self:x_drawable override;
Eamon Walsh f267f8
# firefox gets nosy with other people's windows
Eamon Walsh f267f8
allow x_domain x_domain:x_drawable { list_child receive };
Chris PeBenito 296273
Chris PeBenito 296273
# X Server
Eamon Walsh f267f8
# can get X server attributes
Eamon Walsh f267f8
allow x_domain xserver_t:x_server getattr;
Eamon Walsh f267f8
# can grab the server
Eamon Walsh f267f8
allow x_domain xserver_t:x_server grab;
Eamon Walsh f267f8
# can read and write server-owned generic resources
Eamon Walsh f267f8
allow x_domain xserver_t:x_resource { read write };
Chris PeBenito 296273
# can mess with own clients
Eamon Walsh f267f8
allow x_domain self:x_client { getattr manage destroy };
Chris PeBenito 296273
Chris PeBenito 296273
# X Protocol Extensions
Eamon Walsh f267f8
allow x_domain xextension_t:x_extension { query use };
Eamon Walsh f267f8
allow x_domain security_xextension_t:x_extension { query use };
Chris PeBenito 296273
Chris PeBenito 296273
# X Properties
Chris PeBenito 296273
# can change properties of root window
Eamon Walsh f267f8
allow x_domain root_xdrawable_t:x_drawable { list_property get_property set_property };
Eamon Walsh f267f8
# can change properties of my own windows
Chris PeBenito 296273
allow x_domain self:x_drawable { list_property get_property set_property };
Eamon Walsh f267f8
# can read and write cut buffers
Eamon Walsh f267f8
allow x_domain clipboard_xproperty_t:x_property { create read write append };
Eamon Walsh f267f8
# can read security labels
Eamon Walsh f267f8
allow x_domain seclabel_xproperty_t:x_property { getattr read };
Eamon Walsh f267f8
# can change all other properties
Eamon Walsh f267f8
allow x_domain xproperty_t:x_property { getattr create read write append destroy };
Chris PeBenito 296273
Chris PeBenito 296273
# X Windows
Chris PeBenito 296273
# operations allowed on root windows
Eamon Walsh f267f8
allow x_domain root_xdrawable_t:x_drawable { getattr setattr list_child add_child remove_child send receive hide show };
Chris PeBenito 296273
# operations allowed on my windows
Chris PeBenito 296273
allow x_domain self:x_drawable { create destroy getattr setattr read write show hide list_child add_child remove_child manage send receive };
Eamon Walsh f267f8
allow x_domain self:x_drawable { blend };
Eamon Walsh f267f8
# operations allowed on all windows
Eamon Walsh f267f8
allow x_domain x_domain:x_drawable { getattr get_property set_property remove_child };
Chris PeBenito 296273
Chris PeBenito 296273
# X Colormaps
Chris PeBenito 296273
# can use the default colormap
Eamon Walsh f267f8
allow x_domain root_xcolormap_t:x_colormap { read use add_color remove_color install uninstall };
Eamon Walsh f267f8
# can create and use colormaps
Eamon Walsh f267f8
allow x_domain self:x_colormap *;
Eamon Walsh f267f8
Eamon Walsh f267f8
# X Devices
Eamon Walsh f267f8
# operations allowed on my own devices
Eamon Walsh f267f8
allow x_domain self:{ x_device x_pointer x_keyboard } *;
Eamon Walsh f267f8
# operations allowed on generic devices
Eamon Walsh f267f8
allow x_domain xserver_t:x_device { use getattr setattr getfocus setfocus bell grab freeze force_cursor };
Eamon Walsh f267f8
# operations allowed on core keyboard
Eamon Walsh f267f8
allow x_domain xserver_t:x_keyboard { use getattr setattr getfocus setfocus bell grab };
Eamon Walsh f267f8
# operations allowed on core pointer
Eamon Walsh f267f8
allow x_domain xserver_t:x_pointer { read use getattr setattr getfocus setfocus bell grab freeze force_cursor };
Eamon Walsh f267f8
Eamon Walsh f267f8
# all devices can generate input events
Eamon Walsh f267f8
allow x_domain root_xdrawable_t:x_drawable send;
Eamon Walsh f267f8
allow x_domain x_domain:x_drawable send;
Eamon Walsh f267f8
allow x_domain input_xevent_t:x_event send;
Eamon Walsh f267f8
Eamon Walsh f267f8
# dontaudit keyloggers repeatedly polling
Eamon Walsh f267f8
#dontaudit x_domain xserver_t:x_keyboard read;
Chris PeBenito 296273
Chris PeBenito 296273
# X Input
Eamon Walsh f267f8
# can receive default events
Eamon Walsh f267f8
allow x_domain xevent_t:{ x_event x_synthetic_event } receive;
Eamon Walsh f267f8
# can receive ICCCM events
Eamon Walsh f267f8
allow x_domain client_xevent_t:{ x_event x_synthetic_event } receive;
Chris PeBenito 296273
# can send ICCCM events to the root window
Chris PeBenito 296273
allow x_domain client_xevent_t:x_synthetic_event send;
Eamon Walsh f267f8
# can receive root window input events
Eamon Walsh f267f8
allow x_domain root_input_xevent_t:x_event receive;
Eamon Walsh f267f8
Chris PeBenito 296273
# X Selections
Chris PeBenito 296273
# can use the clipboard
Chris PeBenito 296273
allow x_domain clipboard_xselection_t:x_selection { getattr setattr read };
Eamon Walsh f267f8
# can use default selections
Eamon Walsh f267f8
allow x_domain xselection_t:x_selection { getattr setattr read };
Chris PeBenito 296273
Chris PeBenito 296273
# Other X Objects
Chris PeBenito 296273
# can create and use cursors
Chris PeBenito 296273
allow x_domain self:x_cursor *;
Chris PeBenito 296273
# can create and use graphics contexts
Chris PeBenito 296273
allow x_domain self:x_gc *;
Chris PeBenito 296273
# can read and write own objects
Chris PeBenito 296273
allow x_domain self:x_resource { read write };
Eamon Walsh f267f8
# can mess with the screensaver
Eamon Walsh f267f8
allow x_domain xserver_t:x_screen { getattr saver_getattr };
Eamon Walsh f267f8
Eamon Walsh f267f8
########################################
Eamon Walsh f267f8
#
Eamon Walsh f267f8
# Rules for unconfined access to this module
Eamon Walsh f267f8
#
Chris PeBenito 296273
Chris PeBenito 296273
tunable_policy(`! xserver_object_manager',`
Chris PeBenito 296273
	# should be xserver_unconfined(x_domain),
Chris PeBenito 296273
	# but typeattribute doesnt work in conditionals
Chris PeBenito 296273
Chris PeBenito 296273
	allow x_domain xserver_t:x_server *;
Eamon Walsh f267f8
	allow x_domain xdrawable_type:x_drawable *;
Chris PeBenito 296273
	allow x_domain xserver_t:x_screen *;
Chris PeBenito 296273
	allow x_domain x_domain:x_gc *;
Eamon Walsh f267f8
	allow x_domain xcolormap_type:x_colormap *;
Chris PeBenito 296273
	allow x_domain xproperty_type:x_property *;
Chris PeBenito 296273
	allow x_domain xselection_type:x_selection *;
Chris PeBenito 296273
	allow x_domain x_domain:x_cursor *;
Eamon Walsh f267f8
	allow x_domain x_domain:x_client *;
Chris PeBenito 296273
	allow x_domain { x_domain xserver_t }:x_device *;
Eamon Walsh f267f8
	allow x_domain { x_domain xserver_t }:x_pointer *;
Eamon Walsh f267f8
	allow x_domain { x_domain xserver_t }:x_keyboard *;
Chris PeBenito 296273
	allow x_domain xextension_type:x_extension *;
Chris PeBenito 296273
	allow x_domain { x_domain xserver_t }:x_resource *;
Chris PeBenito 296273
	allow x_domain xevent_type:{ x_event x_synthetic_event } *;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 296273
allow xserver_unconfined_type xserver_t:x_server *;
Eamon Walsh f267f8
allow xserver_unconfined_type xdrawable_type:x_drawable *;
Chris PeBenito 296273
allow xserver_unconfined_type xserver_t:x_screen *;
Chris PeBenito 2c12b4
allow xserver_unconfined_type x_domain:x_gc *;
Eamon Walsh f267f8
allow xserver_unconfined_type xcolormap_type:x_colormap *;
Chris PeBenito 2c12b4
allow xserver_unconfined_type xproperty_type:x_property *;
Chris PeBenito 2c12b4
allow xserver_unconfined_type xselection_type:x_selection *;
Chris PeBenito 2c12b4
allow xserver_unconfined_type x_domain:x_cursor *;
Eamon Walsh f267f8
allow xserver_unconfined_type x_domain:x_client *;
Chris PeBenito 296273
allow xserver_unconfined_type { x_domain xserver_t }:x_device *;
Eamon Walsh f267f8
allow xserver_unconfined_type { x_domain xserver_t }:x_pointer *;
Eamon Walsh f267f8
allow xserver_unconfined_type { x_domain xserver_t }:x_keyboard *;
Chris PeBenito 2c12b4
allow xserver_unconfined_type xextension_type:x_extension *;
Chris PeBenito 296273
allow xserver_unconfined_type { x_domain xserver_t }:x_resource *;
Chris PeBenito 2c12b4
allow xserver_unconfined_type xevent_type:{ x_event x_synthetic_event } *;