selinux-policy/policy/modules/apps/vmware.te

251 lines
8.3 KiB
Plaintext
Raw Normal View History

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