Chris PeBenito 17de1b
## <summary>Run .NET server and client applications on Linux.</summary>
Chris PeBenito 17de1b
Chris PeBenito 1e0f48
#######################################
Chris PeBenito 1e0f48
## <summary>
Chris PeBenito 1e0f48
##	The role template for the mono module.
Chris PeBenito 1e0f48
## </summary>
Chris PeBenito 1e0f48
## <desc>
Chris PeBenito 1e0f48
##	

Chris PeBenito 1e0f48
##	This template creates a derived domains which are used
Chris PeBenito 1e0f48
##	for mono applications.
Chris PeBenito 1e0f48
##	

Chris PeBenito 1e0f48
## </desc>
Chris PeBenito 1e0f48
## <param name="role_prefix">
Chris PeBenito 1e0f48
##	<summary>
Chris PeBenito 1e0f48
##	The prefix of the user domain (e.g., user
Chris PeBenito 1e0f48
##	is the prefix for user_t).
Chris PeBenito 1e0f48
##	</summary>
Chris PeBenito 1e0f48
## </param>
Chris PeBenito 1e0f48
## <param name="user_role">
Chris PeBenito 1e0f48
##	<summary>
Chris PeBenito 1e0f48
##	The role associated with the user domain.
Chris PeBenito 1e0f48
##	</summary>
Chris PeBenito 1e0f48
## </param>
Chris PeBenito 1e0f48
## <param name="user_domain">
Chris PeBenito 1e0f48
##	<summary>
Chris PeBenito 1e0f48
##	The type of the user domain.
Chris PeBenito 1e0f48
##	</summary>
Chris PeBenito 1e0f48
## </param>
Chris PeBenito 1e0f48
#
Chris PeBenito 1e0f48
template(`mono_role_template',`
Chris PeBenito 1e0f48
	gen_require(`
Chris PeBenito 1e0f48
		type mono_exec_t;
Chris PeBenito 1e0f48
	')
Chris PeBenito 1e0f48
Chris PeBenito 1e0f48
	type $1_mono_t;
Chris PeBenito 1e0f48
	domain_type($1_mono_t)
Chris PeBenito 1e0f48
	domain_entry_file($1_mono_t, mono_exec_t)
Chris PeBenito 1e0f48
	role $2 types $1_mono_t;
Chris PeBenito 1e0f48
Chris PeBenito 1e0f48
	domain_interactive_fd($1_mono_t)
Chris PeBenito 1e0f48
	application_type($1_mono_t)
Chris PeBenito 1e0f48
Chris PeBenito 1e0f48
	allow $1_mono_t self:process { ptrace signal getsched execheap execmem execstack };
Chris PeBenito 1e0f48
	allow $3 $1_mono_t:process { getattr ptrace noatsecure signal_perms };
Chris PeBenito 1e0f48
Chris PeBenito 1e0f48
	domtrans_pattern($3, mono_exec_t, $1_mono_t)
Chris PeBenito 1e0f48
Chris PeBenito 1e0f48
	fs_dontaudit_rw_tmpfs_files($1_mono_t)
Chris PeBenito 1e0f48
	corecmd_bin_domtrans($1_mono_t, $1_t)
Dan Walsh 2968e0
Dan Walsh 2968e0
	userdom_unpriv_usertype($1, $1_mono_t)
Dan Walsh 2968e0
	userdom_manage_tmpfs_role($2, $1_mono_t)
Dan Walsh 2968e0
Dan Walsh 3eaa99
	ifdef(`hide_broken_symptoms', `
Dan Walsh 3eaa99
		dontaudit $1_t $1_mono_t:socket_class_set { read write };
Dan Walsh 3eaa99
	')
Chris PeBenito 1db183
Chris PeBenito 1e0f48
	optional_policy(`
Chris PeBenito 1e0f48
		xserver_role($1_r, $1_mono_t)
Chris PeBenito 1e0f48
	')
Chris PeBenito 1e0f48
')
Chris PeBenito 1e0f48
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute the mono program in the mono domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Dominick Grift 03b866
##	Domain allowed to transition.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`mono_domtrans',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type mono_t, mono_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	corecmd_search_bin($1)
Chris PeBenito c0868a
	domtrans_pattern($1, mono_exec_t, mono_t)
Chris PeBenito 17de1b
')
Chris PeBenito 131634
Chris PeBenito 131634
########################################
Chris PeBenito 131634
## <summary>
Chris PeBenito 1e0f48
##	Execute mono in the mono domain, and
Chris PeBenito 1e0f48
##	allow the specified role the mono domain.
Chris PeBenito 1e0f48
## </summary>
Chris PeBenito 1e0f48
## <param name="domain">
Chris PeBenito 1e0f48
##	<summary>
Dominick Grift 03b866
##	Domain allowed to transition.
Chris PeBenito 1e0f48
##	</summary>
Chris PeBenito 1e0f48
## </param>
Chris PeBenito 1e0f48
## <param name="role">
Chris PeBenito 1e0f48
##	<summary>
Chris PeBenito a7ee7f
##	Role allowed access.
Chris PeBenito 1e0f48
##	</summary>
Chris PeBenito 1e0f48
## </param>
Chris PeBenito 1e0f48
#
Chris PeBenito 1e0f48
interface(`mono_run',`
Chris PeBenito 1e0f48
	gen_require(`
Chris PeBenito 1e0f48
		type mono_t;
Chris PeBenito 1e0f48
	')
Chris PeBenito 1e0f48
Chris PeBenito 1e0f48
	mono_domtrans($1)
Chris PeBenito 1e0f48
	role $2 types mono_t;
Chris PeBenito 1e0f48
')
Chris PeBenito 1e0f48
Chris PeBenito 1e0f48
########################################
Chris PeBenito 1e0f48
## <summary>
Chris PeBenito 131634
##	Execute the mono program in the caller domain.
Chris PeBenito 131634
## </summary>
Chris PeBenito 131634
## <param name="domain">
Chris PeBenito 131634
##	<summary>
Chris PeBenito 131634
##	Domain allowed access.
Chris PeBenito 131634
##	</summary>
Chris PeBenito 131634
## </param>
Chris PeBenito 131634
#
Chris PeBenito 131634
interface(`mono_exec',`
Chris PeBenito 131634
	gen_require(`
Chris PeBenito 1e0f48
		type mono_exec_t;
Chris PeBenito 131634
	')
Chris PeBenito 131634
Chris PeBenito 131634
	corecmd_search_bin($1)
Chris PeBenito 131634
	can_exec($1, mono_exec_t)
Chris PeBenito 131634
')
Chris PeBenito 1e0f48
Chris PeBenito 1e0f48
########################################
Chris PeBenito 1e0f48
## <summary>
Chris PeBenito 1e0f48
##	Read and write to mono shared memory.
Chris PeBenito 1e0f48
## </summary>
Chris PeBenito 1e0f48
## <param name="domain">
Chris PeBenito 1e0f48
##	<summary>
Chris PeBenito a72e42
##	Domain allowed access.
Chris PeBenito 1e0f48
##	</summary>
Chris PeBenito 1e0f48
## </param>
Chris PeBenito 1e0f48
#
Chris PeBenito 1e0f48
interface(`mono_rw_shm',`
Chris PeBenito 1e0f48
	gen_require(`
Chris PeBenito 1e0f48
		type mono_t;
Chris PeBenito 1e0f48
	')
Chris PeBenito 1e0f48
Chris PeBenito 1e0f48
	allow $1 mono_t:shm rw_shm_perms;
Chris PeBenito 1e0f48
')