2006-04-26 18:18:15 +00:00
|
|
|
## <summary>VMWare Workstation virtual machines</summary>
|
|
|
|
|
2006-04-26 19:24:38 +00:00
|
|
|
#######################################
|
|
|
|
## <summary>
|
2006-09-06 22:07:25 +00:00
|
|
|
## The per role template for the vmware module.
|
2006-04-26 19:24:38 +00:00
|
|
|
## </summary>
|
|
|
|
## <desc>
|
|
|
|
## <p>
|
2006-04-26 20:30:08 +00:00
|
|
|
## This template creates a derived domain which is used
|
2006-04-26 19:24:38 +00:00
|
|
|
## for vmware sessions.
|
|
|
|
## </p>
|
|
|
|
## <p>
|
|
|
|
## This template is invoked automatically for each user, and
|
|
|
|
## generally does not need to be invoked directly
|
|
|
|
## by policy writers.
|
|
|
|
## </p>
|
|
|
|
## </desc>
|
|
|
|
## <param name="userdomain_prefix">
|
|
|
|
## <summary>
|
|
|
|
## The prefix of the user domain (e.g., user
|
|
|
|
## is the prefix for user_t).
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="user_domain">
|
|
|
|
## <summary>
|
|
|
|
## The type of the user domain.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="user_role">
|
|
|
|
## <summary>
|
|
|
|
## The role associated with the user domain.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
2006-09-06 22:07:25 +00:00
|
|
|
template(`vmware_per_role_template',`
|
2007-02-16 23:01:42 +00:00
|
|
|
gen_require(`
|
|
|
|
type vmware_exec_t, vmware_sys_conf_t;
|
|
|
|
')
|
2006-04-26 18:18:15 +00:00
|
|
|
|
|
|
|
##############################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
|
|
|
type $1_vmware_t;
|
|
|
|
domain_type($1_vmware_t)
|
|
|
|
domain_entry_file($1_vmware_t,vmware_exec_t)
|
|
|
|
role $3 types $1_vmware_t;
|
|
|
|
|
|
|
|
type $1_vmware_conf_t;
|
|
|
|
userdom_user_home_content($1,$1_vmware_conf_t)
|
|
|
|
|
|
|
|
type $1_vmware_file_t;
|
|
|
|
userdom_user_home_content($1,$1_vmware_file_t)
|
|
|
|
|
|
|
|
type $1_vmware_tmp_t;
|
|
|
|
files_tmp_file($1_vmware_tmp_t)
|
|
|
|
|
|
|
|
type $1_vmware_tmpfs_t;
|
|
|
|
files_tmpfs_file($1_vmware_tmpfs_t)
|
|
|
|
|
|
|
|
type $1_vmware_var_run_t;
|
|
|
|
files_pid_file($1_vmware_var_run_t)
|
|
|
|
|
|
|
|
##############################
|
|
|
|
#
|
|
|
|
# Local policy
|
|
|
|
#
|
|
|
|
|
2006-04-26 20:30:08 +00:00
|
|
|
allow $1_vmware_t self:capability { dac_override setgid sys_nice sys_resource setuid sys_admin sys_rawio chown };
|
|
|
|
dontaudit $1_vmware_t self:capability sys_tty_config;
|
2006-04-26 18:18:15 +00:00
|
|
|
allow $1_vmware_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
|
2006-04-26 20:30:08 +00:00
|
|
|
allow $1_vmware_t self:process { execmem execstack };
|
2006-04-26 18:18:15 +00:00
|
|
|
allow $1_vmware_t self:fd use;
|
2006-12-12 20:08:08 +00:00
|
|
|
allow $1_vmware_t self:fifo_file rw_fifo_file_perms;
|
2006-04-26 18:18:15 +00:00
|
|
|
allow $1_vmware_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow $1_vmware_t self:unix_stream_socket create_stream_socket_perms;
|
|
|
|
allow $1_vmware_t self:unix_dgram_socket sendto;
|
|
|
|
allow $1_vmware_t self:unix_stream_socket connectto;
|
|
|
|
allow $1_vmware_t self:shm create_shm_perms;
|
|
|
|
allow $1_vmware_t self:sem create_sem_perms;
|
|
|
|
allow $1_vmware_t self:msgq create_msgq_perms;
|
|
|
|
allow $1_vmware_t self:msg { send receive };
|
|
|
|
|
|
|
|
can_exec($1_vmware_t, vmware_exec_t)
|
|
|
|
|
|
|
|
# User configuration files
|
|
|
|
allow $1_vmware_t $1_vmware_conf_t:file manage_file_perms;
|
|
|
|
|
|
|
|
# VMWare disks
|
2006-12-12 20:08:08 +00:00
|
|
|
manage_files_pattern($1_vmware_t,$1_vmware_file_t,$1_vmware_file_t)
|
|
|
|
manage_lnk_files_pattern($1_vmware_t,$1_vmware_file_t,$1_vmware_file_t)
|
2006-04-26 18:18:15 +00:00
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow $1_vmware_t $1_vmware_tmp_t:file execute;
|
|
|
|
manage_dirs_pattern($1_vmware_t,$1_vmware_tmp_t,$1_vmware_tmp_t)
|
|
|
|
manage_files_pattern($1_vmware_t,$1_vmware_tmp_t,$1_vmware_tmp_t)
|
|
|
|
manage_sock_files_pattern($1_vmware_t,$1_vmware_tmp_t,$1_vmware_tmp_t)
|
2006-04-26 18:18:15 +00:00
|
|
|
files_tmp_filetrans($1_vmware_t, $1_vmware_tmp_t, { file dir })
|
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
manage_files_pattern($1_vmware_t,$1_vmware_tmpfs_t,$1_vmware_tmpfs_t)
|
|
|
|
manage_lnk_files_pattern($1_vmware_t,$1_vmware_tmpfs_t,$1_vmware_tmpfs_t)
|
|
|
|
manage_fifo_files_pattern($1_vmware_t,$1_vmware_tmpfs_t,$1_vmware_tmpfs_t)
|
|
|
|
manage_sock_files_pattern($1_vmware_t,$1_vmware_tmpfs_t,$1_vmware_tmpfs_t)
|
2006-04-26 18:18:15 +00:00
|
|
|
fs_tmpfs_filetrans($1_vmware_t,$1_vmware_tmpfs_t,{ dir file lnk_file sock_file fifo_file })
|
|
|
|
|
|
|
|
# Read clobal configuration files
|
2006-12-12 20:08:08 +00:00
|
|
|
allow $1_vmware_t vmware_sys_conf_t:dir list_dir_perms;
|
|
|
|
read_files_pattern($1_vmware_t,vmware_sys_conf_t,vmware_sys_conf_t)
|
|
|
|
read_lnk_files_pattern($1_vmware_t,vmware_sys_conf_t,vmware_sys_conf_t)
|
|
|
|
|
|
|
|
manage_dirs_pattern($1_vmware_t,$1_vmware_var_run_t,$1_vmware_var_run_t)
|
|
|
|
manage_files_pattern($1_vmware_t,$1_vmware_var_run_t,$1_vmware_var_run_t)
|
|
|
|
manage_lnk_files_pattern($1_vmware_t,$1_vmware_var_run_t,$1_vmware_var_run_t)
|
|
|
|
manage_sock_files_pattern($1_vmware_t,$1_vmware_var_run_t,$1_vmware_var_run_t)
|
2006-04-26 20:30:08 +00:00
|
|
|
files_pid_filetrans($1_vmware_t,$1_vmware_var_run_t,{ dir file lnk_file })
|
2006-04-26 18:18:15 +00:00
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
domtrans_pattern($2, vmware_exec_t, $1_vmware_t)
|
|
|
|
|
2006-04-26 18:18:15 +00:00
|
|
|
kernel_read_system_state($1_vmware_t)
|
|
|
|
kernel_read_network_state($1_vmware_t)
|
2006-04-26 20:30:08 +00:00
|
|
|
kernel_read_kernel_sysctls($1_vmware_t)
|
2006-04-26 18:18:15 +00:00
|
|
|
|
2006-04-26 20:30:08 +00:00
|
|
|
# startup scripts
|
|
|
|
corecmd_exec_bin($1_vmware_t)
|
|
|
|
corecmd_exec_shell($1_vmware_t)
|
2006-04-26 18:18:15 +00:00
|
|
|
|
|
|
|
dev_read_raw_memory($1_vmware_t)
|
|
|
|
dev_write_raw_memory($1_vmware_t)
|
|
|
|
dev_read_mouse($1_vmware_t)
|
|
|
|
dev_write_sound($1_vmware_t)
|
|
|
|
dev_read_realtime_clock($1_vmware_t)
|
2006-04-26 20:30:08 +00:00
|
|
|
dev_rwx_vmware($1_vmware_t)
|
|
|
|
dev_rw_usbfs($1_vmware_t)
|
|
|
|
dev_search_sysfs($1_vmware_t)
|
2006-04-26 18:18:15 +00:00
|
|
|
|
|
|
|
domain_use_interactive_fds($1_vmware_t)
|
|
|
|
|
|
|
|
files_read_etc_files($1_vmware_t)
|
|
|
|
files_read_etc_runtime_files($1_vmware_t)
|
2006-04-26 20:30:08 +00:00
|
|
|
files_read_usr_files($1_vmware_t)
|
2006-05-09 20:13:25 +00:00
|
|
|
files_list_home($1_vmware_t)
|
2006-04-26 18:18:15 +00:00
|
|
|
|
|
|
|
fs_getattr_xattr_fs($1_vmware_t)
|
|
|
|
fs_search_auto_mountpoints($1_vmware_t)
|
|
|
|
|
|
|
|
storage_raw_read_removable_device($1_vmware_t)
|
2006-04-26 20:30:08 +00:00
|
|
|
storage_raw_write_removable_device($1_vmware_t)
|
2006-04-26 18:18:15 +00:00
|
|
|
|
|
|
|
libs_use_ld_so($1_vmware_t)
|
|
|
|
libs_use_shared_libs($1_vmware_t)
|
2006-04-26 20:30:08 +00:00
|
|
|
# startup scripts run ldd
|
|
|
|
libs_exec_ld_so($1_vmware_t)
|
2006-04-26 18:18:15 +00:00
|
|
|
# Access X11 config files
|
|
|
|
libs_read_lib_files($1_vmware_t)
|
|
|
|
|
2006-04-26 20:30:08 +00:00
|
|
|
miscfiles_read_localization($1_vmware_t)
|
|
|
|
|
2006-04-26 18:18:15 +00:00
|
|
|
userdom_use_user_terminals($1,$1_vmware_t)
|
|
|
|
userdom_use_unpriv_users_fds($1_vmware_t)
|
2006-05-09 20:13:25 +00:00
|
|
|
userdom_list_user_home_dirs($1,$1_vmware_t)
|
2006-04-26 18:18:15 +00:00
|
|
|
# cjp: why?
|
|
|
|
userdom_read_user_home_content_files($1,$1_vmware_t)
|
|
|
|
|
2006-04-26 20:30:08 +00:00
|
|
|
sysnet_dns_name_resolve($1_vmware_t)
|
|
|
|
sysnet_read_config($1_vmware_t)
|
|
|
|
|
2008-04-01 20:23:23 +00:00
|
|
|
xserver_user_x_domain_template($1,$1_vmware,$1_vmware_t,$1_vmware_tmpfs_t)
|
2006-04-26 18:18:15 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read VMWare system configuration files.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`vmware_read_system_config',`
|
|
|
|
gen_require(`
|
|
|
|
type vmware_sys_conf_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 vmware_sys_conf_t:file { getattr read };
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Append to VMWare system configuration files.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`vmware_append_system_config',`
|
|
|
|
gen_require(`
|
|
|
|
type vmware_sys_conf_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 vmware_sys_conf_t:file append;
|
|
|
|
')
|
2008-06-18 15:35:49 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Append to VMWare log files.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`vmware_append_log',`
|
|
|
|
gen_require(`
|
|
|
|
type vmware_log_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
logging_search_logs($1)
|
|
|
|
append_files_pattern($1, vmware_log_t, vmware_log_t)
|
|
|
|
')
|