Chris PeBenito eb4216
Chris PeBenito fb4826
policy_module(virt, 1.0.2)
Chris PeBenito eb4216
Chris PeBenito eb4216
########################################
Chris PeBenito eb4216
#
Chris PeBenito eb4216
# Declarations
Chris PeBenito eb4216
#
Chris PeBenito eb4216
Chris PeBenito eb4216
## <desc>
Chris PeBenito eb4216
## 

Chris PeBenito eb4216
## Allow virt to manage nfs files
Chris PeBenito eb4216
## 

Chris PeBenito eb4216
## </desc>
Chris PeBenito eb4216
gen_tunable(virt_use_nfs, false)
Chris PeBenito eb4216
Chris PeBenito eb4216
## <desc>
Chris PeBenito eb4216
## 

Chris PeBenito eb4216
## Allow virt to manage cifs files
Chris PeBenito eb4216
## 

Chris PeBenito eb4216
## </desc>
Chris PeBenito eb4216
gen_tunable(virt_use_samba, false)
Chris PeBenito eb4216
Chris PeBenito fb4826
attribute virt_image_type;
Chris PeBenito fb4826
Chris PeBenito eb4216
type virt_etc_t;
Chris PeBenito eb4216
files_config_file(virt_etc_t)
Chris PeBenito eb4216
Chris PeBenito eb4216
type virt_etc_rw_t;
Chris PeBenito eb4216
files_type(virt_etc_rw_t)
Chris PeBenito eb4216
Chris PeBenito eb4216
# virt Image files
Chris PeBenito fb4826
type virt_image_t, virt_image_type; # customizable
Chris PeBenito fb4826
virt_image(virt_image_t)
Chris PeBenito eb4216
Chris PeBenito eb4216
type virt_log_t;
Chris PeBenito eb4216
logging_log_file(virt_log_t)
Chris PeBenito eb4216
Chris PeBenito eb4216
type virt_var_run_t;
Chris PeBenito eb4216
files_pid_file(virt_var_run_t)
Chris PeBenito eb4216
Chris PeBenito eb4216
type virt_var_lib_t;
Chris PeBenito eb4216
files_type(virt_var_lib_t)
Chris PeBenito eb4216
Chris PeBenito eb4216
type virtd_t;
Chris PeBenito eb4216
type virtd_exec_t;
Chris PeBenito eb4216
init_daemon_domain(virtd_t, virtd_exec_t)
Chris PeBenito eb4216
Chris PeBenito fb4826
type virtd_initrc_exec_t;
Chris PeBenito fb4826
init_script_file(virtd_initrc_exec_t)
Chris PeBenito fb4826
Chris PeBenito eb4216
########################################
Chris PeBenito eb4216
#
Chris PeBenito eb4216
# virtd local policy
Chris PeBenito eb4216
#
Chris PeBenito eb4216
Chris PeBenito eb4216
allow virtd_t self:capability { dac_override kill net_admin setgid sys_nice sys_ptrace };
Chris PeBenito fb4826
allow virtd_t self:process { getsched sigkill signal execmem };
Chris PeBenito eb4216
allow virtd_t self:fifo_file rw_file_perms;
Chris PeBenito eb4216
allow virtd_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito eb4216
allow virtd_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito eb4216
Chris PeBenito eb4216
read_files_pattern(virtd_t, virt_etc_t, virt_etc_t)
Chris PeBenito eb4216
read_lnk_files_pattern(virtd_t, virt_etc_t, virt_etc_t)
Chris PeBenito eb4216
Chris PeBenito eb4216
manage_dirs_pattern(virtd_t, virt_etc_rw_t, virt_etc_rw_t)
Chris PeBenito eb4216
manage_files_pattern(virtd_t, virt_etc_rw_t, virt_etc_rw_t)
Chris PeBenito eb4216
manage_lnk_files_pattern(virtd_t, virt_etc_rw_t, virt_etc_rw_t)
Chris PeBenito eb4216
filetrans_pattern(virtd_t, virt_etc_t, virt_etc_rw_t, dir)
Chris PeBenito eb4216
Chris PeBenito fb4826
manage_files_pattern(virtd_t, virt_image_type, virt_image_type)
Chris PeBenito eb4216
Chris PeBenito eb4216
manage_dirs_pattern(virtd_t, virt_log_t, virt_log_t)
Chris PeBenito eb4216
manage_files_pattern(virtd_t, virt_log_t, virt_log_t)
Chris PeBenito eb4216
logging_log_filetrans(virtd_t, virt_log_t, { file dir })
Chris PeBenito eb4216
Chris PeBenito eb4216
manage_dirs_pattern(virtd_t, virt_var_lib_t, virt_var_lib_t)
Chris PeBenito eb4216
manage_files_pattern(virtd_t, virt_var_lib_t, virt_var_lib_t)
Chris PeBenito eb4216
files_var_lib_filetrans(virtd_t, virt_var_lib_t, { file dir })
Chris PeBenito eb4216
Chris PeBenito eb4216
manage_dirs_pattern(virtd_t, virt_var_run_t, virt_var_run_t)
Chris PeBenito eb4216
manage_files_pattern(virtd_t, virt_var_run_t, virt_var_run_t)
Chris PeBenito eb4216
manage_sock_files_pattern(virtd_t, virt_var_run_t, virt_var_run_t)
Chris PeBenito eb4216
files_pid_filetrans(virtd_t, virt_var_run_t, { file dir })
Chris PeBenito eb4216
Chris PeBenito eb4216
kernel_read_system_state(virtd_t)
Chris PeBenito eb4216
kernel_read_network_state(virtd_t)
Chris PeBenito eb4216
kernel_rw_net_sysctls(virtd_t)
Chris PeBenito eb4216
kernel_load_module(virtd_t)
Chris PeBenito eb4216
Chris PeBenito eb4216
corecmd_exec_bin(virtd_t)
Chris PeBenito eb4216
corecmd_exec_shell(virtd_t)
Chris PeBenito eb4216
Chris PeBenito eb4216
corenet_all_recvfrom_unlabeled(virtd_t)
Chris PeBenito eb4216
corenet_all_recvfrom_netlabel(virtd_t)
Chris PeBenito eb4216
corenet_tcp_sendrecv_all_if(virtd_t)
Chris PeBenito eb4216
corenet_tcp_sendrecv_all_nodes(virtd_t)
Chris PeBenito eb4216
corenet_tcp_sendrecv_all_ports(virtd_t)
Chris PeBenito eb4216
corenet_tcp_bind_all_nodes(virtd_t)
Chris PeBenito eb4216
#corenet_tcp_bind_virt_port(virtd_t)
Chris PeBenito eb4216
corenet_tcp_bind_vnc_port(virtd_t)
Chris PeBenito eb4216
corenet_tcp_connect_vnc_port(virtd_t)
Chris PeBenito eb4216
corenet_tcp_connect_soundd_port(virtd_t)
Chris PeBenito eb4216
corenet_rw_tun_tap_dev(virtd_t)
Chris PeBenito eb4216
Chris PeBenito eb4216
dev_read_sysfs(virtd_t)
Chris PeBenito eb4216
dev_read_rand(virtd_t)
Chris PeBenito eb4216
Chris PeBenito eb4216
# Init script handling
Chris PeBenito eb4216
domain_use_interactive_fds(virtd_t)
Chris PeBenito eb4216
Chris PeBenito eb4216
files_read_usr_files(virtd_t)
Chris PeBenito eb4216
files_read_etc_files(virtd_t)
Chris PeBenito eb4216
files_read_etc_runtime_files(virtd_t)
Chris PeBenito eb4216
files_search_all(virtd_t)
Chris PeBenito fb4826
files_list_kernel_modules(virtd_t)
Chris PeBenito eb4216
Chris PeBenito eb4216
fs_list_auto_mountpoints(virtd_t)
Chris PeBenito eb4216
Chris PeBenito eb4216
storage_raw_write_removable_device(virtd_t)
Chris PeBenito eb4216
storage_raw_read_removable_device(virtd_t)
Chris PeBenito eb4216
Chris PeBenito eb4216
term_getattr_pty_fs(virtd_t)
Chris PeBenito eb4216
term_use_ptmx(virtd_t)
Chris PeBenito eb4216
Chris PeBenito eb4216
auth_use_nsswitch(virtd_t)
Chris PeBenito eb4216
Chris PeBenito eb4216
miscfiles_read_localization(virtd_t)
Chris PeBenito eb4216
miscfiles_read_certs(virtd_t)
Chris PeBenito eb4216
Chris PeBenito eb4216
logging_send_syslog_msg(virtd_t)
Chris PeBenito eb4216
Chris PeBenito eb4216
userdom_read_all_users_state(virtd_t)
Chris PeBenito eb4216
Chris PeBenito eb4216
tunable_policy(`virt_use_nfs',`
Chris PeBenito eb4216
	fs_manage_nfs_dirs(virtd_t)
Chris PeBenito eb4216
	fs_manage_nfs_files(virtd_t)
Chris PeBenito eb4216
	fs_read_nfs_symlinks(virtd_t)
Chris PeBenito eb4216
')
Chris PeBenito eb4216
Chris PeBenito eb4216
tunable_policy(`virt_use_samba',`
Chris PeBenito eb4216
	fs_manage_nfs_files(virtd_t)
Chris PeBenito eb4216
	fs_manage_cifs_files(virtd_t)
Chris PeBenito eb4216
	fs_read_cifs_symlinks(virtd_t)
Chris PeBenito eb4216
')
Chris PeBenito eb4216
Chris PeBenito eb4216
optional_policy(`
Chris PeBenito eb4216
	brctl_domtrans(virtd_t)
Chris PeBenito eb4216
')
Chris PeBenito eb4216
Chris PeBenito eb4216
optional_policy(`
Chris PeBenito 296273
	dbus_system_bus_client(virtd_t)
Chris PeBenito eb4216
Chris PeBenito eb4216
	optional_policy(`
Chris PeBenito eb4216
		avahi_dbus_chat(virtd_t)
Chris PeBenito eb4216
	')
Chris PeBenito eb4216
Chris PeBenito eb4216
	optional_policy(`
Chris PeBenito eb4216
		consolekit_dbus_chat(virtd_t)
Chris PeBenito eb4216
	')
Chris PeBenito eb4216
Chris PeBenito eb4216
	optional_policy(`
Chris PeBenito eb4216
		hal_dbus_chat(virtd_t)
Chris PeBenito eb4216
	')
Chris PeBenito eb4216
')
Chris PeBenito eb4216
Chris PeBenito fb4826
optional_policy(`
Chris PeBenito fb4826
	dnsmasq_domtrans(virtd_t)
Chris PeBenito fb4826
	dnsmasq_signal(virtd_t)
Chris PeBenito fb4826
	dnsmasq_kill(virtd_t)
Chris PeBenito fb4826
')
Chris PeBenito eb4216
Chris PeBenito eb4216
optional_policy(`
Chris PeBenito eb4216
	iptables_domtrans(virtd_t)
Chris PeBenito eb4216
')
Chris PeBenito eb4216
Chris PeBenito eb4216
#optional_policy(`
Chris PeBenito eb4216
#	polkit_domtrans_auth(virtd_t)
Chris PeBenito eb4216
#	polkit_domtrans_resolve(virtd_t)
Chris PeBenito eb4216
#')
Chris PeBenito eb4216
Chris PeBenito eb4216
optional_policy(`
Chris PeBenito eb4216
	qemu_domtrans(virtd_t)
Chris PeBenito eb4216
	qemu_read_state(virtd_t)
Chris PeBenito eb4216
	qemu_signal(virtd_t)
Chris PeBenito eb4216
	qemu_kill(virtd_t)
Chris PeBenito eb4216
')
Chris PeBenito eb4216
Chris PeBenito eb4216
optional_policy(`
Chris PeBenito eb4216
	sasl_connect(virtd_t)
Chris PeBenito eb4216
')
Chris PeBenito eb4216
Chris PeBenito eb4216
optional_policy(`
Chris PeBenito eb4216
	kernel_read_xen_state(virtd_t)
Chris PeBenito eb4216
	kernel_write_xen_state(virtd_t)
Chris PeBenito eb4216
Chris PeBenito eb4216
	xen_stream_connect(virtd_t)
Chris PeBenito eb4216
	xen_stream_connect_xenstore(virtd_t)
Chris PeBenito eb4216
')
Chris PeBenito fb4826
Chris PeBenito fb4826
optional_policy(`
Chris PeBenito fb4826
	unconfined_domain(virtd_t)
Chris PeBenito fb4826
')