Jeremy Solt 21d23c
## <summary>rgmanager - Resource Group Manager</summary>
Jeremy Solt 538cf9
Jeremy Solt 538cf9
#######################################
Jeremy Solt 538cf9
## <summary>
Jeremy Solt 538cf9
##	Execute a domain transition to run rgmanager.
Jeremy Solt 538cf9
## </summary>
Jeremy Solt 538cf9
## <param name="domain">
Jeremy Solt 538cf9
## <summary>
Dominick Grift 288845
##	Domain allowed to transition.
Jeremy Solt 538cf9
## </summary>
Jeremy Solt 538cf9
## </param>
Jeremy Solt 538cf9
#
Jeremy Solt 538cf9
interface(`rgmanager_domtrans',`
Jeremy Solt 538cf9
	gen_require(`
Jeremy Solt 538cf9
		type rgmanager_t, rgmanager_exec_t;
Jeremy Solt 538cf9
	')
Jeremy Solt 538cf9
Jeremy Solt 538cf9
	corecmd_search_bin($1)
Jeremy Solt 538cf9
	domtrans_pattern($1, rgmanager_exec_t, rgmanager_t)
Jeremy Solt 538cf9
')
Jeremy Solt 538cf9
Jeremy Solt 538cf9
########################################
Jeremy Solt 538cf9
## <summary>
Jeremy Solt 538cf9
##	Connect to rgmanager over an unix stream socket.
Jeremy Solt 538cf9
## </summary>
Jeremy Solt 538cf9
## <param name="domain">
Jeremy Solt 538cf9
##	<summary>
Jeremy Solt 538cf9
##	Domain allowed access.
Jeremy Solt 538cf9
##	</summary>
Jeremy Solt 538cf9
## </param>
Jeremy Solt 538cf9
#
Jeremy Solt 538cf9
interface(`rgmanager_stream_connect',`
Jeremy Solt 538cf9
	gen_require(`
Jeremy Solt 538cf9
		type rgmanager_t, rgmanager_var_run_t;
Jeremy Solt 538cf9
	')
Jeremy Solt 538cf9
Jeremy Solt 538cf9
	files_search_pids($1)
Jeremy Solt 538cf9
	stream_connect_pattern($1, rgmanager_var_run_t, rgmanager_var_run_t, rgmanager_t)
Jeremy Solt 538cf9
')
Jeremy Solt 538cf9
Jeremy Solt 538cf9
######################################
Jeremy Solt 538cf9
## <summary>
Jeremy Solt 538cf9
##	Allow manage rgmanager tmp files.
Jeremy Solt 538cf9
## </summary>
Jeremy Solt 538cf9
## <param name="domain">
Jeremy Solt 538cf9
##	<summary>
Jeremy Solt 538cf9
##	Domain allowed access.
Jeremy Solt 538cf9
##	</summary>
Jeremy Solt 538cf9
## </param>
Jeremy Solt 538cf9
#
Jeremy Solt 538cf9
interface(`rgmanager_manage_tmp_files',`
Jeremy Solt 538cf9
	gen_require(`
Jeremy Solt 538cf9
		type rgmanager_tmp_t;
Jeremy Solt 538cf9
	')
Jeremy Solt 538cf9
Jeremy Solt 538cf9
	files_search_tmp($1)
Jeremy Solt 538cf9
	manage_files_pattern($1, rgmanager_tmp_t, rgmanager_tmp_t)
Jeremy Solt 538cf9
')
Jeremy Solt 538cf9
Jeremy Solt 538cf9
######################################
Jeremy Solt 538cf9
## <summary>
Jeremy Solt 538cf9
##	Allow manage rgmanager tmpfs files.
Jeremy Solt 538cf9
## </summary>
Jeremy Solt 538cf9
## <param name="domain">
Jeremy Solt 538cf9
##	<summary>
Jeremy Solt 538cf9
##	Domain allowed access.
Jeremy Solt 538cf9
##	</summary>
Jeremy Solt 538cf9
## </param>
Jeremy Solt 538cf9
#
Jeremy Solt 538cf9
interface(`rgmanager_manage_tmpfs_files',`
Jeremy Solt 538cf9
	gen_require(`
Jeremy Solt 538cf9
		type rgmanager_tmpfs_t;
Jeremy Solt 538cf9
	')
Jeremy Solt 538cf9
Jeremy Solt 538cf9
	fs_search_tmpfs($1)
Jeremy Solt 538cf9
	manage_files_pattern($1, rgmanager_tmpfs_t, rgmanager_tmpfs_t)
Jeremy Solt 538cf9
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
#######################################
Dan Walsh 3eaa99
## <summary>
Dan Walsh 3eaa99
##      Allow read and write access to rgmanager semaphores.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dan Walsh 3eaa99
##      <summary>
Dan Walsh 3eaa99
##      Domain allowed access.
Dan Walsh 3eaa99
##      </summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
interface(`rgmanager_rw_semaphores',`
Dan Walsh 3eaa99
        gen_require(`
Dan Walsh 3eaa99
                type rgmanager_t;
Dan Walsh 3eaa99
        ')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
        allow $1 rgmanager_t:sem { unix_read unix_write associate read write };
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
######################################
Dan Walsh 3eaa99
## <summary>
Dan Walsh 3eaa99
##	All of the rules required to administrate
Dan Walsh 3eaa99
##	an rgmanager environment
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dan Walsh 3eaa99
## 	<summary>
Dan Walsh 3eaa99
##	Domain allowed access.
Dan Walsh 3eaa99
##	 </summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
## <param name="role">
Dan Walsh 3eaa99
##	<summary>
Dan Walsh 3eaa99
##	The role to be allowed to manage the rgmanager domain.
Dan Walsh 3eaa99
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
## <rolecap/>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
interface(`rgmanager_admin',`
Dan Walsh 3eaa99
	gen_require(`
Dan Walsh 3eaa99
		type rgmanager_t, rgmanager_initrc_exec_t, rgmanager_tmp_t; 
Dan Walsh 3eaa99
		type rgmanager_tmpfs_t, rgmanager_var_log_t, rgmanager_var_run_t;
Dan Walsh 3eaa99
        ')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	allow $1 rgmanager_t:process { ptrace signal_perms };
Dan Walsh 3eaa99
	read_files_pattern($1, rgmanager_t, rgmanager_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	init_labeled_script_domtrans($1, rgmanager_initrc_exec_t)
Dan Walsh 3eaa99
	domain_system_change_exemption($1)
Dan Walsh 3eaa99
	role_transition $2 rgmanager_initrc_exec_t system_r;
Dan Walsh 3eaa99
	allow $2 system_r;
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	files_search_tmp($1)
Dan Walsh 3eaa99
	admin_pattern($1, rgmanager_tmp_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	admin_pattern($1, rgmanager_tmpfs_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	logging_search_logs($1)
Dan Walsh 3eaa99
	admin_pattern($1, rgmanager_var_log_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	files_search_pids($1)
Dan Walsh 3eaa99
	admin_pattern($1, rgmanager_var_run_t)
Dan Walsh 3eaa99
')