1 policy_module(icinga2, 0.1.2)
3 ########################################
9 type nagios_admin_plugin_t; type nagios_admin_plugin_exec_t;
10 type nagios_checkdisk_plugin_t; type nagios_checkdisk_plugin_exec_t;
11 type nagios_mail_plugin_t; type nagios_mail_plugin_exec_t;
12 type nagios_services_plugin_t; type nagios_services_plugin_exec_t;
13 type nagios_system_plugin_t; type nagios_system_plugin_exec_t;
14 type nagios_unconfined_plugin_t; type nagios_unconfined_plugin_exec_t;
15 type nagios_eventhandler_plugin_t; type nagios_eventhandler_plugin_exec_t;
16 type nagios_openshift_plugin_t; type nagios_openshift_plugin_exec_t;
17 type httpd_t; type system_mail_t;
23 init_daemon_domain(icinga2_t, icinga2_exec_t)
27 type icinga2_initrc_exec_t;
28 init_script_file(icinga2_initrc_exec_t)
30 type icinga2_unit_file_t;
31 systemd_unit_file(icinga2_unit_file_t)
34 files_config_file(icinga2_etc_t)
37 logging_log_file(icinga2_log_t)
39 type icinga2_var_lib_t;
40 files_type(icinga2_var_lib_t)
42 type icinga2_var_run_t;
43 files_pid_file(icinga2_var_run_t)
45 type icinga2_command_t;
46 files_type(icinga2_command_t)
49 files_type(icinga2_spool_t)
52 files_type(icinga2_cache_t)
55 files_tmp_file(icinga2_tmp_t)
58 corenet_port(icinga2_port_t)
60 ########################################
62 # icinga2 local policy
64 allow icinga2_t self:capability { setgid setuid sys_resource };
65 allow icinga2_t self:process { setsched signal setrlimit };
66 allow icinga2_t self:fifo_file rw_fifo_file_perms;
67 allow icinga2_t self:unix_stream_socket create_stream_socket_perms;
69 list_dirs_pattern(icinga2_t, icinga2_etc_t, icinga2_etc_t)
70 read_files_pattern(icinga2_t, icinga2_etc_t, icinga2_etc_t)
71 read_lnk_files_pattern(icinga2_t, icinga2_etc_t, icinga2_etc_t)
73 manage_dirs_pattern(icinga2_t, icinga2_log_t, icinga2_log_t)
74 manage_files_pattern(icinga2_t, icinga2_log_t, icinga2_log_t)
75 manage_lnk_files_pattern(icinga2_t, icinga2_log_t, icinga2_log_t)
76 logging_log_filetrans(icinga2_t, icinga2_log_t, { dir file lnk_file })
78 manage_dirs_pattern(icinga2_t, icinga2_var_lib_t, icinga2_var_lib_t)
79 manage_files_pattern(icinga2_t, icinga2_var_lib_t, icinga2_var_lib_t)
80 manage_lnk_files_pattern(icinga2_t, icinga2_var_lib_t, icinga2_var_lib_t)
81 files_var_lib_filetrans(icinga2_t, icinga2_var_lib_t, { dir file lnk_file })
83 manage_dirs_pattern(icinga2_t, icinga2_var_run_t, icinga2_var_run_t)
84 manage_files_pattern(icinga2_t, icinga2_var_run_t, icinga2_var_run_t)
85 files_pid_filetrans(icinga2_t, icinga2_var_run_t, { dir file })
87 manage_dirs_pattern(icinga2_t, icinga2_command_t, icinga2_command_t)
88 manage_files_pattern(icinga2_t, icinga2_command_t, icinga2_command_t)
89 manage_fifo_files_pattern(icinga2_t, icinga2_command_t, icinga2_command_t)
91 manage_dirs_pattern(icinga2_t, icinga2_spool_t, icinga2_spool_t)
92 manage_files_pattern(icinga2_t, icinga2_spool_t, icinga2_spool_t)
93 files_spool_filetrans(icinga2_t, icinga2_spool_t, { dir file })
95 manage_dirs_pattern(icinga2_t, icinga2_cache_t, icinga2_cache_t)
96 manage_files_pattern(icinga2_t, icinga2_cache_t, icinga2_cache_t)
98 manage_files_pattern(icinga2_t, icinga2_tmp_t, icinga2_tmp_t)
99 manage_dirs_pattern(icinga2_t, icinga2_tmp_t, icinga2_tmp_t)
100 files_tmp_filetrans(icinga2_t, icinga2_tmp_t, { dir file })
102 domain_use_interactive_fds(icinga2_t)
104 files_read_etc_files(icinga2_t)
106 auth_use_nsswitch(icinga2_t)
108 miscfiles_read_localization(icinga2_t)
110 corecmd_check_exec_shell(icinga2_t)
112 # should be moved to nagios_plugin_template in nagios.if
113 icinga2_execstrans(nagios_admin_plugin_exec_t, nagios_admin_plugin_t)
114 icinga2_execstrans(nagios_checkdisk_plugin_exec_t, nagios_checkdisk_plugin_t)
115 icinga2_execstrans(nagios_mail_plugin_exec_t, nagios_mail_plugin_t)
116 icinga2_execstrans(nagios_services_plugin_exec_t, nagios_services_plugin_t)
117 icinga2_execstrans(nagios_system_plugin_exec_t, nagios_system_plugin_t)
118 icinga2_execstrans(nagios_unconfined_plugin_exec_t, nagios_unconfined_plugin_t)
119 icinga2_execstrans(nagios_eventhandler_plugin_exec_t, nagios_eventhandler_plugin_t)
120 icinga2_execstrans(nagios_openshift_plugin_exec_t, nagios_openshift_plugin_t)
122 # should be moved nagios.te
123 nagios_plugin_template(notification)
124 icinga2_execstrans(nagios_notification_plugin_exec_t, nagios_notification_plugin_t)
125 allow nagios_notification_plugin_t nagios_notification_plugin_exec_t:dir search;
126 #permissive nagios_notification_plugin_t;
127 corecmd_exec_bin(nagios_notification_plugin_t)
128 type nagios_notification_plugin_tmp_t;
129 files_tmp_file(nagios_notification_plugin_tmp_t)
130 manage_files_pattern(nagios_notification_plugin_t, nagios_notification_plugin_tmp_t, nagios_notification_plugin_tmp_t)
131 manage_dirs_pattern(nagios_notification_plugin_t, nagios_notification_plugin_tmp_t, nagios_notification_plugin_tmp_t)
132 files_tmp_filetrans(nagios_notification_plugin_t, nagios_notification_plugin_tmp_t, { dir file })
133 auth_dontaudit_read_passwd(nagios_notification_plugin_t)
134 fs_dontaudit_getattr_xattr_fs(nagios_notification_plugin_t)
136 mta_send_mail(nagios_notification_plugin_t)
138 icinga2_dontaudit_leaks_fifo(system_mail_t)
140 allow icinga2_t icinga2_port_t:tcp_socket name_bind;
141 allow icinga2_t self:tcp_socket create_stream_socket_perms;
143 mysql_stream_connect(icinga2_t)
144 mysql_tcp_connect(icinga2_t)
145 postgresql_stream_connect(icinga2_t)
146 postgresql_tcp_connect(icinga2_t)
148 # graphite is using port 2003 which is lmtp_port_t
149 corenet_tcp_connect_lmtp_port(icinga2_t)
151 ########################################
153 # Icinga Webinterfaces
157 # should be a boolean in apache-policy
158 icinga2_send_commands(httpd_t)
161 ########################################
166 userdom_unpriv_user_template(icinga2adm)
168 icinga2_admin(icinga2adm_t, icinga2adm_r)
170 allow icinga2adm_t self:capability { dac_read_search dac_override };
172 # should be moved to staff.te
173 icinga2adm_role_change(staff_r)