|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
0251df |
policy_module(nagios,1.2.0)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# Declarations
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type nagios_t;
|
|
Chris PeBenito |
17de1b |
type nagios_exec_t;
|
|
Chris PeBenito |
17de1b |
init_daemon_domain(nagios_t,nagios_exec_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type nagios_cgi_t;
|
|
Chris PeBenito |
17de1b |
type nagios_cgi_exec_t;
|
|
Chris PeBenito |
17de1b |
init_system_domain(nagios_cgi_t,nagios_cgi_exec_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type nagios_etc_t;
|
|
Chris PeBenito |
17de1b |
files_config_file(nagios_etc_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type nagios_log_t;
|
|
Chris PeBenito |
17de1b |
logging_log_file(nagios_log_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type nagios_tmp_t;
|
|
Chris PeBenito |
17de1b |
files_tmp_file(nagios_tmp_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type nagios_var_run_t;
|
|
Chris PeBenito |
17de1b |
files_pid_file(nagios_var_run_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type nrpe_t;
|
|
Chris PeBenito |
17de1b |
type nrpe_exec_t;
|
|
Chris PeBenito |
17de1b |
init_daemon_domain(nrpe_t,nrpe_exec_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type nrpe_etc_t;
|
|
Chris PeBenito |
17de1b |
files_config_file(nrpe_etc_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# Nagios local policy
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow nagios_t self:capability { dac_override setgid setuid };
|
|
Chris PeBenito |
17de1b |
dontaudit nagios_t self:capability sys_tty_config;
|
|
Chris PeBenito |
17de1b |
allow nagios_t self:process { setpgid signal_perms };
|
|
Chris PeBenito |
17de1b |
allow nagios_t self:fifo_file rw_file_perms;
|
|
Chris PeBenito |
17de1b |
allow nagios_t self:tcp_socket create_stream_socket_perms;
|
|
Chris PeBenito |
17de1b |
allow nagios_t self:udp_socket create_socket_perms;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
read_files_pattern(nagios_t,nagios_etc_t,nagios_etc_t)
|
|
Chris PeBenito |
c0868a |
read_lnk_files_pattern(nagios_t,nagios_etc_t,nagios_etc_t)
|
|
Chris PeBenito |
c0868a |
allow nagios_t nagios_etc_t:dir list_dir_perms;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
manage_files_pattern(nagios_t,nagios_log_t,nagios_log_t)
|
|
Chris PeBenito |
c0868a |
manage_fifo_files_pattern(nagios_t,nagios_log_t,nagios_log_t)
|
|
Chris PeBenito |
17de1b |
logging_log_filetrans(nagios_t,nagios_log_t,{ file dir })
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
manage_dirs_pattern(nagios_t,nagios_tmp_t,nagios_tmp_t)
|
|
Chris PeBenito |
c0868a |
manage_files_pattern(nagios_t,nagios_tmp_t,nagios_tmp_t)
|
|
Chris PeBenito |
17de1b |
files_tmp_filetrans(nagios_t, nagios_tmp_t, { file dir })
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
manage_files_pattern(nagios_t,nagios_var_run_t,nagios_var_run_t)
|
|
Chris PeBenito |
17de1b |
files_pid_filetrans(nagios_t,nagios_var_run_t,file)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
kernel_read_system_state(nagios_t)
|
|
Chris PeBenito |
17de1b |
kernel_read_kernel_sysctls(nagios_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
corecmd_exec_bin(nagios_t)
|
|
Chris PeBenito |
17de1b |
corecmd_exec_shell(nagios_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
corenet_non_ipsec_sendrecv(nagios_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_generic_if(nagios_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_sendrecv_generic_if(nagios_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_all_nodes(nagios_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_sendrecv_all_nodes(nagios_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_all_ports(nagios_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_sendrecv_all_ports(nagios_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
dev_read_sysfs(nagios_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
domain_use_interactive_fds(nagios_t)
|
|
Chris PeBenito |
17de1b |
# for ps
|
|
Chris PeBenito |
17de1b |
domain_read_all_domains_state(nagios_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
files_read_etc_files(nagios_t)
|
|
Chris PeBenito |
17de1b |
files_read_etc_runtime_files(nagios_t)
|
|
Chris PeBenito |
17de1b |
files_read_kernel_symbol_table(nagios_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
fs_getattr_all_fs(nagios_t)
|
|
Chris PeBenito |
17de1b |
fs_search_auto_mountpoints(nagios_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# for who
|
|
Chris PeBenito |
17de1b |
init_read_utmp(nagios_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
libs_use_ld_so(nagios_t)
|
|
Chris PeBenito |
17de1b |
libs_use_shared_libs(nagios_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
logging_send_syslog_msg(nagios_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
miscfiles_read_localization(nagios_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
sysnet_read_config(nagios_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
userdom_dontaudit_use_unpriv_user_fds(nagios_t)
|
|
Chris PeBenito |
17de1b |
userdom_dontaudit_search_sysadm_home_dirs(nagios_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
mta_send_mail(nagios_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
ifdef(`targeted_policy',`
|
|
Chris PeBenito |
17de1b |
term_dontaudit_use_unallocated_ttys(nagios_t)
|
|
Chris PeBenito |
17de1b |
term_dontaudit_use_generic_ptys(nagios_t)
|
|
Chris PeBenito |
17de1b |
files_dontaudit_read_root_files(nagios_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
netutils_domtrans_ping(nagios_t)
|
|
Chris PeBenito |
17de1b |
netutils_signal_ping(nagios_t)
|
|
Chris PeBenito |
17de1b |
netutils_kill_ping(nagios_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# cjp: leaked file descriptors:
|
|
Chris PeBenito |
17de1b |
#dontaudit ping_t nagios_etc_t:file read;
|
|
Chris PeBenito |
17de1b |
#dontaudit ping_t nagios_log_t:fifo_file read;
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
nis_use_ypbind(nagios_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
seutil_sigchld_newrole(nagios_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
udev_read_db(nagios_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# cjp: leaked file descriptors:
|
|
Chris PeBenito |
17de1b |
# for open file handles
|
|
Chris PeBenito |
17de1b |
#dontaudit system_mail_t nagios_etc_t:file read;
|
|
Chris PeBenito |
17de1b |
#dontaudit system_mail_t nagios_log_t:fifo_file read;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# Nagios CGI local policy
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
allow nagios_cgi_t self:process signal_perms;
|
|
Chris PeBenito |
c0868a |
allow nagios_cgi_t self:fifo_file rw_fifo_file_perms;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
read_files_pattern(nagios_cgi_t,nagios_t,nagios_t)
|
|
Chris PeBenito |
c0868a |
read_lnk_files_pattern(nagios_cgi_t,nagios_t,nagios_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
allow nagios_cgi_t nagios_etc_t:dir list_dir_perms;
|
|
Chris PeBenito |
c0868a |
read_files_pattern(nagios_cgi_t,nagios_etc_t,nagios_etc_t)
|
|
Chris PeBenito |
c0868a |
read_lnk_files_pattern(nagios_cgi_t,nagios_etc_t,nagios_etc_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
allow nagios_cgi_t nagios_log_t:dir list_dir_perms;
|
|
Chris PeBenito |
c0868a |
read_files_pattern(nagios_cgi_t,nagios_etc_t,nagios_log_t)
|
|
Chris PeBenito |
c0868a |
read_lnk_files_pattern(nagios_cgi_t,nagios_etc_t,nagios_log_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
kernel_read_system_state(nagios_cgi_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
corecmd_exec_bin(nagios_cgi_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
domain_dontaudit_read_all_domains_state(nagios_cgi_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
files_read_etc_files(nagios_cgi_t)
|
|
Chris PeBenito |
17de1b |
files_read_etc_runtime_files(nagios_cgi_t)
|
|
Chris PeBenito |
17de1b |
files_read_kernel_symbol_table(nagios_cgi_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
libs_use_ld_so(nagios_cgi_t)
|
|
Chris PeBenito |
17de1b |
libs_use_shared_libs(nagios_cgi_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
logging_send_syslog_msg(nagios_cgi_t)
|
|
Chris PeBenito |
17de1b |
logging_search_logs(nagios_cgi_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
miscfiles_read_localization(nagios_cgi_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
apache_append_log(nagios_cgi_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# Nagios remote plugin executor local policy
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
dontaudit nrpe_t self:capability sys_tty_config;
|
|
Chris PeBenito |
17de1b |
allow nrpe_t self:process { setpgid signal_perms };
|
|
Chris PeBenito |
c0868a |
allow nrpe_t self:fifo_file rw_fifo_file_perms;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow nrpe_t nrpe_etc_t:file { getattr read };
|
|
Chris PeBenito |
17de1b |
files_search_etc(nrpe_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
kernel_read_system_state(nrpe_t)
|
|
Chris PeBenito |
17de1b |
kernel_read_kernel_sysctls(nrpe_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
corecmd_exec_bin(nrpe_t)
|
|
Chris PeBenito |
17de1b |
corecmd_exec_shell(nrpe_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
dev_read_sysfs(nrpe_t)
|
|
Chris PeBenito |
17de1b |
dev_read_urand(nrpe_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
domain_use_interactive_fds(nrpe_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
files_read_etc_runtime_files(nrpe_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
fs_search_auto_mountpoints(nrpe_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
libs_use_ld_so(nrpe_t)
|
|
Chris PeBenito |
17de1b |
libs_use_shared_libs(nrpe_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
logging_send_syslog_msg(nrpe_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
miscfiles_read_localization(nrpe_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
userdom_dontaudit_use_unpriv_user_fds(nrpe_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
ifdef(`targeted_policy',`
|
|
Chris PeBenito |
17de1b |
term_dontaudit_use_unallocated_ttys(nrpe_t)
|
|
Chris PeBenito |
17de1b |
term_dontaudit_use_generic_ptys(nrpe_t)
|
|
Chris PeBenito |
17de1b |
files_dontaudit_read_root_files(nrpe_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
inetd_tcp_service_domain(nrpe_t,nrpe_exec_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
seutil_sigchld_newrole(nrpe_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
udev_read_db(nrpe_t)
|
|
Chris PeBenito |
17de1b |
')
|