Chris PeBenito 17de1b
## <summary>Xen hypervisor</summary>
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute a domain transition to run xend.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
## 	<summary>
Chris PeBenito 17de1b
##	Domain allowed to transition.
Chris PeBenito 17de1b
## 	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xen_domtrans',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xend_t, xend_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 3f67f7
	domtrans_pattern($1, xend_exec_t, xend_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito a5e213
########################################
Chris PeBenito a5e213
## <summary>
Chris PeBenito a5e213
##	Inherit and use xen file descriptors.
Chris PeBenito a5e213
## </summary>
Chris PeBenito a5e213
## <param name="domain">
Chris PeBenito a5e213
##	<summary>
Dominick Grift a0546c
##	Domain allowed access.
Chris PeBenito a5e213
##	</summary>
Chris PeBenito a5e213
## </param>
Chris PeBenito a5e213
#
Chris PeBenito a5e213
interface(`xen_use_fds',`
Chris PeBenito a5e213
	gen_require(`
Chris PeBenito a5e213
		type xend_t;
Chris PeBenito a5e213
	')
Chris PeBenito a5e213
Chris PeBenito a5e213
	allow $1 xend_t:fd use;
Chris PeBenito a5e213
')
Chris PeBenito a5e213
Chris PeBenito a5e213
########################################
Chris PeBenito a5e213
## <summary>
Chris PeBenito a5e213
##	Do not audit attempts to inherit
Chris PeBenito a5e213
##	xen file descriptors.
Chris PeBenito a5e213
## </summary>
Chris PeBenito a5e213
## <param name="domain">
Chris PeBenito a5e213
##	<summary>
Chris PeBenito a5e213
##	Domain to not audit.
Chris PeBenito a5e213
##	</summary>
Chris PeBenito a5e213
## </param>
Chris PeBenito a5e213
#
Chris PeBenito a5e213
interface(`xen_dontaudit_use_fds',`
Chris PeBenito a5e213
	gen_require(`
Chris PeBenito a5e213
		type xend_t;
Chris PeBenito a5e213
	')
Chris PeBenito a5e213
Chris PeBenito a5e213
	dontaudit $1 xend_t:fd use;
Chris PeBenito a5e213
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 7f0897
##	Read xend image files.
Chris PeBenito 7f0897
## </summary>
Chris PeBenito 7f0897
## <param name="domain">
Chris PeBenito 7f0897
## 	<summary>
Chris PeBenito 7f0897
##	Domain allowed access.
Chris PeBenito 7f0897
## 	</summary>
Chris PeBenito 7f0897
## </param>
Chris PeBenito 7f0897
#
Chris PeBenito 7f0897
interface(`xen_read_image_files',`
Chris PeBenito 7f0897
	gen_require(`
Chris PeBenito 7f0897
		type xen_image_t, xend_var_lib_t;
Chris PeBenito 7f0897
	')
Chris PeBenito 7f0897
Chris PeBenito 7f0897
	files_list_var_lib($1)
Chris PeBenito 77c71b
Chris PeBenito 77c71b
	list_dirs_pattern($1, xend_var_lib_t, xend_var_lib_t)
Chris PeBenito 77c71b
	read_files_pattern($1, { xend_var_lib_t xen_image_t }, xen_image_t)
Chris PeBenito 77c71b
')
Chris PeBenito 77c71b
Chris PeBenito 77c71b
########################################
Chris PeBenito 77c71b
## <summary>
Chris PeBenito 77c71b
##	Allow the specified domain to read/write
Chris PeBenito 77c71b
##	xend image files.
Chris PeBenito 77c71b
## </summary>
Chris PeBenito 77c71b
## <param name="domain">
Chris PeBenito 77c71b
## 	<summary>
Dominick Grift a0546c
##	Domain allowed access.
Chris PeBenito 77c71b
## 	</summary>
Chris PeBenito 77c71b
## </param>
Chris PeBenito 77c71b
#
Dan Walsh 3eaa99
interface(`xen_manage_image_dirs',`
Dan Walsh 3eaa99
	gen_require(`
Dan Walsh 3eaa99
		type xend_var_lib_t;
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	files_list_var_lib($1)
Dan Walsh 3eaa99
	manage_dirs_pattern($1, xend_var_lib_t, xend_var_lib_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
## <summary>
Dan Walsh 3eaa99
##	Allow the specified domain to read/write
Dan Walsh 3eaa99
##	xend image files.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dan Walsh 3eaa99
## 	<summary>
Dan Walsh 3eaa99
##	Domain allowed to transition.
Dan Walsh 3eaa99
## 	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
#
Chris PeBenito 77c71b
interface(`xen_rw_image_files',`
Chris PeBenito 77c71b
	gen_require(`
Chris PeBenito 77c71b
		type xen_image_t, xend_var_lib_t;
Chris PeBenito 77c71b
	')
Chris PeBenito 77c71b
Chris PeBenito 77c71b
	files_list_var_lib($1)
Chris PeBenito 77c71b
	allow $1 xend_var_lib_t:dir search_dir_perms;
Chris PeBenito 77c71b
	rw_files_pattern($1, xen_image_t, xen_image_t)
Chris PeBenito 7f0897
')
Chris PeBenito 7f0897
Chris PeBenito 7f0897
########################################
Chris PeBenito 7f0897
## <summary>
Chris PeBenito 17de1b
##	Allow the specified domain to append
Chris PeBenito 17de1b
##	xend log files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
## 	<summary>
Dominick Grift a0546c
##	Domain allowed access.
Chris PeBenito 17de1b
## 	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xen_append_log',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito b34db7
		type xend_var_log_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	logging_search_logs($1)
Chris PeBenito 3f67f7
	append_files_pattern($1, xend_var_log_t, xend_var_log_t)
Chris PeBenito 17de1b
	dontaudit $1 xend_var_log_t:file write;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 7f0897
##	Create, read, write, and delete the
Chris PeBenito 7f0897
##	xend log files.
Chris PeBenito 7f0897
## </summary>
Chris PeBenito 7f0897
## <param name="domain">
Chris PeBenito 7f0897
## 	<summary>
Chris PeBenito 7f0897
##	Domain allowed access.
Chris PeBenito 7f0897
## 	</summary>
Chris PeBenito 7f0897
## </param>
Chris PeBenito 7f0897
#
Chris PeBenito 7f0897
interface(`xen_manage_log',`
Chris PeBenito 7f0897
	gen_require(`
Chris PeBenito b34db7
		type xend_var_log_t;
Chris PeBenito 7f0897
	')
Chris PeBenito 7f0897
Chris PeBenito 7f0897
	logging_search_logs($1)
Chris PeBenito 3f67f7
	manage_dirs_pattern($1, xend_var_log_t, xend_var_log_t)
Chris PeBenito 3f67f7
	manage_files_pattern($1, xend_var_log_t, xend_var_log_t)
Chris PeBenito 7f0897
')
Chris PeBenito 7f0897
Chris PeBenito 7f0897
########################################
Chris PeBenito 7f0897
## <summary>
Chris PeBenito 17de1b
##	Do not audit attempts to read and write
Chris PeBenito 17de1b
##	Xen unix domain stream sockets.  These
Chris PeBenito 17de1b
##	are leaked file descriptors.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain to not audit.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xen_dontaudit_rw_unix_stream_sockets',`
Chris PeBenito 6073ea
	gen_require(`
Chris PeBenito 6073ea
		type xend_t;
Chris PeBenito 6073ea
	')
Chris PeBenito 17de1b
Chris PeBenito 3f67f7
	dontaudit $1 xend_t:unix_stream_socket { read write };
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Connect to xenstored over an unix stream socket.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xen_stream_connect_xenstore',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xenstored_t, xenstored_var_run_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_pids($1)
Chris PeBenito 3f67f7
	stream_connect_pattern($1, xenstored_var_run_t, xenstored_var_run_t, xenstored_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Connect to xend over an unix domain stream socket.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xen_stream_connect',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 77c71b
		type xend_t, xend_var_run_t, xend_var_lib_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_pids($1)
Chris PeBenito 3f67f7
	stream_connect_pattern($1, xend_var_run_t, xend_var_run_t, xend_t)
Chris PeBenito 77c71b
Chris PeBenito 77c71b
	files_search_var_lib($1)
Chris PeBenito 77c71b
	stream_connect_pattern($1, xend_var_lib_t, xend_var_lib_t, xend_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute a domain transition to run xm.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Domain allowed to transition.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`xen_domtrans_xm',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type xm_t, xm_exec_t;
Dan Walsh 3eaa99
		attribute virsh_transition_domain;
Chris PeBenito 17de1b
	')
Dan Walsh 3eaa99
	typeattribute $1 virsh_transition_domain;
Chris PeBenito 3f67f7
	domtrans_pattern($1, xm_exec_t, xm_t)
Chris PeBenito 17de1b
')
Chris PeBenito 0d86ea
Chris PeBenito 0d86ea
########################################
Chris PeBenito 0d86ea
## <summary>
Chris PeBenito 0d86ea
##	Connect to xm over an unix stream socket.
Chris PeBenito 0d86ea
## </summary>
Chris PeBenito 0d86ea
## <param name="domain">
Chris PeBenito 0d86ea
##	<summary>
Chris PeBenito 0d86ea
##	Domain allowed access.
Chris PeBenito 0d86ea
##	</summary>
Chris PeBenito 0d86ea
## </param>
Chris PeBenito 0d86ea
#
Chris PeBenito 0d86ea
interface(`xen_stream_connect_xm',`
Chris PeBenito 0d86ea
	gen_require(`
Dominick Grift cb76ff
		type xm_t, xenstored_var_run_t;
Chris PeBenito 0d86ea
	')
Chris PeBenito 0d86ea
Chris PeBenito 0d86ea
	files_search_pids($1)
Chris PeBenito 0d86ea
	stream_connect_pattern($1, xenstored_var_run_t, xenstored_var_run_t, xm_t)
Chris PeBenito 0d86ea
')