|
Chris PeBenito |
17de1b |
## <summary>Net Saint / NAGIOS - network monitoring server</summary>
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Jeremy Solt |
99bbe3 |
## Create a set of derived types for various
|
|
Jeremy Solt |
99bbe3 |
## nagios plugins,
|
|
Jeremy Solt |
99bbe3 |
## </summary>
|
|
Jeremy Solt |
99bbe3 |
## <param name="plugins_group_name">
|
|
Jeremy Solt |
99bbe3 |
## <summary>
|
|
Jeremy Solt |
99bbe3 |
## The name to be used for deriving type names.
|
|
Jeremy Solt |
99bbe3 |
## </summary>
|
|
Jeremy Solt |
99bbe3 |
## </param>
|
|
Jeremy Solt |
99bbe3 |
#
|
|
Jeremy Solt |
99bbe3 |
template(`nagios_plugin_template',`
|
|
Jeremy Solt |
99bbe3 |
|
|
Jeremy Solt |
99bbe3 |
gen_require(`
|
|
Jeremy Solt |
99bbe3 |
type nagios_t, nrpe_t;
|
|
Jeremy Solt |
99bbe3 |
type nagios_log_t;
|
|
Jeremy Solt |
99bbe3 |
')
|
|
Jeremy Solt |
99bbe3 |
|
|
Jeremy Solt |
99bbe3 |
type nagios_$1_plugin_t;
|
|
Jeremy Solt |
99bbe3 |
type nagios_$1_plugin_exec_t;
|
|
Jeremy Solt |
99bbe3 |
application_domain(nagios_$1_plugin_t, nagios_$1_plugin_exec_t)
|
|
Jeremy Solt |
99bbe3 |
role system_r types nagios_$1_plugin_t;
|
|
Jeremy Solt |
99bbe3 |
|
|
Jeremy Solt |
99bbe3 |
allow nagios_$1_plugin_t self:fifo_file rw_fifo_file_perms;
|
|
Jeremy Solt |
99bbe3 |
|
|
Jeremy Solt |
99bbe3 |
domtrans_pattern(nrpe_t, nagios_$1_plugin_exec_t, nagios_$1_plugin_t)
|
|
Jeremy Solt |
99bbe3 |
|
|
Jeremy Solt |
99bbe3 |
# needed by command.cfg
|
|
Jeremy Solt |
99bbe3 |
domtrans_pattern(nagios_t, nagios_$1_plugin_exec_t, nagios_$1_plugin_t)
|
|
Jeremy Solt |
99bbe3 |
|
|
Jeremy Solt |
99bbe3 |
allow nagios_t nagios_$1_plugin_t:process signal_perms;
|
|
Jeremy Solt |
99bbe3 |
|
|
Jeremy Solt |
99bbe3 |
# cjp: leaked file descriptor
|
|
Jeremy Solt |
99bbe3 |
dontaudit nagios_$1_plugin_t nrpe_t:tcp_socket { read write };
|
|
Jeremy Solt |
99bbe3 |
dontaudit nagios_$1_plugin_t nagios_log_t:file { read write };
|
|
Jeremy Solt |
99bbe3 |
|
|
Jeremy Solt |
99bbe3 |
miscfiles_read_localization(nagios_$1_plugin_t)
|
|
Jeremy Solt |
99bbe3 |
')
|
|
Jeremy Solt |
99bbe3 |
|
|
Jeremy Solt |
99bbe3 |
########################################
|
|
Jeremy Solt |
99bbe3 |
## <summary>
|
|
Chris PeBenito |
a65fd9 |
## Do not audit attempts to read or write nagios
|
|
Chris PeBenito |
a65fd9 |
## unnamed pipes.
|
|
Chris PeBenito |
a65fd9 |
## </summary>
|
|
Chris PeBenito |
a65fd9 |
## <param name="domain">
|
|
Chris PeBenito |
a65fd9 |
## <summary>
|
|
Chris PeBenito |
a65fd9 |
## Domain to not audit.
|
|
Chris PeBenito |
a65fd9 |
## </summary>
|
|
Chris PeBenito |
a65fd9 |
## </param>
|
|
Chris PeBenito |
a65fd9 |
## <rolecap/>
|
|
Chris PeBenito |
a65fd9 |
#
|
|
Chris PeBenito |
a65fd9 |
interface(`nagios_dontaudit_rw_pipes',`
|
|
Chris PeBenito |
a65fd9 |
gen_require(`
|
|
Chris PeBenito |
a65fd9 |
type nagios_t;
|
|
Chris PeBenito |
a65fd9 |
')
|
|
Chris PeBenito |
a65fd9 |
|
|
Chris PeBenito |
a65fd9 |
dontaudit $1 nagios_t:fifo_file rw_fifo_file_perms;
|
|
Chris PeBenito |
a65fd9 |
')
|
|
Chris PeBenito |
a65fd9 |
|
|
Chris PeBenito |
a65fd9 |
########################################
|
|
Chris PeBenito |
a65fd9 |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Allow the specified domain to read
|
|
Chris PeBenito |
17de1b |
## nagios configuration files.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## <param name="domain">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Domain allowed access.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
bbcd3c |
## <rolecap/>
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
interface(`nagios_read_config',`
|
|
Chris PeBenito |
17de1b |
gen_require(`
|
|
Chris PeBenito |
17de1b |
type nagios_etc_t;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow $1 nagios_etc_t:dir list_dir_perms;
|
|
Chris PeBenito |
c0868a |
allow $1 nagios_etc_t:file read_file_perms;
|
|
Chris PeBenito |
17de1b |
files_search_etc($1)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Jeremy Solt |
99bbe3 |
######################################
|
|
Jeremy Solt |
99bbe3 |
## <summary>
|
|
Jeremy Solt |
99bbe3 |
## Read nagios logs.
|
|
Jeremy Solt |
99bbe3 |
## </summary>
|
|
Jeremy Solt |
99bbe3 |
## <param name="domain">
|
|
Jeremy Solt |
99bbe3 |
## <summary>
|
|
Jeremy Solt |
99bbe3 |
## Domain allowed access.
|
|
Jeremy Solt |
99bbe3 |
## </summary>
|
|
Jeremy Solt |
99bbe3 |
## </param>
|
|
Jeremy Solt |
99bbe3 |
#
|
|
Jeremy Solt |
99bbe3 |
interface(`nagios_read_log',`
|
|
Jeremy Solt |
99bbe3 |
gen_require(`
|
|
Jeremy Solt |
99bbe3 |
type nagios_log_t;
|
|
Jeremy Solt |
99bbe3 |
')
|
|
Jeremy Solt |
99bbe3 |
|
|
Jeremy Solt |
99bbe3 |
logging_search_logs($1)
|
|
Jeremy Solt |
99bbe3 |
read_files_pattern($1, nagios_log_t, nagios_log_t)
|
|
Jeremy Solt |
99bbe3 |
')
|
|
Jeremy Solt |
99bbe3 |
|
|
Jeremy Solt |
99bbe3 |
########################################
|
|
Jeremy Solt |
99bbe3 |
## <summary>
|
|
Jeremy Solt |
99bbe3 |
## Search nagios spool directories.
|
|
Jeremy Solt |
99bbe3 |
## </summary>
|
|
Jeremy Solt |
99bbe3 |
## <param name="domain">
|
|
Jeremy Solt |
99bbe3 |
## <summary>
|
|
Jeremy Solt |
99bbe3 |
## Domain allowed access.
|
|
Jeremy Solt |
99bbe3 |
## </summary>
|
|
Jeremy Solt |
99bbe3 |
## </param>
|
|
Jeremy Solt |
99bbe3 |
#
|
|
Jeremy Solt |
99bbe3 |
interface(`nagios_search_spool',`
|
|
Jeremy Solt |
99bbe3 |
gen_require(`
|
|
Jeremy Solt |
99bbe3 |
type nagios_spool_t;
|
|
Jeremy Solt |
99bbe3 |
')
|
|
Jeremy Solt |
99bbe3 |
|
|
Jeremy Solt |
99bbe3 |
allow $1 nagios_spool_t:dir search_dir_perms;
|
|
Jeremy Solt |
99bbe3 |
files_search_spool($1)
|
|
Jeremy Solt |
99bbe3 |
')
|
|
Jeremy Solt |
99bbe3 |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Allow the specified domain to read
|
|
Chris PeBenito |
17de1b |
## nagios temporary files.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## <param name="domain">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Domain allowed access.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
interface(`nagios_read_tmp_files',`
|
|
Chris PeBenito |
17de1b |
gen_require(`
|
|
Chris PeBenito |
17de1b |
type nagios_tmp_t;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
allow $1 nagios_tmp_t:file read_file_perms;
|
|
Chris PeBenito |
17de1b |
files_search_tmp($1)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Execute the nagios NRPE with
|
|
Chris PeBenito |
17de1b |
## a domain transition.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## <param name="domain">
|
|
Chris PeBenito |
17de1b |
## <summary>
|
|
Chris PeBenito |
17de1b |
## Domain allowed access.
|
|
Chris PeBenito |
17de1b |
## </summary>
|
|
Chris PeBenito |
17de1b |
## </param>
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
interface(`nagios_domtrans_nrpe',`
|
|
Chris PeBenito |
17de1b |
gen_require(`
|
|
Chris PeBenito |
17de1b |
type nrpe_t, nrpe_exec_t;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
0bfccd |
domtrans_pattern($1, nrpe_exec_t, nrpe_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Jeremy Solt |
99bbe3 |
|
|
Jeremy Solt |
99bbe3 |
########################################
|
|
Jeremy Solt |
99bbe3 |
## <summary>
|
|
Jeremy Solt |
99bbe3 |
## All of the rules required to administrate
|
|
Jeremy Solt |
99bbe3 |
## an nagios environment
|
|
Jeremy Solt |
99bbe3 |
## </summary>
|
|
Jeremy Solt |
99bbe3 |
## <param name="domain">
|
|
Jeremy Solt |
99bbe3 |
## <summary>
|
|
Jeremy Solt |
99bbe3 |
## Domain allowed access.
|
|
Jeremy Solt |
99bbe3 |
## </summary>
|
|
Jeremy Solt |
99bbe3 |
## </param>
|
|
Jeremy Solt |
99bbe3 |
## <param name="role">
|
|
Jeremy Solt |
99bbe3 |
## <summary>
|
|
Jeremy Solt |
99bbe3 |
## The role to be allowed to manage the nagios domain.
|
|
Jeremy Solt |
99bbe3 |
## </summary>
|
|
Jeremy Solt |
99bbe3 |
## </param>
|
|
Jeremy Solt |
99bbe3 |
## <rolecap/>
|
|
Jeremy Solt |
99bbe3 |
#
|
|
Jeremy Solt |
99bbe3 |
interface(`nagios_admin',`
|
|
Jeremy Solt |
99bbe3 |
gen_require(`
|
|
Jeremy Solt |
99bbe3 |
type nagios_t, nrpe_t;
|
|
Jeremy Solt |
99bbe3 |
type nagios_tmp_t, nagios_log_t;
|
|
Jeremy Solt |
99bbe3 |
type nagios_etc_t, nrpe_etc_t;
|
|
Jeremy Solt |
99bbe3 |
type nagios_spool_t, nagios_var_run_t;
|
|
Jeremy Solt |
99bbe3 |
type nagios_initrc_exec_t;
|
|
Jeremy Solt |
99bbe3 |
')
|
|
Jeremy Solt |
99bbe3 |
|
|
Jeremy Solt |
99bbe3 |
allow $1 nagios_t:process { ptrace signal_perms };
|
|
Jeremy Solt |
99bbe3 |
ps_process_pattern($1, nagios_t)
|
|
Jeremy Solt |
99bbe3 |
|
|
Jeremy Solt |
99bbe3 |
init_labeled_script_domtrans($1, nagios_initrc_exec_t)
|
|
Jeremy Solt |
99bbe3 |
domain_system_change_exemption($1)
|
|
Jeremy Solt |
99bbe3 |
role_transition $2 nagios_initrc_exec_t system_r;
|
|
Jeremy Solt |
99bbe3 |
allow $2 system_r;
|
|
Jeremy Solt |
99bbe3 |
|
|
Jeremy Solt |
99bbe3 |
files_list_tmp($1)
|
|
Jeremy Solt |
99bbe3 |
admin_pattern($1, nagios_tmp_t)
|
|
Jeremy Solt |
99bbe3 |
|
|
Jeremy Solt |
99bbe3 |
logging_list_logs($1)
|
|
Jeremy Solt |
99bbe3 |
admin_pattern($1, nagios_log_t)
|
|
Jeremy Solt |
99bbe3 |
|
|
Jeremy Solt |
99bbe3 |
files_list_etc($1)
|
|
Jeremy Solt |
99bbe3 |
admin_pattern($1, nagios_etc_t)
|
|
Jeremy Solt |
99bbe3 |
|
|
Jeremy Solt |
99bbe3 |
files_list_spool($1)
|
|
Jeremy Solt |
99bbe3 |
admin_pattern($1, nagios_spool_t)
|
|
Jeremy Solt |
99bbe3 |
|
|
Jeremy Solt |
99bbe3 |
files_list_pids($1)
|
|
Jeremy Solt |
99bbe3 |
admin_pattern($1, nagios_var_run_t)
|
|
Jeremy Solt |
99bbe3 |
|
|
Jeremy Solt |
99bbe3 |
admin_pattern($1, nrpe_etc_t)
|
|
Jeremy Solt |
99bbe3 |
')
|