Chris PeBenito 97e815
## <summary>Distributed infrastructure monitoring</summary>
Chris PeBenito 97e815
Chris PeBenito 97e815
########################################
Chris PeBenito 97e815
## <summary>
Chris PeBenito 97e815
##	Execute a domain transition to run zabbix.
Chris PeBenito 97e815
## </summary>
Chris PeBenito 97e815
## <param name="domain">
Chris PeBenito 97e815
## <summary>
Chris PeBenito 97e815
##	Domain allowed to transition.
Chris PeBenito 97e815
## </summary>
Chris PeBenito 97e815
## </param>
Chris PeBenito 97e815
#
Chris PeBenito 97e815
interface(`zabbix_domtrans',`
Chris PeBenito 97e815
	gen_require(`
Chris PeBenito 97e815
		type zabbix_t, zabbix_exec_t;
Chris PeBenito 97e815
	')
Chris PeBenito 97e815
Chris PeBenito 0bfccd
	domtrans_pattern($1, zabbix_exec_t, zabbix_t)
Chris PeBenito 97e815
')
Chris PeBenito 97e815
Chris PeBenito 97e815
########################################
Chris PeBenito 97e815
## <summary>
Chris PeBenito 97e815
##	Allow the specified domain to read zabbix's log files.
Chris PeBenito 97e815
## </summary>
Chris PeBenito 97e815
## <param name="domain">
Chris PeBenito 97e815
##	<summary>
Chris PeBenito 97e815
##	Domain allowed access.
Chris PeBenito 97e815
##	</summary>
Chris PeBenito 97e815
## </param>
Chris PeBenito 97e815
## <rolecap/>
Chris PeBenito 97e815
#
Chris PeBenito 97e815
interface(`zabbix_read_log',`
Chris PeBenito 97e815
	gen_require(`
Chris PeBenito 97e815
		type zabbix_log_t;
Chris PeBenito 97e815
	')
Chris PeBenito 97e815
Chris PeBenito 97e815
	logging_search_logs($1)
Chris PeBenito 0bfccd
	read_files_pattern($1, zabbix_log_t, zabbix_log_t)
Chris PeBenito 97e815
')
Chris PeBenito 97e815
Chris PeBenito 97e815
########################################
Chris PeBenito 97e815
## <summary>
Chris PeBenito 97e815
##	Allow the specified domain to append
Chris PeBenito 97e815
##	zabbix log files.
Chris PeBenito 97e815
## </summary>
Chris PeBenito 97e815
## <param name="domain">
Chris PeBenito 97e815
## 	<summary>
Chris PeBenito 97e815
##	Domain allowed access.
Chris PeBenito 97e815
## 	</summary>
Chris PeBenito 97e815
## </param>
Chris PeBenito 97e815
#
Chris PeBenito 97e815
interface(`zabbix_append_log',`
Chris PeBenito 97e815
	gen_require(`
Chris PeBenito b34db7
		type zabbix_log_t;
Chris PeBenito 97e815
	')
Chris PeBenito 97e815
Chris PeBenito 97e815
	logging_search_logs($1)
Chris PeBenito 0bfccd
	append_files_pattern($1, zabbix_log_t, zabbix_log_t)
Chris PeBenito 97e815
')
Chris PeBenito 97e815
Chris PeBenito 97e815
########################################
Chris PeBenito 97e815
## <summary>
Chris PeBenito 97e815
##	Read zabbix PID files.
Chris PeBenito 97e815
## </summary>
Chris PeBenito 97e815
## <param name="domain">
Chris PeBenito 97e815
##	<summary>
Chris PeBenito 97e815
##	Domain allowed access.
Chris PeBenito 97e815
##	</summary>
Chris PeBenito 97e815
## </param>
Chris PeBenito 97e815
#
Chris PeBenito 97e815
interface(`zabbix_read_pid_files',`
Chris PeBenito 97e815
	gen_require(`
Chris PeBenito 97e815
		type zabbix_var_run_t;
Chris PeBenito 97e815
	')
Chris PeBenito 97e815
Chris PeBenito 97e815
	files_search_pids($1)
Chris PeBenito 97e815
	allow $1 zabbix_var_run_t:file read_file_perms;
Chris PeBenito 97e815
')
Chris PeBenito ce8a52
Chris PeBenito ce8a52
########################################
Chris PeBenito ce8a52
## <summary>
Chris PeBenito ce8a52
##	All of the rules required to administrate 
Chris PeBenito ce8a52
##	an zabbix environment
Chris PeBenito ce8a52
## </summary>
Chris PeBenito ce8a52
## <param name="domain">
Chris PeBenito ce8a52
##	<summary>
Chris PeBenito ce8a52
##	Domain allowed access.
Chris PeBenito ce8a52
##	</summary>
Chris PeBenito ce8a52
## </param>
Chris PeBenito e87221
## <param name="role">
Chris PeBenito e87221
##	<summary>
Chris PeBenito e87221
##	The role to be allowed to manage the zabbix domain.
Chris PeBenito e87221
##	</summary>
Chris PeBenito e87221
## </param>
Chris PeBenito ce8a52
## <rolecap/>
Chris PeBenito ce8a52
#
Chris PeBenito ce8a52
interface(`zabbix_admin',`
Chris PeBenito ce8a52
	gen_require(`
Chris PeBenito ce8a52
		type zabbix_t, zabbix_log_t, zabbix_var_run_t;
Chris PeBenito e87221
		type zabbix_initrc_exec_t;
Chris PeBenito ce8a52
	')
Chris PeBenito ce8a52
Chris PeBenito e87221
	allow $1 zabbix_t:process { ptrace signal_perms };
Chris PeBenito e87221
	ps_process_pattern($1, zabbix_t)
Chris PeBenito 2a9837
Chris PeBenito e87221
	init_labeled_script_domtrans($1, zabbix_initrc_exec_t)
Chris PeBenito e87221
	domain_system_change_exemption($1)
Chris PeBenito e87221
	role_transition $2 zabbix_initrc_exec_t system_r;
Chris PeBenito e87221
	allow $2 system_r;
Chris PeBenito 2a9837
Chris PeBenito ce8a52
	logging_list_logs($1)
Chris PeBenito e87221
	admin_pattern($1, zabbix_log_t)
Chris PeBenito ce8a52
Chris PeBenito ce8a52
	files_list_pids($1)
Chris PeBenito e87221
	admin_pattern($1, zabbix_var_run_t)
Chris PeBenito ce8a52
')