Chris PeBenito 9401ae1
## <summary>Policy for UML</summary>
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
########################################
Chris PeBenito 9401ae1
## <summary>
Chris PeBenito 9401ae1
##	Role access for uml
Chris PeBenito 9401ae1
## </summary>
Chris PeBenito 9401ae1
## <param name="role">
Chris PeBenito 9401ae1
##	<summary>
Chris PeBenito 9401ae1
##	Role allowed access
Chris PeBenito 9401ae1
##	</summary>
Chris PeBenito 9401ae1
## </param>
Chris PeBenito 9401ae1
## <param name="domain">
Chris PeBenito 9401ae1
##	<summary>
Chris PeBenito 9401ae1
##	User domain for the role
Chris PeBenito 9401ae1
##	</summary>
Chris PeBenito 9401ae1
## </param>
Chris PeBenito 9401ae1
#
Chris PeBenito 9401ae1
interface(`uml_role',`
Chris PeBenito 9401ae1
	gen_require(`
Chris PeBenito 9401ae1
		type uml_t, uml_exec_t;
Chris PeBenito 9401ae1
		type uml_ro_t, uml_rw_t, uml_tmp_t;
Chris PeBenito 9401ae1
		type uml_devpts_t, uml_tmpfs_t;
Chris PeBenito 9401ae1
	')
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
	role $1 types uml_t;
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
	# Transition from the user domain to this domain.
Chris PeBenito 9401ae1
	domtrans_pattern($2, uml_exec_t, uml_t)
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
	# for mconsole
Chris PeBenito 9401ae1
	allow $2 uml_t:unix_dgram_socket sendto;
Chris PeBenito 9401ae1
	allow uml_t $2:unix_dgram_socket sendto;
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
	# allow ps, ptrace, signal
Chris PeBenito 9401ae1
	ps_process_pattern($2, uml_t)
Chris PeBenito 9401ae1
	allow $2 uml_t:process { ptrace signal_perms };
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
	allow $2 uml_ro_t:dir list_dir_perms;
Chris PeBenito 9401ae1
	read_files_pattern($2, uml_ro_t, uml_ro_t)
Chris PeBenito 9401ae1
	read_lnk_files_pattern($2, uml_ro_t, uml_ro_t)
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
	manage_dirs_pattern($2, { uml_ro_t uml_rw_t }, { uml_ro_t uml_rw_t })
Chris PeBenito 9401ae1
	manage_files_pattern($2, { uml_ro_t uml_rw_t }, { uml_ro_t uml_rw_t })
Chris PeBenito 9401ae1
	manage_lnk_files_pattern($2, { uml_ro_t uml_rw_t }, { uml_ro_t uml_rw_t })
Chris PeBenito 9401ae1
	manage_fifo_files_pattern($2, { uml_ro_t uml_rw_t }, { uml_ro_t uml_rw_t })
Chris PeBenito 9401ae1
	manage_sock_files_pattern($2, { uml_ro_t uml_rw_t }, { uml_ro_t uml_rw_t })
Chris PeBenito 9401ae1
	relabel_dirs_pattern($2, { uml_ro_t uml_rw_t }, { uml_ro_t uml_rw_t })
Chris PeBenito 9401ae1
	relabel_files_pattern($2, { uml_ro_t uml_rw_t }, { uml_ro_t uml_rw_t })
Chris PeBenito 9401ae1
	relabel_lnk_files_pattern($2, { uml_ro_t uml_rw_t }, { uml_ro_t uml_rw_t })
Chris PeBenito 9401ae1
	relabel_fifo_files_pattern($2, { uml_ro_t uml_rw_t }, { uml_ro_t uml_rw_t })
Chris PeBenito 9401ae1
	relabel_sock_files_pattern($2, { uml_ro_t uml_rw_t }, { uml_ro_t uml_rw_t })
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
	manage_dirs_pattern($2, { uml_ro_t uml_rw_t uml_exec_t }, { uml_ro_t uml_rw_t uml_exec_t })
Chris PeBenito 9401ae1
	manage_files_pattern($2, { uml_ro_t uml_rw_t uml_exec_t }, { uml_ro_t uml_rw_t uml_exec_t })
Chris PeBenito 9401ae1
	relabel_dirs_pattern($2, { uml_ro_t uml_rw_t uml_exec_t }, { uml_ro_t uml_rw_t uml_exec_t })
Chris PeBenito 9401ae1
	relabel_files_pattern($2, { uml_ro_t uml_rw_t uml_exec_t }, { uml_ro_t uml_rw_t uml_exec_t })
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
	manage_dirs_pattern($2, uml_tmp_t, uml_tmp_t)
Chris PeBenito 9401ae1
	manage_files_pattern($2, uml_tmp_t, uml_tmp_t)
Chris PeBenito 9401ae1
	manage_lnk_files_pattern($2, uml_tmp_t, uml_tmp_t)
Chris PeBenito 9401ae1
	manage_sock_files_pattern($2, uml_tmp_t, uml_tmp_t)
Chris PeBenito 9401ae1
')
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
########################################
Chris PeBenito 9401ae1
## <summary>
Chris PeBenito 9401ae1
##	Set attributes on uml utility socket files.
Chris PeBenito 9401ae1
## </summary>
Chris PeBenito 9401ae1
## <param name="domain">
Chris PeBenito 9401ae1
##	<summary>
Chris PeBenito 9401ae1
##	Domain allowed access.
Chris PeBenito 9401ae1
##	</summary>
Chris PeBenito 9401ae1
## </param>
Chris PeBenito 9401ae1
#
Chris PeBenito 9401ae1
interface(`uml_setattr_util_sockets',`
Chris PeBenito 9401ae1
	gen_require(`
Chris PeBenito 9401ae1
		type uml_switch_var_run_t;
Chris PeBenito 9401ae1
	')
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
	allow $1 uml_switch_var_run_t:sock_file setattr;
Chris PeBenito 9401ae1
')
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
########################################
Chris PeBenito 9401ae1
## <summary>
Chris PeBenito 9401ae1
##	Manage uml utility files.
Chris PeBenito 9401ae1
## </summary>
Chris PeBenito 9401ae1
## <param name="domain">
Chris PeBenito 9401ae1
##	<summary>
Chris PeBenito 9401ae1
##	Domain allowed access.
Chris PeBenito 9401ae1
##	</summary>
Chris PeBenito 9401ae1
## </param>
Chris PeBenito 9401ae1
#
Chris PeBenito 9401ae1
interface(`uml_manage_util_files',`
Chris PeBenito 9401ae1
	gen_require(`
Chris PeBenito 9401ae1
		type uml_switch_var_run_t;
Chris PeBenito 9401ae1
	')
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
	manage_files_pattern($1, uml_switch_var_run_t, uml_switch_var_run_t)
Chris PeBenito 9401ae1
	manage_lnk_files_pattern($1, uml_switch_var_run_t, uml_switch_var_run_t)
Chris PeBenito 9401ae1
')