Chris PeBenito 17de1b
Chris PeBenito c12621
policy_module(vmware, 2.0.1)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# VMWare user program
Chris PeBenito 296273
type vmware_t;
Chris PeBenito 17de1b
type vmware_exec_t;
Chris PeBenito 296273
typealias vmware_t alias { user_vmware_t staff_vmware_t sysadm_vmware_t };
Chris PeBenito 296273
typealias vmware_t alias { auditadm_vmware_t secadm_vmware_t };
Chris PeBenito 296273
application_domain(vmware_t, vmware_exec_t)
Chris PeBenito 296273
ubac_constrained(vmware_t)
Chris PeBenito 296273
Chris PeBenito 296273
type vmware_conf_t;
Chris PeBenito 296273
typealias vmware_conf_t alias { user_vmware_conf_t staff_vmware_conf_t sysadm_vmware_conf_t };
Chris PeBenito 296273
typealias vmware_conf_t alias { auditadm_vmware_conf_t secadm_vmware_conf_t };
Chris PeBenito 296273
userdom_user_home_content(vmware_conf_t)
Chris PeBenito 296273
Chris PeBenito 296273
type vmware_file_t;
Chris PeBenito 296273
typealias vmware_file_t alias { user_vmware_file_t staff_vmware_file_t sysadm_vmware_file_t };
Chris PeBenito 296273
typealias vmware_file_t alias { auditadm_vmware_file_t secadm_vmware_file_t };
Chris PeBenito 296273
userdom_user_home_content(vmware_file_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# VMWare host programs
Chris PeBenito 17de1b
type vmware_host_t;
Chris PeBenito 17de1b
type vmware_host_exec_t;
Chris PeBenito 0bfccd
init_daemon_domain(vmware_host_t, vmware_host_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 296273
type vmware_host_pid_t alias vmware_var_run_t;
Chris PeBenito 296273
files_pid_file(vmware_host_pid_t)
Chris PeBenito 296273
Chris PeBenito a713ad
type vmware_log_t;
Chris PeBenito 296273
typealias vmware_log_t alias { user_vmware_log_t staff_vmware_log_t sysadm_vmware_log_t };
Chris PeBenito 296273
typealias vmware_log_t alias { auditadm_vmware_log_t secadm_vmware_log_t };
Chris PeBenito a713ad
logging_log_file(vmware_log_t)
Chris PeBenito 296273
ubac_constrained(vmware_log_t)
Chris PeBenito 296273
Chris PeBenito 296273
type vmware_pid_t;
Chris PeBenito 296273
typealias vmware_pid_t alias { user_vmware_pid_t staff_vmware_pid_t sysadm_vmware_pid_t };
Chris PeBenito 296273
typealias vmware_pid_t alias { auditadm_vmware_pid_t secadm_vmware_pid_t };
Chris PeBenito 296273
files_pid_file(vmware_pid_t)
Chris PeBenito 296273
ubac_constrained(vmware_pid_t)
Chris PeBenito a713ad
Chris PeBenito 17de1b
# Systemwide configuration files
Chris PeBenito 17de1b
type vmware_sys_conf_t;
Chris PeBenito 17de1b
files_type(vmware_sys_conf_t)
Chris PeBenito 17de1b
Chris PeBenito 296273
type vmware_tmp_t;
Chris PeBenito 296273
typealias vmware_tmp_t alias { user_vmware_tmp_t staff_vmware_tmp_t sysadm_vmware_tmp_t };
Chris PeBenito 296273
typealias vmware_tmp_t alias { auditadm_vmware_tmp_t secadm_vmware_tmp_t };
Chris PeBenito 296273
files_tmp_file(vmware_tmp_t)
Chris PeBenito 296273
ubac_constrained(vmware_tmp_t)
Chris PeBenito 296273
Chris PeBenito 296273
type vmware_tmpfs_t;
Chris PeBenito 296273
typealias vmware_tmpfs_t alias { user_vmware_tmpfs_t staff_vmware_tmpfs_t sysadm_vmware_tmpfs_t };
Chris PeBenito 296273
typealias vmware_tmpfs_t alias { auditadm_vmware_tmpfs_t secadm_vmware_tmpfs_t };
Chris PeBenito 296273
files_tmpfs_file(vmware_tmpfs_t)
Chris PeBenito 296273
ubac_constrained(vmware_tmpfs_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# VMWare host local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito a713ad
allow vmware_host_t self:capability { setgid setuid net_raw };
Chris PeBenito 17de1b
dontaudit vmware_host_t self:capability sys_tty_config;
Chris PeBenito 17de1b
allow vmware_host_t self:process signal_perms;
Chris PeBenito c0868a
allow vmware_host_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 17de1b
allow vmware_host_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow vmware_host_t self:rawip_socket create_socket_perms;
Chris PeBenito a713ad
allow vmware_host_t self:tcp_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# cjp: the ro and rw files should be split up
Chris PeBenito 0bfccd
manage_files_pattern(vmware_host_t, vmware_sys_conf_t, vmware_sys_conf_t)
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
manage_files_pattern(vmware_host_t, vmware_var_run_t, vmware_var_run_t)
Chris PeBenito 0bfccd
manage_sock_files_pattern(vmware_host_t, vmware_var_run_t, vmware_var_run_t)
Chris PeBenito 0bfccd
files_pid_filetrans(vmware_host_t, vmware_var_run_t, { file sock_file })
Chris PeBenito 17de1b
Chris PeBenito a713ad
manage_files_pattern(vmware_host_t, vmware_log_t, vmware_log_t)	
Chris PeBenito a713ad
logging_log_filetrans(vmware_host_t, vmware_log_t, { file dir })
Chris PeBenito a713ad
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(vmware_host_t)
Chris PeBenito 17de1b
kernel_list_proc(vmware_host_t)
Chris PeBenito 17de1b
kernel_read_proc_symlinks(vmware_host_t)
Chris PeBenito 17de1b
Chris PeBenito 190066
corenet_all_recvfrom_unlabeled(vmware_host_t)
Chris PeBenito 190066
corenet_all_recvfrom_netlabel(vmware_host_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_generic_if(vmware_host_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_generic_if(vmware_host_t)
Chris PeBenito 17de1b
corenet_raw_sendrecv_generic_if(vmware_host_t)
Chris PeBenito c12621
corenet_tcp_sendrecv_generic_node(vmware_host_t)
Chris PeBenito c12621
corenet_udp_sendrecv_generic_node(vmware_host_t)
Chris PeBenito c12621
corenet_raw_sendrecv_generic_node(vmware_host_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_ports(vmware_host_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_ports(vmware_host_t)
Chris PeBenito c12621
corenet_raw_bind_generic_node(vmware_host_t)
Chris PeBenito c12621
corenet_tcp_bind_generic_node(vmware_host_t)
Chris PeBenito c12621
corenet_udp_bind_generic_node(vmware_host_t)
Chris PeBenito 17de1b
corenet_tcp_connect_all_ports(vmware_host_t)
Chris PeBenito 17de1b
corenet_sendrecv_all_client_packets(vmware_host_t)
Chris PeBenito 17de1b
corenet_sendrecv_all_server_packets(vmware_host_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_sysfs(vmware_host_t)
Chris PeBenito a713ad
dev_read_urand(vmware_host_t)
Chris PeBenito 17de1b
dev_rw_vmware(vmware_host_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_use_interactive_fds(vmware_host_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_read_etc_files(vmware_host_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
fs_getattr_all_fs(vmware_host_t)
Chris PeBenito 17de1b
fs_search_auto_mountpoints(vmware_host_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
term_dontaudit_use_console(vmware_host_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
init_use_fds(vmware_host_t)
Chris PeBenito 17de1b
init_use_script_ptys(vmware_host_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_send_syslog_msg(vmware_host_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(vmware_host_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
sysnet_dns_name_resolve(vmware_host_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
userdom_dontaudit_use_unpriv_user_fds(vmware_host_t)
Chris PeBenito 296273
userdom_dontaudit_search_user_home_dirs(vmware_host_t)
Chris PeBenito 17de1b
Chris PeBenito a713ad
netutils_domtrans_ping(vmware_host_t)
Chris PeBenito a713ad
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	seutil_sigchld_newrole(vmware_host_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	udev_read_db(vmware_host_t)
Chris PeBenito 17de1b
')
Chris PeBenito 296273
Chris PeBenito 296273
ifdef(`TODO',`
Chris PeBenito 296273
# VMWare need access to pcmcia devices for network
Chris PeBenito 296273
optional_policy(`
Chris PeBenito 296273
allow kernel_t cardmgr_var_lib_t:dir { getattr search };
Chris PeBenito 296273
allow kernel_t cardmgr_var_lib_t:file { getattr ioctl read };
Chris PeBenito 296273
')
Chris PeBenito 296273
# Vmware create network devices
Chris PeBenito 296273
allow kernel_t self:capability net_admin;
Chris PeBenito 296273
allow kernel_t self:netlink_route_socket { bind create getattr nlmsg_read nlmsg_write read write };
Chris PeBenito 296273
allow kernel_t self:socket create;
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
##############################
Chris PeBenito 296273
#
Chris PeBenito 296273
# VMWare guest local policy
Chris PeBenito 296273
#
Chris PeBenito 296273
Chris PeBenito 296273
allow vmware_t self:capability { dac_override setgid sys_nice sys_resource setuid sys_admin sys_rawio chown };
Chris PeBenito 296273
dontaudit vmware_t self:capability sys_tty_config;
Chris PeBenito 296273
allow vmware_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
Chris PeBenito 296273
allow vmware_t self:process { execmem execstack };
Chris PeBenito 296273
allow vmware_t self:fd use;
Chris PeBenito 296273
allow vmware_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 296273
allow vmware_t self:unix_dgram_socket { create_socket_perms sendto };
Chris PeBenito 296273
allow vmware_t self:unix_stream_socket { create_stream_socket_perms connectto };
Chris PeBenito 296273
allow vmware_t self:shm create_shm_perms;
Chris PeBenito 296273
allow vmware_t self:sem create_sem_perms;
Chris PeBenito 296273
allow vmware_t self:msgq create_msgq_perms;
Chris PeBenito 296273
allow vmware_t self:msg { send receive };
Chris PeBenito 296273
Chris PeBenito 296273
can_exec(vmware_t, vmware_exec_t)
Chris PeBenito 296273
Chris PeBenito 296273
# User configuration files
Chris PeBenito 296273
allow vmware_t vmware_conf_t:file manage_file_perms;
Chris PeBenito 296273
Chris PeBenito 296273
# VMWare disks
Chris PeBenito 296273
manage_files_pattern(vmware_t, vmware_file_t, vmware_file_t)
Chris PeBenito 296273
manage_lnk_files_pattern(vmware_t, vmware_file_t, vmware_file_t)
Chris PeBenito 296273
Chris PeBenito 296273
allow vmware_t vmware_tmp_t:file execute;
Chris PeBenito 296273
manage_dirs_pattern(vmware_t, vmware_tmp_t, vmware_tmp_t)
Chris PeBenito 296273
manage_files_pattern(vmware_t, vmware_tmp_t, vmware_tmp_t)
Chris PeBenito 296273
manage_sock_files_pattern(vmware_t, vmware_tmp_t, vmware_tmp_t)
Chris PeBenito 296273
files_tmp_filetrans(vmware_t, vmware_tmp_t, { file dir })
Chris PeBenito 296273
Chris PeBenito 296273
manage_files_pattern(vmware_t, vmware_tmpfs_t, vmware_tmpfs_t)
Chris PeBenito 296273
manage_lnk_files_pattern(vmware_t, vmware_tmpfs_t, vmware_tmpfs_t)
Chris PeBenito 296273
manage_fifo_files_pattern(vmware_t, vmware_tmpfs_t, vmware_tmpfs_t)
Chris PeBenito 296273
manage_sock_files_pattern(vmware_t, vmware_tmpfs_t, vmware_tmpfs_t)
Chris PeBenito 296273
fs_tmpfs_filetrans(vmware_t, vmware_tmpfs_t, { dir file lnk_file sock_file fifo_file })
Chris PeBenito 296273
Chris PeBenito 296273
# Read clobal configuration files
Chris PeBenito 296273
allow vmware_t vmware_sys_conf_t:dir list_dir_perms;
Chris PeBenito 296273
read_files_pattern(vmware_t, vmware_sys_conf_t, vmware_sys_conf_t)
Chris PeBenito 296273
read_lnk_files_pattern(vmware_t, vmware_sys_conf_t, vmware_sys_conf_t)
Chris PeBenito 296273
Chris PeBenito 296273
manage_dirs_pattern(vmware_t, vmware_pid_t, vmware_pid_t)
Chris PeBenito 296273
manage_files_pattern(vmware_t, vmware_pid_t, vmware_pid_t)
Chris PeBenito 296273
manage_lnk_files_pattern(vmware_t, vmware_pid_t, vmware_pid_t)
Chris PeBenito 296273
manage_sock_files_pattern(vmware_t, vmware_pid_t, vmware_pid_t)
Chris PeBenito 296273
files_pid_filetrans(vmware_t, vmware_pid_t, { dir file lnk_file })
Chris PeBenito 296273
Chris PeBenito 296273
kernel_read_system_state(vmware_t)
Chris PeBenito 296273
kernel_read_network_state(vmware_t)
Chris PeBenito 296273
kernel_read_kernel_sysctls(vmware_t)
Chris PeBenito 296273
Chris PeBenito 296273
# startup scripts
Chris PeBenito 296273
corecmd_exec_bin(vmware_t)
Chris PeBenito 296273
corecmd_exec_shell(vmware_t)
Chris PeBenito 296273
Chris PeBenito 296273
dev_read_raw_memory(vmware_t)
Chris PeBenito 296273
dev_write_raw_memory(vmware_t)
Chris PeBenito 296273
dev_read_mouse(vmware_t)
Chris PeBenito 296273
dev_write_sound(vmware_t)
Chris PeBenito 296273
dev_read_realtime_clock(vmware_t)
Chris PeBenito 296273
dev_rwx_vmware(vmware_t)
Chris PeBenito 296273
dev_rw_usbfs(vmware_t)
Chris PeBenito 296273
dev_search_sysfs(vmware_t)
Chris PeBenito 296273
Chris PeBenito 296273
domain_use_interactive_fds(vmware_t)
Chris PeBenito 296273
Chris PeBenito 296273
files_read_etc_files(vmware_t)
Chris PeBenito 296273
files_read_etc_runtime_files(vmware_t)
Chris PeBenito 296273
files_read_usr_files(vmware_t)
Chris PeBenito 296273
files_list_home(vmware_t)
Chris PeBenito 296273
Chris PeBenito 296273
fs_getattr_xattr_fs(vmware_t)
Chris PeBenito 296273
fs_search_auto_mountpoints(vmware_t)
Chris PeBenito 296273
Chris PeBenito 296273
storage_raw_read_removable_device(vmware_t)
Chris PeBenito 296273
storage_raw_write_removable_device(vmware_t)
Chris PeBenito 296273
Chris PeBenito 296273
# startup scripts run ldd
Chris PeBenito 296273
libs_exec_ld_so(vmware_t)
Chris PeBenito 296273
# Access X11 config files
Chris PeBenito 296273
libs_read_lib_files(vmware_t)
Chris PeBenito 296273
Chris PeBenito 296273
miscfiles_read_localization(vmware_t)
Chris PeBenito 296273
Chris PeBenito 296273
userdom_use_user_terminals(vmware_t)
Chris PeBenito 296273
userdom_list_user_home_dirs(vmware_t)
Chris PeBenito 296273
# cjp: why?
Chris PeBenito 296273
userdom_read_user_home_content_files(vmware_t)
Chris PeBenito 296273
Chris PeBenito 296273
sysnet_dns_name_resolve(vmware_t)
Chris PeBenito 296273
sysnet_read_config(vmware_t)
Chris PeBenito 296273
Chris PeBenito 296273
xserver_user_x_domain_template(vmware, vmware_t, vmware_tmpfs_t)