521831c
521831c
## <summary>policy for glusterd</summary>
521831c
2e739f7
2e739f7
########################################
2e739f7
## <summary>
521831c
##	Transition to glusterd.
521831c
## </summary>
521831c
## <param name="domain">
521831c
## <summary>
521831c
##	Domain allowed to transition.
521831c
## </summary>
521831c
## </param>
521831c
#
521831c
interface(`glusterd_domtrans',`
521831c
	gen_require(`
521831c
		type glusterd_t, glusterd_exec_t;
521831c
	')
521831c
521831c
	corecmd_search_bin($1)
521831c
	domtrans_pattern($1, glusterd_exec_t, glusterd_t)
521831c
')
521831c
521831c
521831c
########################################
521831c
## <summary>
521831c
##	Execute glusterd server in the glusterd domain.
2e739f7
## </summary>
2e739f7
## <param name="domain">
2e739f7
##	<summary>
2e739f7
##	Domain allowed access.
2e739f7
##	</summary>
2e739f7
## </param>
521831c
#
521831c
interface(`glusterd_initrc_domtrans',`
521831c
	gen_require(`
521831c
		type glusterd_initrc_exec_t;
521831c
	')
521831c
521831c
	init_labeled_script_domtrans($1, glusterd_initrc_exec_t)
521831c
')
521831c
521831c
521831c
########################################
521831c
## <summary>
521831c
##	Read glusterd's log files.
521831c
## </summary>
521831c
## <param name="domain">
2e739f7
##	<summary>
521831c
##	Domain allowed access.
2e739f7
##	</summary>
2e739f7
## </param>
2e739f7
## <rolecap/>
2e739f7
#
521831c
interface(`glusterd_read_log',`
521831c
	gen_require(`
521831c
		type glusterd_log_t;
521831c
	')
521831c
521831c
	logging_search_logs($1)
521831c
	read_files_pattern($1, glusterd_log_t, glusterd_log_t)
2e739f7
')
2e739f7
2e739f7
########################################
2e739f7
## <summary>
521831c
##	Append to glusterd log files.
521831c
## </summary>
521831c
## <param name="domain">
521831c
##	<summary>
521831c
##	Domain allowed access.
521831c
##	</summary>
521831c
## </param>
521831c
#
521831c
interface(`glusterd_append_log',`
521831c
	gen_require(`
521831c
		type glusterd_log_t;
521831c
	')
521831c
521831c
	logging_search_logs($1)
521831c
	append_files_pattern($1, glusterd_log_t, glusterd_log_t)
521831c
')
521831c
521831c
########################################
521831c
## <summary>
521831c
##	Manage glusterd log files
521831c
## </summary>
521831c
## <param name="domain">
521831c
##	<summary>
521831c
##	Domain allowed access.
521831c
##	</summary>
521831c
## </param>
521831c
#
521831c
interface(`glusterd_manage_log',`
521831c
	gen_require(`
521831c
		type glusterd_log_t;
521831c
	')
521831c
521831c
	logging_search_logs($1)
521831c
	manage_dirs_pattern($1, glusterd_log_t, glusterd_log_t)
521831c
	manage_files_pattern($1, glusterd_log_t, glusterd_log_t)
521831c
	manage_lnk_files_pattern($1, glusterd_log_t, glusterd_log_t)
521831c
')
521831c
521831c
########################################
521831c
## <summary>
521831c
##	All of the rules required to administrate
521831c
##	an glusterd environment
2e739f7
## </summary>
2e739f7
## <param name="domain">
2e739f7
##	<summary>
2e739f7
##	Domain allowed access.
2e739f7
##	</summary>
2e739f7
## </param>
2e739f7
## <param name="role">
2e739f7
##	<summary>
2e739f7
##	Role allowed access.
2e739f7
##	</summary>
2e739f7
## </param>
2e739f7
## <rolecap/>
2e739f7
#
521831c
interface(`glusterd_admin',`
2e739f7
	gen_require(`
521831c
		type glusterd_t;
521831c
		type glusterd_initrc_exec_t;
521831c
		type glusterd_log_t;
521831c
		type glusterd_tmp_t;
1f86dac
		type glusterd_conf_t; 
2e739f7
	')
2e739f7
521831c
	allow $1 glusterd_t:process { signal_perms };
521831c
	ps_process_pattern($1, glusterd_t)
521831c
521831c
    tunable_policy(`deny_ptrace',`',`
521831c
        allow $1 glusterd_t:process ptrace;
521831c
    ')
521831c
521831c
	glusterd_initrc_domtrans($1)
2e739f7
	domain_system_change_exemption($1)
2e739f7
	role_transition $2 glusterd_initrc_exec_t system_r;
2e739f7
	allow $2 system_r;
2e739f7
2e739f7
	logging_search_logs($1)
2e739f7
	admin_pattern($1, glusterd_log_t)
2e739f7
2e739f7
	admin_pattern($1, glusterd_tmp_t)
2e739f7
1f86dac
	admin_pattern($1, glusterd_conf_t)
2e739f7
2e739f7
')
521831c