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