## Monit - utility for monitoring services on a Unix system.
########################################
##
## Execute a domain transition to run monit cli.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`monit_domtrans_cli',`
gen_require(`
type monit_cli_t, monit_exec_t;
')
corecmd_search_bin($1)
domtrans_pattern($1, monit_exec_t, monit_cli_t)
')
########################################
##
## Execute monit in the monit cli domain,
## and allow the specified role
## the monit cli domain.
##
##
##
## Domain allowed to transition.
##
##
##
##
## Role allowed access.
##
##
#
interface(`monit_run_cli',`
gen_require(`
attribute_role monit_cli_roles;
')
monit_domtrans_cli($1)
roleattribute $2 monit_cli_roles;
')
########################################
##
## Reload the monit daemon.
##
##
##
## Domain allowed access.
##
##
#
interface(`monit_reload',`
gen_require(`
class service { reload status };
type monit_initrc_exec_t, monit_unit_t;
')
allow $1 { monit_initrc_exec_t monit_unit_t }:service { reload status };
')
########################################
##
## Start and stop the monit daemon.
##
##
##
## Domain allowed access.
##
##
#
interface(`monit_startstop_service',`
gen_require(`
class service { start status stop };
type monit_initrc_exec_t, monit_unit_t;
')
allow $1 { monit_initrc_exec_t monit_unit_t }:service { start status stop };
')
########################################
##
## All of the rules required to
## administrate an monit environment.
##
##
##
## Domain allowed access.
##
##
##
##
## Role allowed access.
##
##
#
interface(`monit_admin',`
gen_require(`
type monit_t, monit_conf_t, monit_initrc_exec_t;
type monit_log_t, monit_runtime_t;
type monit_unit_t, monit_var_lib_t;
')
admin_process_pattern($1, monit_t)
init_startstop_service($1, $2, monit_t, monit_initrc_exec_t, monit_unit_t)
files_search_etc($1)
admin_pattern($1, monit_conf_t)
logging_search_logs($1)
admin_pattern($1, monit_log_t)
files_search_runtime($1)
admin_pattern($1, monit_runtime_t)
files_search_var_lib($1)
admin_pattern($1, monit_var_lib_t)
monit_run_cli($1, $2)
')