Chris PeBenito 0fbfa5
#DESC XDM - X Display Manager
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# Authors:  Mark Westerman mark.westerman@westcam.com
Chris PeBenito 0fbfa5
#           Russell Coker <russell@coker.com.au>
Chris PeBenito 0fbfa5
# X-Debian-Packages: gdm xdm wdm kdm
Chris PeBenito 0fbfa5
# Depends: xserver.te
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# Some wdm-specific changes by Tom Vogt <tom@lemuria.org>
Chris PeBenito 0fbfa5
# 
Chris PeBenito 0fbfa5
# Some alterations and documentation by Stephen Smalley <sds@epoch.ncsc.mil>
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
#################################
Chris PeBenito 0fbfa5
# 
Chris PeBenito 0fbfa5
# Rules for the xdm_t domain.
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# xdm_t is the domain of a X Display Manager process 
Chris PeBenito 0fbfa5
# spawned by getty.
Chris PeBenito 0fbfa5
# xdm_exec_t is the type of the [xgkw]dm program
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
daemon_domain(xdm, `, privuser, privrole, auth_chkpwd, privowner, privmem, nscd_client_domain')
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# for running xdm from init
Chris PeBenito 0fbfa5
domain_auto_trans(init_t, xdm_exec_t, xdm_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow xdm_t xdm_var_run_t:dir setattr;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# for xdmctl
Chris PeBenito 0fbfa5
allow xdm_t xdm_var_run_t:fifo_file create_file_perms;
Chris PeBenito 0fbfa5
allow initrc_t xdm_var_run_t:fifo_file unlink;
Chris PeBenito 0fbfa5
file_type_auto_trans(xdm_t, var_run_t, xdm_var_run_t, fifo_file)
Chris PeBenito 0fbfa5
file_type_auto_trans(xdm_t, var_run_t, xdm_var_run_t, dir)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
tmp_domain(xdm, `', `{ file dir sock_file }')
Chris PeBenito 0fbfa5
var_lib_domain(xdm)
Chris PeBenito 0fbfa5
# NB we do NOT allow xdm_xserver_t xdm_var_lib_t:dir, only access to an open
Chris PeBenito 0fbfa5
# handle of a file inside the dir!!!
Chris PeBenito 0fbfa5
allow xdm_xserver_t xdm_var_lib_t:file { getattr read };
Chris PeBenito 0fbfa5
dontaudit xdm_xserver_t xdm_var_lib_t:dir search;
Chris PeBenito 0fbfa5
allow xdm_xserver_t xdm_var_run_t:file { getattr read };
Chris PeBenito 0fbfa5
type xsession_exec_t, file_type, sysadmfile, exec_type;
Chris PeBenito 0fbfa5
type xdm_rw_etc_t, file_type, sysadmfile;
Chris PeBenito 0fbfa5
typealias xdm_rw_etc_t alias etc_xdm_t;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow xdm_t default_context_t:dir search;
Chris PeBenito 0fbfa5
allow xdm_t default_context_t:{ file lnk_file } { read getattr };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
can_network(xdm_t)
Chris PeBenito 2705f9
allow xdm_t port_type:tcp_socket name_connect;
Chris PeBenito 0fbfa5
allow xdm_t self:unix_stream_socket { connectto create_stream_socket_perms };
Chris PeBenito 0fbfa5
allow xdm_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 0fbfa5
allow xdm_t self:fifo_file rw_file_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow xdm_t xdm_xserver_tmp_t:dir r_dir_perms;
Chris PeBenito 0fbfa5
allow xdm_t xdm_xserver_t:process signal;
Chris PeBenito 0fbfa5
can_unix_connect(xdm_t, xdm_xserver_t)
Chris PeBenito 0fbfa5
allow xdm_t xdm_xserver_tmp_t:sock_file rw_file_perms;
Chris PeBenito 0fbfa5
allow xdm_t xdm_xserver_tmp_t:dir { setattr r_dir_perms };
Chris PeBenito 0fbfa5
allow xdm_xserver_t xdm_t:process signal;
Chris PeBenito 0fbfa5
# for reboot
Chris PeBenito 0fbfa5
allow xdm_t initctl_t:fifo_file write;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# init script wants to check if it needs to update windowmanagerlist
Chris PeBenito 0fbfa5
allow initrc_t xdm_rw_etc_t:file { getattr read };
Chris PeBenito 0fbfa5
ifdef(`distro_suse', `
Chris PeBenito 0fbfa5
# set permissions on /tmp/.X11-unix
Chris PeBenito 0fbfa5
allow initrc_t xdm_tmp_t:dir setattr;
Chris PeBenito 0fbfa5
')
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# Use capabilities.
Chris PeBenito 0fbfa5
allow xdm_t self:capability { setgid setuid sys_resource kill sys_tty_config mknod chown dac_override dac_read_search fowner fsetid ipc_owner };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow xdm_t { urandom_device_t random_device_t }:chr_file { getattr read ioctl };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Transition to user domains for user sessions.
Chris PeBenito 0fbfa5
domain_trans(xdm_t, xsession_exec_t, unpriv_userdomain)
Chris PeBenito 0fbfa5
allow unpriv_userdomain xdm_xserver_t:unix_stream_socket connectto;
Chris PeBenito 0fbfa5
allow unpriv_userdomain xdm_xserver_t:shm r_shm_perms;
Chris PeBenito 0fbfa5
allow unpriv_userdomain xdm_xserver_t:fd use;
Chris PeBenito 2705f9
allow unpriv_userdomain xdm_xserver_tmpfs_t:file { getattr read };
Chris PeBenito 0fbfa5
allow xdm_xserver_t unpriv_userdomain:shm rw_shm_perms;
Chris PeBenito 0fbfa5
allow xdm_xserver_t unpriv_userdomain:fd use;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Do not audit user access to the X log files due to file handle inheritance
Chris PeBenito 0fbfa5
dontaudit unpriv_userdomain xserver_log_t:file { write append };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# gnome-session creates socket under /tmp/.ICE-unix/
Chris PeBenito 0fbfa5
allow unpriv_userdomain xdm_tmp_t:dir rw_dir_perms;
Chris PeBenito 0fbfa5
allow unpriv_userdomain xdm_tmp_t:sock_file create;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Allow xdm logins as sysadm_r:sysadm_t
Chris PeBenito 0fbfa5
bool xdm_sysadm_login false;
Chris PeBenito 0fbfa5
if (xdm_sysadm_login) {
Chris PeBenito 0fbfa5
domain_trans(xdm_t, xsession_exec_t, sysadm_t)
Chris PeBenito 0fbfa5
allow sysadm_t xdm_xserver_t:unix_stream_socket connectto;
Chris PeBenito 0fbfa5
allow sysadm_t xdm_xserver_t:shm r_shm_perms;
Chris PeBenito 0fbfa5
allow sysadm_t xdm_xserver_t:fd use;
Chris PeBenito 2705f9
allow sysadm_t xdm_xserver_tmpfs_t:file { getattr read };
Chris PeBenito 0fbfa5
allow xdm_xserver_t sysadm_t:shm rw_shm_perms;
Chris PeBenito 0fbfa5
allow xdm_xserver_t sysadm_t:fd use;
Chris PeBenito 0fbfa5
}
Chris PeBenito 0fbfa5
can_setexec(xdm_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Label pid and temporary files with derived types.
Chris PeBenito 0fbfa5
rw_dir_create_file(xdm_xserver_t, xdm_tmp_t)
Chris PeBenito 0fbfa5
allow xdm_xserver_t xdm_tmp_t:sock_file create_file_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Run helper programs.
Chris PeBenito 0fbfa5
allow xdm_t etc_t:file { getattr read };
Chris PeBenito 0fbfa5
allow xdm_t bin_t:dir { getattr search };
Chris PeBenito 0fbfa5
# lib_t is for running cpp
Chris PeBenito 0fbfa5
can_exec(xdm_t, { shell_exec_t etc_t bin_t sbin_t lib_t })
Chris PeBenito 0fbfa5
allow xdm_t { bin_t sbin_t }:lnk_file read;
Chris PeBenito 0fbfa5
ifdef(`hostname.te', `can_exec(xdm_t, hostname_exec_t)')
Chris PeBenito 0fbfa5
ifdef(`loadkeys.te', `can_exec(xdm_t, loadkeys_exec_t)')
Chris PeBenito 0fbfa5
allow xdm_t xdm_xserver_t:process sigkill;
Chris PeBenito 0fbfa5
allow xdm_t xdm_xserver_tmp_t:file unlink;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Access devices.
Chris PeBenito 0fbfa5
allow xdm_t device_t:dir { read search };
Chris PeBenito 0fbfa5
allow xdm_t console_device_t:chr_file setattr;
Chris PeBenito 0fbfa5
allow xdm_t xconsole_device_t:fifo_file { getattr setattr };
Chris PeBenito 0fbfa5
allow xdm_t framebuf_device_t:chr_file { getattr setattr };
Chris PeBenito 0fbfa5
allow xdm_t mouse_device_t:chr_file { getattr setattr };
Chris PeBenito 0fbfa5
allow xdm_t apm_bios_t:chr_file { setattr getattr read write };
Chris PeBenito 0fbfa5
allow xdm_t dri_device_t:chr_file rw_file_perms;
Chris PeBenito 0fbfa5
allow xdm_t device_t:dir rw_dir_perms;
Chris PeBenito 0fbfa5
allow xdm_t agp_device_t:chr_file rw_file_perms;
Chris PeBenito 0fbfa5
allow xdm_t { xserver_misc_device_t misc_device_t }:chr_file { setattr getattr };
Chris PeBenito 0fbfa5
allow xdm_t v4l_device_t:chr_file { setattr getattr };
Chris PeBenito 0fbfa5
allow xdm_t scanner_device_t:chr_file { setattr getattr };
Chris PeBenito 0fbfa5
allow xdm_t tty_device_t:chr_file { ioctl read write setattr getattr };
Chris PeBenito 0fbfa5
allow xdm_t device_t:lnk_file read;
Chris PeBenito 0fbfa5
can_resmgrd_connect(xdm_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Access xdm log files.
Chris PeBenito 0fbfa5
file_type_auto_trans(xdm_t, var_log_t, xserver_log_t, file)
Chris PeBenito 0fbfa5
allow xdm_t xserver_log_t:dir rw_dir_perms;
Chris PeBenito 0fbfa5
allow xdm_t xserver_log_t:dir setattr;
Chris PeBenito 0fbfa5
# Access /var/gdm/.gdmfifo.
Chris PeBenito 0fbfa5
allow xdm_t xserver_log_t:fifo_file create_file_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow xdm_t self:shm create_shm_perms;
Chris PeBenito 0fbfa5
allow { xdm_t unpriv_userdomain } xdm_xserver_t:unix_stream_socket connectto;
Chris PeBenito 0fbfa5
allow { xdm_t unpriv_userdomain } xdm_xserver_t:shm rw_shm_perms;
Chris PeBenito 0fbfa5
allow { xdm_t unpriv_userdomain } xdm_xserver_t:fd use;
Chris PeBenito 2705f9
allow { xdm_t unpriv_userdomain } xdm_xserver_tmpfs_t:file { getattr read };
Chris PeBenito 0fbfa5
allow xdm_xserver_t { xdm_t unpriv_userdomain }:shm rw_shm_perms;
Chris PeBenito 0fbfa5
allow xdm_xserver_t { xdm_t unpriv_userdomain }:fd use;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Remove /tmp/.X11-unix/X0.
Chris PeBenito 0fbfa5
allow xdm_t xdm_xserver_tmp_t:dir { remove_name write };
Chris PeBenito 0fbfa5
allow xdm_t xdm_xserver_tmp_t:sock_file unlink;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
ifdef(`gpm.te', `
Chris PeBenito 0fbfa5
# Talk to the console mouse server.
Chris PeBenito 0fbfa5
allow xdm_t gpmctl_t:sock_file { getattr setattr write };
Chris PeBenito 0fbfa5
allow xdm_t gpm_t:unix_stream_socket connectto;
Chris PeBenito 0fbfa5
')
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow xdm_t sysfs_t:dir search;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Update utmp and wtmp.
Chris PeBenito 0fbfa5
allow xdm_t initrc_var_run_t: file { read write lock };
Chris PeBenito 0fbfa5
allow xdm_t wtmp_t:file append;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Update lastlog.
Chris PeBenito 0fbfa5
allow xdm_t lastlog_t:file rw_file_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Ask the security server for SIDs for user sessions.
Chris PeBenito 0fbfa5
can_getsecurity(xdm_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
tmpfs_domain(xdm)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Need to further investigate these permissions and
Chris PeBenito 0fbfa5
# perhaps define derived types.
Chris PeBenito 0fbfa5
allow xdm_t var_lib_t:dir { write search add_name remove_name  create unlink };
Chris PeBenito 0fbfa5
allow xdm_t var_lib_t:file { create write unlink };
Chris PeBenito 2705f9
Chris PeBenito 2705f9
lock_domain(xdm)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Connect to xfs.
Chris PeBenito 0fbfa5
ifdef(`xfs.te', `
Chris PeBenito 0fbfa5
allow xdm_t xfs_tmp_t:dir search;
Chris PeBenito 0fbfa5
allow xdm_t xfs_tmp_t:sock_file write;
Chris PeBenito 0fbfa5
can_unix_connect(xdm_t, xfs_t)
Chris PeBenito 0fbfa5
')
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow xdm_t self:process { setpgid setsched };
Chris PeBenito 0fbfa5
allow xdm_t etc_t:lnk_file read;
Chris PeBenito 0fbfa5
allow xdm_t etc_runtime_t:file { getattr read };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# wdm has its own config dir /etc/X11/wdm
Chris PeBenito 0fbfa5
# this is ugly, daemons should not create files under /etc!
Chris PeBenito 0fbfa5
allow xdm_t xdm_rw_etc_t:dir rw_dir_perms;
Chris PeBenito 0fbfa5
allow xdm_t xdm_rw_etc_t:file create_file_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Signal any user domain.
Chris PeBenito 0fbfa5
allow xdm_t userdomain:process signal_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow xdm_t proc_t:file { getattr read };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
read_sysctl(xdm_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Search /proc for any user domain processes.
Chris PeBenito 0fbfa5
allow xdm_t userdomain:dir r_dir_perms;
Chris PeBenito 0fbfa5
allow xdm_t userdomain:{ file lnk_file } r_file_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Allow xdm access to the user domains
Chris PeBenito 0fbfa5
allow xdm_t home_root_t:dir search;
Chris PeBenito 0fbfa5
allow xdm_xserver_t home_root_t:dir search;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Do not audit denied attempts to access devices.
Chris PeBenito 0fbfa5
dontaudit xdm_t {removable_device_t fixed_disk_device_t}:{ chr_file blk_file } {setattr rw_file_perms};
Chris PeBenito 0fbfa5
dontaudit xdm_t device_t:file_class_set rw_file_perms;
Chris PeBenito 0fbfa5
dontaudit xdm_t misc_device_t:file_class_set rw_file_perms;
Chris PeBenito 0fbfa5
dontaudit xdm_t removable_device_t:file_class_set rw_file_perms;
Chris PeBenito 0fbfa5
dontaudit xdm_t scsi_generic_device_t:file_class_set rw_file_perms;
Chris PeBenito 0fbfa5
dontaudit xdm_t devpts_t:dir search;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Do not audit denied probes of /proc.
Chris PeBenito 0fbfa5
dontaudit xdm_t domain:dir r_dir_perms;
Chris PeBenito 0fbfa5
dontaudit xdm_t domain:{ file lnk_file } r_file_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Read /usr/share/terminfo/l/linux and /usr/share/icons/default/index.theme...
Chris PeBenito 0fbfa5
allow xdm_t usr_t:{ lnk_file file } { getattr read };
Chris PeBenito 2705f9
Chris PeBenito 2705f9
# Read fonts
Chris PeBenito 2705f9
read_fonts(xdm_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Do not audit attempts to write to index files under /usr
Chris PeBenito 0fbfa5
dontaudit xdm_t usr_t:file write;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Do not audit access to /root
Chris PeBenito 0fbfa5
dontaudit xdm_t sysadm_home_dir_t:dir { getattr search };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Do not audit user access to the X log files due to file handle inheritance
Chris PeBenito 0fbfa5
dontaudit unpriv_userdomain xserver_log_t:file { write append };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Do not audit attempts to check whether user root has email
Chris PeBenito 0fbfa5
dontaudit xdm_t { var_spool_t mail_spool_t }:dir search;
Chris PeBenito 0fbfa5
dontaudit xdm_t mail_spool_t:file getattr;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Access sound device.
Chris PeBenito 0fbfa5
allow xdm_t sound_device_t:chr_file { setattr getattr };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Allow setting of attributes on power management devices.
Chris PeBenito 0fbfa5
allow xdm_t power_device_t:chr_file { getattr setattr };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Run the X server in a derived domain.
Chris PeBenito 0fbfa5
xserver_domain(xdm)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
ifdef(`rhgb.te', `
Chris PeBenito 0fbfa5
allow xdm_xserver_t ramfs_t:dir rw_dir_perms;
Chris PeBenito 0fbfa5
allow xdm_xserver_t ramfs_t:file create_file_perms;
Chris PeBenito 0fbfa5
allow rhgb_t xdm_xserver_t:process signal;
Chris PeBenito 0fbfa5
')
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Unrestricted inheritance.
Chris PeBenito 0fbfa5
allow xdm_t xdm_xserver_t:process { noatsecure siginh rlimitinh };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Run xkbcomp.
Chris PeBenito 0fbfa5
allow xdm_xserver_t var_lib_t:dir search;
Chris PeBenito 2705f9
allow xdm_xserver_t xkb_var_lib_t:lnk_file read;
Chris PeBenito 2705f9
can_exec(xdm_xserver_t, xkb_var_lib_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Insert video drivers.  
Chris PeBenito 0fbfa5
allow xdm_xserver_t self:capability mknod;
Chris PeBenito 2705f9
allow xdm_xserver_t sysctl_modprobe_t:file { getattr read };
Chris PeBenito 0fbfa5
domain_auto_trans(xdm_xserver_t, insmod_exec_t, insmod_t)
Chris PeBenito 0fbfa5
allow insmod_t xserver_log_t:file write;
Chris PeBenito 0fbfa5
allow insmod_t xdm_xserver_t:unix_stream_socket { read write };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Read /proc/dri/.*
Chris PeBenito 0fbfa5
allow xdm_xserver_t proc_t:dir { search read };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Search /var/run.
Chris PeBenito 0fbfa5
allow xdm_xserver_t var_run_t:dir search;
Chris PeBenito 0fbfa5
Chris PeBenito 2705f9
# FIXME: After per user fonts are properly working
Chris PeBenito 2705f9
# xdm_xserver_t may no longer have any reason
Chris PeBenito 2705f9
# to read ROLE_home_t - examine this in more detail
Chris PeBenito 2705f9
# (xauth?)
Chris PeBenito 2705f9
Chris PeBenito 0fbfa5
# Search home directories.
Chris PeBenito 0fbfa5
allow xdm_xserver_t user_home_type:dir search;
Chris PeBenito 0fbfa5
allow xdm_xserver_t user_home_type:file { getattr read };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
if (use_nfs_home_dirs) {
Chris PeBenito 0fbfa5
allow { xdm_t xdm_xserver_t } autofs_t:dir { search getattr };
Chris PeBenito 0fbfa5
allow { xdm_t xdm_xserver_t } nfs_t:dir create_dir_perms;
Chris PeBenito 0fbfa5
allow { xdm_t xdm_xserver_t } nfs_t:{file lnk_file} create_file_perms;
Chris PeBenito 0fbfa5
can_exec(xdm_t, nfs_t)
Chris PeBenito 0fbfa5
}
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
if (use_samba_home_dirs) {
Chris PeBenito 0fbfa5
allow { xdm_t xdm_xserver_t } cifs_t:dir create_dir_perms;
Chris PeBenito 0fbfa5
allow { xdm_t xdm_xserver_t } cifs_t:{file lnk_file} create_file_perms;
Chris PeBenito 0fbfa5
can_exec(xdm_t, cifs_t)
Chris PeBenito 0fbfa5
}
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# for .dmrc
Chris PeBenito 0fbfa5
allow xdm_t user_home_dir_type:dir { getattr search };
Chris PeBenito 0fbfa5
allow xdm_t user_home_type:file { getattr read };
Chris PeBenito 0fbfa5
Chris PeBenito 2705f9
ifdef(`support_polyinstatiation', `
Chris PeBenito 2705f9
# xdm_t can polyinstantiate
Chris PeBenito 2705f9
polyinstantiater(xdm_t)
Chris PeBenito 2705f9
# xdm needs access for linking .X11-unix to poly /tmp
Chris PeBenito 2705f9
allow xdm_t polymember:dir { add_name remove_name write };
Chris PeBenito 2705f9
allow xdm_t polymember:lnk_file { create unlink };
Chris PeBenito 2705f9
# xdm needs access for copying .Xauthority into new home
Chris PeBenito 2705f9
allow xdm_t polymember:file { create getattr write };
Chris PeBenito 2705f9
')
Chris PeBenito 2705f9
Chris PeBenito 0fbfa5
allow xdm_t mnt_t:dir { getattr read search };
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# Wants to delete .xsession-errors file
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
allow xdm_t user_home_type:file unlink;
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# Should fix exec of pam_timestamp_check is not closing xdm file descriptor
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
ifdef(`pam.te', `
Chris PeBenito 0fbfa5
allow xdm_t pam_var_run_t:dir create_dir_perms;
Chris PeBenito 0fbfa5
allow xdm_t pam_var_run_t:file create_file_perms;
Chris PeBenito 0fbfa5
allow pam_t xdm_t:fifo_file { getattr ioctl write };
Chris PeBenito 2705f9
domain_auto_trans(xdm_t, pam_console_exec_t, pam_console_t)
Chris PeBenito 0fbfa5
can_exec(xdm_t, pam_exec_t)
Chris PeBenito 0fbfa5
# For pam_console
Chris PeBenito 0fbfa5
rw_dir_create_file(xdm_t, pam_var_console_t)
Chris PeBenito 0fbfa5
')
Chris PeBenito 0fbfa5
Chris PeBenito 2705f9
# Pamconsole/alsa 
Chris PeBenito 2705f9
ifdef(`alsa.te', `
Chris PeBenito 2705f9
domain_auto_trans(xdm_t, alsa_exec_t, alsa_t)
Chris PeBenito 2705f9
') dnl ifdef
Chris PeBenito 2705f9
Chris PeBenito 2705f9
allow xdm_t var_log_t:file { getattr read };
Chris PeBenito 0fbfa5
allow xdm_t self:capability { sys_nice sys_rawio net_bind_service };
Chris PeBenito 0fbfa5
allow xdm_t self:process setrlimit;
Chris PeBenito 0fbfa5
allow xdm_t wtmp_t:file { getattr read };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
domain_auto_trans(initrc_t, xserver_exec_t, xdm_xserver_t)
Chris PeBenito 0fbfa5
#
Chris PeBenito 2705f9
# Poweroff wants to create the /poweroff file when run from xdm
Chris PeBenito 0fbfa5
#
Chris PeBenito 2705f9
file_type_auto_trans(xdm_t, root_t, etc_runtime_t, file)
Chris PeBenito 2705f9
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# xdm tries to bind to biff_port_t
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
dontaudit xdm_t port_type:tcp_socket name_bind;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# VNC v4 module in X server
Chris PeBenito 0fbfa5
allow xdm_xserver_t vnc_port_t:tcp_socket name_bind; 
Chris PeBenito 0fbfa5
ifdef(`crack.te', `
Chris PeBenito 0fbfa5
allow xdm_t crack_db_t:file r_file_perms;
Chris PeBenito 0fbfa5
')
Chris PeBenito 0fbfa5
r_dir_file(xdm_t, selinux_config_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Run telinit->init to shutdown.
Chris PeBenito 0fbfa5
can_exec(xdm_t, init_exec_t)
Chris PeBenito 2705f9
allow xdm_t self:sem create_sem_perms;
Chris PeBenito 2705f9
Chris PeBenito 2705f9
# Allow gdm to run gdm-binary
Chris PeBenito 2705f9
can_exec(xdm_t, xdm_exec_t)
Chris PeBenito 2705f9
Chris PeBenito 2705f9
# Supress permission check on .ICE-unix
Chris PeBenito 2705f9
dontaudit xdm_t ice_tmp_t:dir { getattr setattr };
Chris PeBenito 2705f9
Chris PeBenito 2705f9
#### Also see xdm_macros.te
Chris PeBenito 77f6e2
ifdef(`use_mcs', `
Chris PeBenito 77f6e2
range_transition initrc_t xdm_exec_t s0 - s0:c0.c255;
Chris PeBenito 77f6e2
')