Chris PeBenito 4b76ea
policy_module(mplayer, 2.1.2)
Chris PeBenito 77b81c
Chris PeBenito 77b81c
########################################
Chris PeBenito 77b81c
#
Chris PeBenito 77b81c
# Declarations
Chris PeBenito 77b81c
#
Chris PeBenito 77b81c
Chris PeBenito 56e1b3
## <desc>
Chris PeBenito 56e1b3
## 

Chris PeBenito 56e1b3
## Allow mplayer executable stack
Chris PeBenito 56e1b3
## 

Chris PeBenito 56e1b3
## </desc>
Chris PeBenito 0bfccd
gen_tunable(allow_mplayer_execstack, false)
Chris PeBenito 350b6a
Chris PeBenito 296273
type mencoder_t;
Chris PeBenito 350b6a
type mencoder_exec_t;
Chris PeBenito 296273
typealias mencoder_t alias { user_mencoder_t staff_mencoder_t sysadm_mencoder_t };
Chris PeBenito 296273
typealias mencoder_t alias { auditadm_mencoder_t secadm_mencoder_t };
Chris PeBenito 296273
application_domain(mencoder_t, mencoder_exec_t)
Chris PeBenito 296273
ubac_constrained(mencoder_t)
Chris PeBenito 296273
Chris PeBenito 296273
type mplayer_t;
Chris PeBenito 296273
type mplayer_exec_t;
Chris PeBenito 296273
typealias mplayer_t alias { user_mplayer_t staff_mplayer_t sysadm_mplayer_t };
Chris PeBenito 296273
typealias mplayer_t alias { auditadm_mplayer_t secadm_mplayer_t };
Chris PeBenito 296273
application_domain(mplayer_t, mplayer_exec_t)
Chris PeBenito 296273
ubac_constrained(mplayer_t)
Chris PeBenito 56e1b3
Chris PeBenito 77b81c
type mplayer_etc_t;
Chris PeBenito 77b81c
files_config_file(mplayer_etc_t)
Chris PeBenito b04ecc
Chris PeBenito 296273
type mplayer_home_t;
Chris PeBenito 296273
typealias mplayer_home_t alias { user_mplayer_home_t staff_mplayer_home_t sysadm_mplayer_home_t };
Chris PeBenito 296273
typealias mplayer_home_t alias { auditadm_mplayer_home_t secadm_mplayer_home_t };
Dan Walsh 3eaa99
files_poly_member(mplayer_home_t)
Chris PeBenito 296273
userdom_user_home_content(mplayer_home_t)
Chris PeBenito 296273
Chris PeBenito 296273
type mplayer_tmpfs_t;
Chris PeBenito 296273
typealias mplayer_tmpfs_t alias { user_mplayer_tmpfs_t staff_mplayer_tmpfs_t sysadm_mplayer_tmpfs_t };
Chris PeBenito 296273
typealias mplayer_tmpfs_t alias { auditadm_mplayer_tmpfs_t secadm_mplayer_tmpfs_t };
Chris PeBenito 296273
files_tmpfs_file(mplayer_tmpfs_t)
Chris PeBenito 296273
ubac_constrained(mplayer_tmpfs_t)
Chris PeBenito 296273
Chris PeBenito 296273
########################################
Chris PeBenito 296273
#
Chris PeBenito 296273
# mencoder local policy
Chris PeBenito 296273
#
Chris PeBenito 296273
Chris PeBenito 296273
manage_dirs_pattern(mencoder_t, mplayer_home_t, mplayer_home_t)
Chris PeBenito 296273
manage_files_pattern(mencoder_t, mplayer_home_t, mplayer_home_t)
Chris PeBenito 296273
manage_lnk_files_pattern(mencoder_t, mplayer_home_t, mplayer_home_t)
Chris PeBenito 296273
Chris PeBenito 296273
# Read global config
Chris PeBenito 296273
allow mencoder_t mplayer_etc_t:dir list_dir_perms;
Chris PeBenito 296273
read_files_pattern(mencoder_t, mplayer_etc_t, mplayer_etc_t)
Chris PeBenito 296273
read_lnk_files_pattern(mencoder_t, mplayer_etc_t, mplayer_etc_t)
Chris PeBenito 296273
Chris PeBenito 296273
# Read /proc files and directories
Chris PeBenito 296273
# Necessary for /proc/meminfo, /proc/cpuinfo, etc..
Chris PeBenito 296273
kernel_read_system_state(mencoder_t)
Chris PeBenito 296273
# Sysctl on kernel version 
Chris PeBenito 296273
kernel_read_kernel_sysctls(mencoder_t)
Chris PeBenito 296273
Chris PeBenito 296273
# Required for win32 binary loader 
Chris PeBenito 296273
dev_rwx_zero(mencoder_t)
Chris PeBenito 296273
# Access to DVD/CD/V4L
Chris PeBenito 296273
dev_read_video_dev(mencoder_t)
Chris PeBenito 296273
Chris PeBenito 296273
# Read data in /usr/share (fonts, icons..)
Chris PeBenito 296273
files_read_usr_files(mencoder_t)
Chris PeBenito 296273
files_read_usr_symlinks(mencoder_t)
Chris PeBenito 296273
Chris PeBenito 296273
fs_search_auto_mountpoints(mencoder_t)
Chris PeBenito 296273
Chris PeBenito 296273
# Access to DVD/CD/V4L
Chris PeBenito 296273
storage_raw_read_removable_device(mencoder_t)
Chris PeBenito 296273
Chris PeBenito 296273
miscfiles_read_localization(mencoder_t)
Chris PeBenito 296273
Chris PeBenito 296273
userdom_use_user_terminals(mencoder_t)
Chris PeBenito 296273
# Handle removable media, /tmp, and /home
Chris PeBenito 296273
userdom_list_user_tmp(mencoder_t)
Chris PeBenito 296273
userdom_read_user_tmp_files(mencoder_t)
Chris PeBenito 296273
userdom_read_user_tmp_symlinks(mencoder_t)
Chris PeBenito 296273
userdom_read_user_home_content_files(mencoder_t)
Chris PeBenito 296273
userdom_read_user_home_content_symlinks(mencoder_t)
Chris PeBenito 296273
Chris PeBenito 296273
# Read content to encode
Chris PeBenito 296273
ifndef(`enable_mls',`
Chris PeBenito 296273
	fs_search_removable(mencoder_t)
Chris PeBenito 296273
	fs_read_removable_files(mencoder_t)
Chris PeBenito 296273
	fs_read_removable_symlinks(mencoder_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
tunable_policy(`allow_execmem',`
Chris PeBenito 296273
	allow mencoder_t self:process execmem;
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
tunable_policy(`allow_execmod',`
Chris PeBenito 296273
	dev_execmod_zero(mencoder_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
tunable_policy(`allow_mplayer_execstack',`
Chris PeBenito 296273
	allow mencoder_t self:process { execmem execstack };
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
tunable_policy(`use_nfs_home_dirs',`
Chris PeBenito 296273
	fs_manage_nfs_dirs(mencoder_t)
Chris PeBenito 296273
	fs_manage_nfs_files(mencoder_t)
Chris PeBenito 296273
	fs_manage_nfs_symlinks(mencoder_t)
Chris PeBenito 296273
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
tunable_policy(`use_samba_home_dirs',`
Chris PeBenito 296273
	fs_manage_cifs_dirs(mencoder_t)
Chris PeBenito 296273
	fs_manage_cifs_files(mencoder_t)
Chris PeBenito 296273
	fs_manage_cifs_symlinks(mencoder_t)
Chris PeBenito 296273
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
# Read content to encode
Chris PeBenito 296273
tunable_policy(`use_nfs_home_dirs',`
Chris PeBenito 296273
	fs_list_auto_mountpoints(mencoder_t)
Chris PeBenito 296273
	files_list_home(mencoder_t)
Chris PeBenito 296273
	fs_read_nfs_files(mencoder_t)
Chris PeBenito 296273
	fs_read_nfs_symlinks(mencoder_t)
Chris PeBenito 296273
Chris PeBenito 296273
',`
Chris PeBenito 296273
	files_dontaudit_list_home(mencoder_t)
Chris PeBenito 296273
	fs_dontaudit_list_auto_mountpoints(mencoder_t)
Chris PeBenito 296273
	fs_dontaudit_read_nfs_files(mencoder_t)
Chris PeBenito 296273
	fs_dontaudit_list_nfs(mencoder_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
tunable_policy(`use_samba_home_dirs',`
Chris PeBenito 296273
	fs_list_auto_mountpoints(mencoder_t)
Chris PeBenito 296273
	files_list_home(mencoder_t)
Chris PeBenito 296273
	fs_read_cifs_files(mencoder_t)
Chris PeBenito 296273
	fs_read_cifs_symlinks(mencoder_t)
Chris PeBenito 296273
',`
Chris PeBenito 296273
	files_dontaudit_list_home(mencoder_t)
Chris PeBenito 296273
	fs_dontaudit_list_auto_mountpoints(mencoder_t)
Chris PeBenito 296273
	fs_dontaudit_read_cifs_files(mencoder_t)
Chris PeBenito 296273
	fs_dontaudit_list_cifs(mencoder_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
########################################
Chris PeBenito 296273
#
Chris PeBenito 296273
# mplayer local policy
Chris PeBenito 296273
#
Chris PeBenito 296273
Chris PeBenito 296273
allow mplayer_t self:process { signal_perms getsched };
Chris PeBenito 296273
allow mplayer_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 296273
allow mplayer_t self:sem create_sem_perms;
Chris PeBenito 8a2409
allow mplayer_t self:netlink_route_socket create_netlink_socket_perms;
Chris PeBenito 8a2409
allow mplayer_t self:tcp_socket create_socket_perms;
Chris PeBenito 8a2409
allow mplayer_t self:unix_dgram_socket sendto;
Chris PeBenito 296273
Chris PeBenito 296273
manage_dirs_pattern(mplayer_t, mplayer_home_t, mplayer_home_t)
Chris PeBenito 296273
manage_files_pattern(mplayer_t, mplayer_home_t, mplayer_home_t)
Chris PeBenito 296273
manage_lnk_files_pattern(mplayer_t, mplayer_home_t, mplayer_home_t)
Chris PeBenito 8a2409
userdom_user_home_dir_filetrans(mplayer_t, mplayer_home_t, dir)
Dan Walsh 3eaa99
userdom_search_user_home_dirs(mplayer_t)
Chris PeBenito 296273
Chris PeBenito 296273
manage_files_pattern(mplayer_t, mplayer_tmpfs_t, mplayer_tmpfs_t)
Chris PeBenito 296273
manage_lnk_files_pattern(mplayer_t, mplayer_tmpfs_t, mplayer_tmpfs_t)
Chris PeBenito 296273
manage_fifo_files_pattern(mplayer_t, mplayer_tmpfs_t, mplayer_tmpfs_t)
Chris PeBenito 296273
manage_sock_files_pattern(mplayer_t, mplayer_tmpfs_t, mplayer_tmpfs_t)
Chris PeBenito 296273
fs_tmpfs_filetrans(mplayer_t, mplayer_tmpfs_t,{ dir file lnk_file sock_file fifo_file })
Chris PeBenito 296273
Chris PeBenito 296273
# Read global config
Chris PeBenito 296273
allow mplayer_t mplayer_etc_t:dir list_dir_perms;
Chris PeBenito 296273
read_files_pattern(mplayer_t, mplayer_etc_t, mplayer_etc_t)
Chris PeBenito 296273
read_lnk_files_pattern(mplayer_t, mplayer_etc_t, mplayer_etc_t)
Chris PeBenito 296273
Chris PeBenito 296273
kernel_dontaudit_list_unlabeled(mplayer_t)
Chris PeBenito 296273
kernel_dontaudit_getattr_unlabeled_files(mplayer_t)
Chris PeBenito 296273
kernel_dontaudit_read_unlabeled_files(mplayer_t)
Chris PeBenito 296273
# Necessary for /proc/meminfo, /proc/cpuinfo, etc..
Chris PeBenito 296273
kernel_read_system_state(mplayer_t)
Chris PeBenito 296273
# Sysctl on kernel version 
Chris PeBenito 296273
kernel_read_kernel_sysctls(mplayer_t)
Chris PeBenito 296273
Chris PeBenito 8a2409
corenet_all_recvfrom_netlabel(mplayer_t)
Chris PeBenito 8a2409
corenet_all_recvfrom_unlabeled(mplayer_t)
Chris PeBenito 8a2409
corenet_tcp_sendrecv_generic_if(mplayer_t)
Chris PeBenito 8a2409
corenet_tcp_sendrecv_generic_node(mplayer_t)
Chris PeBenito 8a2409
corenet_tcp_bind_generic_node(mplayer_t)
Chris PeBenito 8a2409
corenet_tcp_connect_pulseaudio_port(mplayer_t)
Chris PeBenito 8a2409
corenet_sendrecv_pulseaudio_client_packets(mplayer_t)
Chris PeBenito 8a2409
Chris PeBenito 296273
# Run bash/sed (??) 
Chris PeBenito 296273
corecmd_exec_bin(mplayer_t)
Chris PeBenito 296273
corecmd_exec_shell(mplayer_t)
Chris PeBenito 296273
Chris PeBenito 8a2409
dev_read_rand(mplayer_t)
Chris PeBenito 8a2409
dev_read_urand(mplayer_t)
Chris PeBenito 296273
# Required for win32 binary loader 
Chris PeBenito 296273
dev_rwx_zero(mplayer_t)
Chris PeBenito 296273
# Access to DVD/CD/V4L
Chris PeBenito 296273
dev_read_video_dev(mplayer_t)
Chris PeBenito 296273
# Audio, alsa.conf
Chris PeBenito 296273
dev_read_sound_mixer(mplayer_t)
Chris PeBenito 296273
dev_write_sound_mixer(mplayer_t)
Chris PeBenito 296273
# RTC clock 
Chris PeBenito 296273
dev_read_realtime_clock(mplayer_t)
Chris PeBenito 296273
Chris PeBenito 296273
# Access to DVD/CD/V4L
Chris PeBenito 296273
storage_raw_read_removable_device(mplayer_t)
Chris PeBenito 296273
Chris PeBenito 296273
files_read_etc_files(mplayer_t)
Chris PeBenito 296273
files_dontaudit_list_non_security(mplayer_t)
Chris PeBenito 296273
files_dontaudit_getattr_non_security_files(mplayer_t)
Chris PeBenito 296273
files_read_non_security_files(mplayer_t)
Chris PeBenito 296273
# Unfortunately the ancient file dialog starts in /
Chris PeBenito 296273
files_list_home(mplayer_t)
Chris PeBenito 296273
# Read /etc/mtab
Chris PeBenito 296273
files_read_etc_runtime_files(mplayer_t)
Chris PeBenito 296273
# Read data in /usr/share (fonts, icons..)
Chris PeBenito 296273
files_read_usr_files(mplayer_t)
Chris PeBenito 296273
files_read_usr_symlinks(mplayer_t)
Chris PeBenito 296273
Chris PeBenito 296273
fs_dontaudit_getattr_all_fs(mplayer_t)
Chris PeBenito 296273
fs_search_auto_mountpoints(mplayer_t)
Chris PeBenito 296273
fs_list_inotifyfs(mplayer_t)
Chris PeBenito 296273
Dan Walsh 3eaa99
logging_send_syslog_msg(mplayer_t)
Dan Walsh 3eaa99
Chris PeBenito 296273
miscfiles_read_localization(mplayer_t)
Chris PeBenito 296273
miscfiles_read_fonts(mplayer_t)
Chris PeBenito 296273
Chris PeBenito 296273
userdom_use_user_terminals(mplayer_t)
Chris PeBenito 296273
# Read media files
Chris PeBenito 296273
userdom_list_user_tmp(mplayer_t)
Chris PeBenito 296273
userdom_read_user_tmp_files(mplayer_t)
Chris PeBenito 296273
userdom_read_user_tmp_symlinks(mplayer_t)
Chris PeBenito 296273
userdom_read_user_home_content_files(mplayer_t)
Chris PeBenito 296273
userdom_read_user_home_content_symlinks(mplayer_t)
Chris PeBenito 8a2409
userdom_write_user_tmp_sockets(mplayer_t)
Chris PeBenito 296273
Chris PeBenito 296273
xserver_user_x_domain_template(mplayer, mplayer_t, mplayer_tmpfs_t)
Chris PeBenito 296273
Chris PeBenito 296273
# Read songs
Chris PeBenito 296273
ifdef(`enable_mls',`',`
Chris PeBenito 296273
	fs_search_removable(mplayer_t)
Chris PeBenito 296273
	fs_read_removable_files(mplayer_t)
Chris PeBenito 296273
	fs_read_removable_symlinks(mplayer_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
tunable_policy(`allow_execmem',`
Chris PeBenito 296273
	allow mplayer_t self:process execmem;
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
tunable_policy(`allow_execmod',`
Chris PeBenito 296273
	dev_execmod_zero(mplayer_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
tunable_policy(`allow_mplayer_execstack',`
Chris PeBenito 296273
	allow mplayer_t self:process { execmem execstack };
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
tunable_policy(`use_nfs_home_dirs',`
Chris PeBenito 296273
	fs_manage_nfs_dirs(mplayer_t)
Chris PeBenito 296273
	fs_manage_nfs_files(mplayer_t)
Chris PeBenito 296273
	fs_manage_nfs_symlinks(mplayer_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
tunable_policy(`use_samba_home_dirs',`
Chris PeBenito 296273
	fs_manage_cifs_dirs(mplayer_t)
Chris PeBenito 296273
	fs_manage_cifs_files(mplayer_t)
Chris PeBenito 296273
	fs_manage_cifs_symlinks(mplayer_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
# Legacy domain issues
Chris PeBenito 296273
tunable_policy(`allow_mplayer_execstack',`
Chris PeBenito 296273
	allow mplayer_t mplayer_tmpfs_t:file execute;
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
# Read songs
Chris PeBenito 296273
tunable_policy(`use_nfs_home_dirs',`
Chris PeBenito 296273
	fs_list_auto_mountpoints(mplayer_t)
Chris PeBenito 296273
	files_list_home(mplayer_t)
Chris PeBenito 296273
	fs_read_nfs_files(mplayer_t)
Chris PeBenito 296273
	fs_read_nfs_symlinks(mplayer_t)
Chris PeBenito 296273
Chris PeBenito 296273
',`
Chris PeBenito 296273
	files_dontaudit_list_home(mplayer_t)
Chris PeBenito 296273
	fs_dontaudit_list_auto_mountpoints(mplayer_t)
Chris PeBenito 296273
	fs_dontaudit_read_nfs_files(mplayer_t)
Chris PeBenito 296273
	fs_dontaudit_list_nfs(mplayer_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
tunable_policy(`use_samba_home_dirs',`
Chris PeBenito 296273
	fs_list_auto_mountpoints(mplayer_t)
Chris PeBenito 296273
	files_list_home(mplayer_t)
Chris PeBenito 296273
	fs_read_cifs_files(mplayer_t)
Chris PeBenito 296273
	fs_read_cifs_symlinks(mplayer_t)
Chris PeBenito 296273
',`
Chris PeBenito 296273
	files_dontaudit_list_home(mplayer_t)
Chris PeBenito 296273
	fs_dontaudit_list_auto_mountpoints(mplayer_t)
Chris PeBenito 296273
	fs_dontaudit_read_cifs_files(mplayer_t)
Chris PeBenito 296273
	fs_dontaudit_list_cifs(mplayer_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
optional_policy(`
Chris PeBenito 296273
	alsa_read_rw_config(mplayer_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
optional_policy(`
Dan Walsh 3eaa99
	gnome_setattr_config_dirs(mplayer_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
optional_policy(`
Chris PeBenito 296273
	nscd_socket_use(mplayer_t)
Chris PeBenito 296273
')
Chris PeBenito 8a2409
Chris PeBenito 8a2409
optional_policy(`
Chris PeBenito 8a2409
	pulseaudio_exec(mplayer_t)
Chris PeBenito 8a2409
	pulseaudio_stream_connect(mplayer_t)
Chris PeBenito 8a2409
')