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 97e815
	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 97e815
	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 97e815
		type var_log_t, zabbix_log_t;
Chris PeBenito 97e815
	')
Chris PeBenito 97e815
Chris PeBenito 97e815
	logging_search_logs($1)
Chris PeBenito 97e815
	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 ce8a52
## <param name="role">
Chris PeBenito ce8a52
##	<summary>
Chris PeBenito ce8a52
##	The role to be allowed to manage the zabbix domain.
Chris PeBenito ce8a52
##	</summary>
Chris PeBenito ce8a52
## </param>
Chris PeBenito ce8a52
## <param name="terminal">
Chris PeBenito ce8a52
##	<summary>
Chris PeBenito ce8a52
##	The type of the user terminal.
Chris PeBenito ce8a52
##	</summary>
Chris PeBenito ce8a52
## </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 ce8a52
	')
Chris PeBenito ce8a52
Chris PeBenito ce8a52
	allow $1 zabbix_t:process { ptrace signal_perms getattr };
Chris PeBenito ce8a52
	read_files_pattern($1, zabbix_t, zabbix_t)
Chris PeBenito ce8a52
	        
Chris PeBenito ce8a52
	logging_list_logs($1)
Chris PeBenito ce8a52
	manage_files_pattern($1, zabbix_log_t, zabbix_log_t)
Chris PeBenito ce8a52
Chris PeBenito ce8a52
	files_list_pids($1)
Chris PeBenito ce8a52
	manage_files_pattern($1, zabbix_var_run_t, zabbix_var_run_t)
Chris PeBenito ce8a52
')