|
|
b43f464 |
## <summary>Munin network-wide load graphing (formerly LRRD)</summary>
|
|
|
1ec3d1a |
|
|
|
b43f464 |
########################################
|
|
|
1ec3d1a |
## <summary>
|
|
|
b43f464 |
## Create a set of derived types for various
|
|
|
b43f464 |
## munin plugins,
|
|
|
1ec3d1a |
## </summary>
|
|
|
b43f464 |
## <param name="prefix">
|
|
|
1ec3d1a |
## <summary>
|
|
|
b43f464 |
## The name to be used for deriving type names.
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## </param>
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
template(`munin_plugin_template',`
|
|
|
1ec3d1a |
gen_require(`
|
|
|
1f86dac |
attribute munin_plugin_domain, munin_plugin_tmp_content;
|
|
|
1ec3d1a |
type munin_t;
|
|
|
1ec3d1a |
|
|
Chris PeBenito |
9401ae1 |
')
|
|
Chris PeBenito |
9401ae1 |
|
|
|
1ec3d1a |
type $1_munin_plugin_t, munin_plugin_domain;
|
|
|
1ec3d1a |
type $1_munin_plugin_exec_t;
|
|
|
1ec3d1a |
typealias $1_munin_plugin_t alias munin_$1_plugin_t;
|
|
|
1ec3d1a |
typealias $1_munin_plugin_exec_t alias munin_$1_plugin_exec_t;
|
|
|
1ec3d1a |
application_domain($1_munin_plugin_t, $1_munin_plugin_exec_t)
|
|
|
1ec3d1a |
role system_r types $1_munin_plugin_t;
|
|
|
1ec3d1a |
|
|
Dominick Grift |
a1b9f2d |
type $1_munin_plugin_tmp_t, munin_plugin_tmp_content;
|
|
|
1ec3d1a |
typealias $1_munin_plugin_tmp_t alias munin_$1_plugin_tmp_t;
|
|
|
1ec3d1a |
files_tmp_file($1_munin_plugin_tmp_t)
|
|
|
1ec3d1a |
|
|
Dominick Grift |
bdbe670 |
########################################
|
|
|
b43f464 |
#
|
|
|
b43f464 |
# Policy
|
|
|
b43f464 |
#
|
|
Dominick Grift |
bdbe670 |
|
|
|
b43f464 |
# automatic transition rules from munin domain
|
|
|
b43f464 |
# to specific munin plugin domain
|
|
Dominick Grift |
bdbe670 |
domtrans_pattern(munin_t, $1_munin_plugin_exec_t, $1_munin_plugin_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
manage_files_pattern($1_munin_plugin_t, $1_munin_plugin_tmp_t, $1_munin_plugin_tmp_t)
|
|
|
1ec3d1a |
manage_dirs_pattern($1_munin_plugin_t, $1_munin_plugin_tmp_t, $1_munin_plugin_tmp_t)
|
|
|
1ec3d1a |
files_tmp_filetrans($1_munin_plugin_t, $1_munin_plugin_tmp_t, { dir file })
|
|
|
1bafb67 |
|
|
|
1bafb67 |
kernel_read_system_state($1_munin_plugin_t)
|
|
|
1f86dac |
|
|
|
1f86dac |
corenet_all_recvfrom_unlabeled($1_munin_plugin_t)
|
|
|
1f86dac |
corenet_all_recvfrom_netlabel($1_munin_plugin_t)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
########################################
|
|
|
1ec3d1a |
## <summary>
|
|
|
1ec3d1a |
## Connect to munin over a unix domain
|
|
|
1ec3d1a |
## stream socket.
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## <param name="domain">
|
|
|
1ec3d1a |
## <summary>
|
|
|
1ec3d1a |
## Domain allowed access.
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## </param>
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
interface(`munin_stream_connect',`
|
|
|
1ec3d1a |
gen_require(`
|
|
|
1ec3d1a |
type munin_var_run_t, munin_t;
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
files_search_pids($1)
|
|
|
1ec3d1a |
stream_connect_pattern($1, munin_var_run_t, munin_var_run_t, munin_t)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
#######################################
|
|
|
1ec3d1a |
## <summary>
|
|
|
b43f464 |
## Read munin configuration files.
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## <param name="domain">
|
|
|
1ec3d1a |
## <summary>
|
|
|
1ec3d1a |
## Domain allowed access.
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## </param>
|
|
|
1ec3d1a |
## <rolecap/>
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
interface(`munin_read_config',`
|
|
|
1ec3d1a |
gen_require(`
|
|
|
1ec3d1a |
type munin_etc_t;
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
allow $1 munin_etc_t:dir list_dir_perms;
|
|
|
1ec3d1a |
allow $1 munin_etc_t:file read_file_perms;
|
|
|
1ec3d1a |
allow $1 munin_etc_t:lnk_file read_lnk_file_perms;
|
|
|
1ec3d1a |
files_search_etc($1)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
9629a6c |
#######################################
|
|
|
9629a6c |
## <summary>
|
|
|
9629a6c |
## Read munin library files.
|
|
|
9629a6c |
## </summary>
|
|
|
9629a6c |
## <param name="domain">
|
|
|
9629a6c |
## <summary>
|
|
|
9629a6c |
## Domain allowed access.
|
|
|
9629a6c |
## </summary>
|
|
|
9629a6c |
## </param>
|
|
|
9629a6c |
#
|
|
|
9629a6c |
interface(`munin_read_var_lib_files',`
|
|
|
9629a6c |
gen_require(`
|
|
|
9629a6c |
type munin_var_lib_t;
|
|
|
9629a6c |
')
|
|
|
9629a6c |
|
|
|
9629a6c |
files_search_var_lib($1)
|
|
|
9629a6c |
read_files_pattern($1, munin_var_lib_t, munin_var_lib_t)
|
|
|
9629a6c |
|
|
|
9629a6c |
')
|
|
|
9629a6c |
|
|
|
1ec3d1a |
######################################
|
|
|
1ec3d1a |
## <summary>
|
|
|
1ec3d1a |
## dontaudit read and write an leaked file descriptors
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## <param name="domain">
|
|
|
1ec3d1a |
## <summary>
|
|
|
1ec3d1a |
## Domain to not audit.
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## </param>
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
interface(`munin_dontaudit_leaks',`
|
|
|
1ec3d1a |
gen_require(`
|
|
|
1ec3d1a |
type munin_t;
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
dontaudit $1 munin_t:tcp_socket { read write };
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
#######################################
|
|
|
1ec3d1a |
## <summary>
|
|
|
1ec3d1a |
## Append to the munin log.
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## <param name="domain">
|
|
|
1ec3d1a |
## <summary>
|
|
|
1ec3d1a |
## Domain allowed access.
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## </param>
|
|
|
1ec3d1a |
## <rolecap/>
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
interface(`munin_append_log',`
|
|
|
1ec3d1a |
gen_require(`
|
|
|
1ec3d1a |
type munin_log_t;
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
logging_search_logs($1)
|
|
|
1ec3d1a |
allow $1 munin_log_t:dir list_dir_perms;
|
|
|
1ec3d1a |
append_files_pattern($1, munin_log_t, munin_log_t)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
#######################################
|
|
|
1ec3d1a |
## <summary>
|
|
|
1ec3d1a |
## Search munin library directories.
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## <param name="domain">
|
|
|
1ec3d1a |
## <summary>
|
|
|
1ec3d1a |
## Domain allowed access.
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## </param>
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
interface(`munin_search_lib',`
|
|
|
1ec3d1a |
gen_require(`
|
|
|
1ec3d1a |
type munin_var_lib_t;
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
allow $1 munin_var_lib_t:dir search_dir_perms;
|
|
|
1ec3d1a |
files_search_var_lib($1)
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
#######################################
|
|
|
1ec3d1a |
## <summary>
|
|
|
1ec3d1a |
## Do not audit attempts to search
|
|
|
1ec3d1a |
## munin library directories.
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## <param name="domain">
|
|
|
1ec3d1a |
## <summary>
|
|
|
1ec3d1a |
## Domain to not audit.
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## </param>
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
interface(`munin_dontaudit_search_lib',`
|
|
|
1ec3d1a |
gen_require(`
|
|
|
1ec3d1a |
type munin_var_lib_t;
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
dontaudit $1 munin_var_lib_t:dir search_dir_perms;
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
########################################
|
|
|
1ec3d1a |
## <summary>
|
|
|
b43f464 |
## All of the rules required to administrate
|
|
|
b43f464 |
## an munin environment
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## <param name="domain">
|
|
|
1ec3d1a |
## <summary>
|
|
|
1ec3d1a |
## Domain allowed access.
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## </param>
|
|
|
1ec3d1a |
## <param name="role">
|
|
|
1ec3d1a |
## <summary>
|
|
|
b43f464 |
## The role to be allowed to manage the munin domain.
|
|
|
1ec3d1a |
## </summary>
|
|
|
1ec3d1a |
## </param>
|
|
|
1ec3d1a |
## <rolecap/>
|
|
|
1ec3d1a |
#
|
|
|
1ec3d1a |
interface(`munin_admin',`
|
|
|
1ec3d1a |
gen_require(`
|
|
Dominick Grift |
a1b9f2d |
attribute munin_plugin_domain, munin_plugin_tmp_content;
|
|
|
1ec3d1a |
type munin_t, munin_etc_t, munin_tmp_t;
|
|
|
1ec3d1a |
type munin_log_t, munin_var_lib_t, munin_var_run_t;
|
|
|
b43f464 |
type httpd_munin_content_t, munin_plugin_state_t, munin_initrc_exec_t;
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
allow $1 munin_t:process signal_perms;
|
|
|
1ec3d1a |
ps_process_pattern($1, munin_t)
|
|
|
b43f464 |
|
|
|
1ec3d1a |
tunable_policy(`deny_ptrace',`',`
|
|
|
1ec3d1a |
allow $1 munin_t:process ptrace;
|
|
|
1ec3d1a |
')
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
init_labeled_script_domtrans($1, munin_initrc_exec_t)
|
|
|
1ec3d1a |
domain_system_change_exemption($1)
|
|
|
1ec3d1a |
role_transition $2 munin_initrc_exec_t system_r;
|
|
|
1ec3d1a |
allow $2 system_r;
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
files_list_tmp($1)
|
|
Dominick Grift |
a1b9f2d |
admin_pattern($1, { munin_tmp_t munin_plugin_tmp_content })
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
logging_list_logs($1)
|
|
|
1ec3d1a |
admin_pattern($1, munin_log_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
files_list_etc($1)
|
|
|
1ec3d1a |
admin_pattern($1, munin_etc_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
files_list_var_lib($1)
|
|
Dominick Grift |
bdbe670 |
admin_pattern($1, { munin_var_lib_t munin_plugin_state_t })
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
files_list_pids($1)
|
|
|
1ec3d1a |
admin_pattern($1, munin_var_run_t)
|
|
|
1ec3d1a |
|
|
|
1ec3d1a |
admin_pattern($1, httpd_munin_content_t)
|
|
|
1ec3d1a |
')
|