forked from OwlCyberDefense/refpolicy-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmunin.te
426 lines (309 loc) · 10.7 KB
/
munin.te
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
policy_module(munin, 1.13.0)
########################################
#
# Declarations
#
attribute munin_plugin_domain;
attribute munin_plugin_tmp_content;
type munin_t alias lrrd_t;
type munin_exec_t alias lrrd_exec_t;
init_daemon_domain(munin_t, munin_exec_t)
type munin_etc_t alias lrrd_etc_t;
files_config_file(munin_etc_t)
type munin_initrc_exec_t;
init_script_file(munin_initrc_exec_t)
type munin_log_t alias lrrd_log_t;
logging_log_file(munin_log_t)
type munin_tmp_t alias lrrd_tmp_t;
files_tmp_file(munin_tmp_t)
type munin_var_lib_t alias lrrd_var_lib_t;
files_type(munin_var_lib_t)
type munin_plugin_state_t;
files_type(munin_plugin_state_t)
type munin_var_run_t alias lrrd_var_run_t;
files_pid_file(munin_var_run_t)
munin_plugin_template(disk)
munin_plugin_template(mail)
munin_plugin_template(selinux)
munin_plugin_template(services)
type services_munin_plugin_tmpfs_t;
files_tmpfs_file(services_munin_plugin_tmpfs_t)
munin_plugin_template(system)
munin_plugin_template(unconfined)
################################
#
# Common munin plugin local policy
#
allow munin_plugin_domain self:process signal;
allow munin_plugin_domain self:fifo_file rw_fifo_file_perms;
allow munin_plugin_domain munin_t:tcp_socket rw_socket_perms;
read_lnk_files_pattern(munin_plugin_domain, munin_etc_t, munin_etc_t)
allow munin_plugin_domain munin_exec_t:file read_file_perms;
allow munin_plugin_domain munin_var_lib_t:dir search_dir_perms;
manage_files_pattern(munin_plugin_domain, munin_plugin_state_t, munin_plugin_state_t)
kernel_read_system_state(munin_plugin_domain)
corenet_all_recvfrom_unlabeled(munin_plugin_domain)
corenet_all_recvfrom_netlabel(munin_plugin_domain)
corenet_tcp_sendrecv_generic_if(munin_plugin_domain)
corenet_tcp_sendrecv_generic_node(munin_plugin_domain)
corecmd_exec_bin(munin_plugin_domain)
corecmd_exec_shell(munin_plugin_domain)
files_read_etc_files(munin_plugin_domain)
files_read_usr_files(munin_plugin_domain)
files_search_var_lib(munin_plugin_domain)
fs_getattr_all_fs(munin_plugin_domain)
miscfiles_read_localization(munin_plugin_domain)
optional_policy(`
nscd_use(munin_plugin_domain)
')
########################################
#
# Local policy
#
allow munin_t self:capability { chown dac_override kill setgid setuid sys_rawio };
dontaudit munin_t self:capability sys_tty_config;
allow munin_t self:process { getsched setsched signal_perms };
allow munin_t self:unix_stream_socket { accept connectto listen };
allow munin_t self:unix_dgram_socket sendto;
allow munin_t self:tcp_socket { accept listen };
allow munin_t self:fifo_file manage_fifo_file_perms;
allow munin_t munin_plugin_domain:process signal_perms;
allow munin_t munin_etc_t:dir list_dir_perms;
allow munin_t munin_etc_t:file read_file_perms;
allow munin_t munin_etc_t:lnk_file read_lnk_file_perms;
manage_dirs_pattern(munin_t, munin_log_t, munin_log_t)
append_files_pattern(munin_t, munin_log_t, munin_log_t)
create_files_pattern(munin_t, munin_log_t, munin_log_t)
setattr_files_pattern(munin_t, munin_log_t, munin_log_t)
logging_log_filetrans(munin_t, munin_log_t, { file dir })
manage_dirs_pattern(munin_t, munin_tmp_t, munin_tmp_t)
manage_files_pattern(munin_t, munin_tmp_t, munin_tmp_t)
manage_sock_files_pattern(munin_t, munin_tmp_t, munin_tmp_t)
files_tmp_filetrans(munin_t, munin_tmp_t, { file dir sock_file })
manage_dirs_pattern(munin_t, munin_var_lib_t, munin_var_lib_t)
manage_files_pattern(munin_t, munin_var_lib_t, munin_var_lib_t)
manage_lnk_files_pattern(munin_t, munin_var_lib_t, munin_var_lib_t)
read_files_pattern(munin_t, munin_plugin_state_t, munin_plugin_state_t)
manage_dirs_pattern(munin_t, munin_var_run_t, munin_var_run_t)
manage_files_pattern(munin_t, munin_var_run_t, munin_var_run_t)
manage_sock_files_pattern(munin_t, munin_var_run_t, munin_var_run_t)
files_pid_filetrans(munin_t, munin_var_run_t, { dir file })
can_exec(munin_t, munin_exec_t)
kernel_read_system_state(munin_t)
kernel_read_network_state(munin_t)
kernel_read_all_sysctls(munin_t)
corecmd_exec_bin(munin_t)
corecmd_exec_shell(munin_t)
corenet_all_recvfrom_unlabeled(munin_t)
corenet_all_recvfrom_netlabel(munin_t)
corenet_tcp_sendrecv_generic_if(munin_t)
corenet_tcp_sendrecv_generic_node(munin_t)
corenet_tcp_bind_generic_node(munin_t)
corenet_sendrecv_munin_server_packets(munin_t)
corenet_tcp_bind_munin_port(munin_t)
corenet_sendrecv_munin_client_packets(munin_t)
corenet_tcp_connect_munin_port(munin_t)
corenet_tcp_sendrecv_munin_port(munin_t)
corenet_sendrecv_http_client_packets(munin_t)
corenet_tcp_connect_http_port(munin_t)
corenet_tcp_sendrecv_http_port(munin_t)
dev_read_sysfs(munin_t)
dev_read_urand(munin_t)
domain_use_interactive_fds(munin_t)
domain_read_all_domains_state(munin_t)
files_read_etc_runtime_files(munin_t)
files_read_usr_files(munin_t)
files_list_spool(munin_t)
fs_getattr_all_fs(munin_t)
fs_search_auto_mountpoints(munin_t)
auth_use_nsswitch(munin_t)
logging_send_syslog_msg(munin_t)
logging_read_all_logs(munin_t)
miscfiles_read_fonts(munin_t)
miscfiles_read_localization(munin_t)
miscfiles_setattr_fonts_cache_dirs(munin_t)
sysnet_exec_ifconfig(munin_t)
userdom_dontaudit_use_unpriv_user_fds(munin_t)
userdom_dontaudit_search_user_home_dirs(munin_t)
optional_policy(`
apache_content_template(munin)
manage_dirs_pattern(munin_t, httpd_munin_content_t, httpd_munin_content_t)
manage_files_pattern(munin_t, httpd_munin_content_t, httpd_munin_content_t)
apache_search_sys_content(munin_t)
')
optional_policy(`
cron_system_entry(munin_t, munin_exec_t)
')
optional_policy(`
fstools_domtrans(munin_t)
')
optional_policy(`
lpd_domtrans_lpr(munin_t)
')
optional_policy(`
mta_list_queue(munin_t)
mta_read_config(munin_t)
mta_read_queue(munin_t)
mta_send_mail(munin_t)
')
optional_policy(`
mysql_read_config(munin_t)
mysql_stream_connect(munin_t)
')
optional_policy(`
netutils_domtrans_ping(munin_t)
netutils_kill_ping(munin_t)
netutils_signal_ping(munin_t)
')
optional_policy(`
postfix_list_spool(munin_t)
postfix_getattr_all_spool_files(munin_t)
')
optional_policy(`
rpc_search_nfs_state_data(munin_t)
')
optional_policy(`
sendmail_read_log(munin_t)
')
optional_policy(`
seutil_sigchld_newrole(munin_t)
')
optional_policy(`
udev_read_db(munin_t)
')
###################################
#
# Disk local policy
#
allow disk_munin_plugin_t self:capability { sys_admin sys_rawio };
allow disk_munin_plugin_t self:tcp_socket create_stream_socket_perms;
rw_files_pattern(disk_munin_plugin_t, munin_var_lib_t, munin_var_lib_t)
corenet_sendrecv_hddtemp_client_packets(disk_munin_plugin_t)
corenet_tcp_connect_hddtemp_port(disk_munin_plugin_t)
corenet_tcp_sendrecv_hddtemp_port(disk_munin_plugin_t)
dev_getattr_all_blk_files(disk_munin_plugin_t)
dev_getattr_lvm_control(disk_munin_plugin_t)
dev_read_sysfs(disk_munin_plugin_t)
dev_read_urand(disk_munin_plugin_t)
files_read_etc_runtime_files(disk_munin_plugin_t)
fs_getattr_all_fs(disk_munin_plugin_t)
fs_getattr_all_dirs(disk_munin_plugin_t)
storage_getattr_fixed_disk_dev(disk_munin_plugin_t)
sysnet_read_config(disk_munin_plugin_t)
optional_policy(`
hddtemp_exec(disk_munin_plugin_t)
')
optional_policy(`
fstools_exec(disk_munin_plugin_t)
')
####################################
#
# Mail local policy
#
allow mail_munin_plugin_t self:capability dac_override;
rw_files_pattern(mail_munin_plugin_t, munin_var_lib_t, munin_var_lib_t)
dev_read_urand(mail_munin_plugin_t)
logging_read_generic_logs(mail_munin_plugin_t)
optional_policy(`
mta_list_queue(mail_munin_plugin_t)
mta_read_config(mail_munin_plugin_t)
mta_read_queue(mail_munin_plugin_t)
mta_send_mail(mail_munin_plugin_t)
')
optional_policy(`
nscd_use(mail_munin_plugin_t)
')
optional_policy(`
postfix_getattr_all_spool_files(mail_munin_plugin_t)
postfix_read_config(mail_munin_plugin_t)
postfix_list_spool(mail_munin_plugin_t)
')
optional_policy(`
sendmail_read_log(mail_munin_plugin_t)
')
##################################
#
# Selinux local policy
#
selinux_get_enforce_mode(selinux_munin_plugin_t)
###################################
#
# Service local policy
#
allow services_munin_plugin_t self:shm create_sem_perms;
allow services_munin_plugin_t self:sem create_sem_perms;
allow services_munin_plugin_t self:tcp_socket create_stream_socket_perms;
allow services_munin_plugin_t self:udp_socket create_socket_perms;
allow services_munin_plugin_t self:netlink_route_socket r_netlink_socket_perms;
manage_files_pattern(services_munin_plugin_t, services_munin_plugin_tmpfs_t, services_munin_plugin_tmpfs_t)
manage_dirs_pattern(services_munin_plugin_t, services_munin_plugin_tmpfs_t, services_munin_plugin_tmpfs_t)
fs_tmpfs_filetrans(services_munin_plugin_t, services_munin_plugin_tmpfs_t, { dir file })
corenet_sendrecv_all_client_packets(services_munin_plugin_t)
corenet_tcp_connect_all_ports(services_munin_plugin_t)
corenet_tcp_connect_http_port(services_munin_plugin_t)
corenet_tcp_sendrecv_all_ports(services_munin_plugin_t)
dev_read_urand(services_munin_plugin_t)
dev_read_rand(services_munin_plugin_t)
sysnet_read_config(services_munin_plugin_t)
optional_policy(`
bind_read_config(munin_services_plugin_t)
')
optional_policy(`
cups_read_config(services_munin_plugin_t)
cups_stream_connect(services_munin_plugin_t)
')
optional_policy(`
lpd_exec_lpr(services_munin_plugin_t)
')
optional_policy(`
mysql_read_config(services_munin_plugin_t)
mysql_stream_connect(services_munin_plugin_t)
')
optional_policy(`
netutils_domtrans_ping(services_munin_plugin_t)
')
optional_policy(`
nscd_use(services_munin_plugin_t)
')
optional_policy(`
postgresql_stream_connect(services_munin_plugin_t)
')
optional_policy(`
snmp_read_snmp_var_lib_files(services_munin_plugin_t)
')
optional_policy(`
sssd_stream_connect(services_munin_plugin_t)
')
optional_policy(`
varnishd_read_lib_files(services_munin_plugin_t)
')
##################################
#
# System local policy
#
allow system_munin_plugin_t self:capability net_admin;
allow system_munin_plugin_t self:udp_socket create_socket_perms;
rw_files_pattern(system_munin_plugin_t, munin_var_lib_t, munin_var_lib_t)
read_files_pattern(system_munin_plugin_t, munin_log_t, munin_log_t)
kernel_read_network_state(system_munin_plugin_t)
kernel_read_all_sysctls(system_munin_plugin_t)
dev_read_sysfs(system_munin_plugin_t)
dev_read_urand(system_munin_plugin_t)
domain_read_all_domains_state(system_munin_plugin_t)
files_read_usr_files(system_munin_plugin_t)
init_read_utmp(system_munin_plugin_t)
logging_search_logs(system_munin_plugin_t)
sysnet_exec_ifconfig(system_munin_plugin_t)
term_getattr_unallocated_ttys(system_munin_plugin_t)
term_getattr_all_ttys(system_munin_plugin_t)
term_getattr_all_ptys(system_munin_plugin_t)
optional_policy(`
bind_read_config(system_munin_plugin_t)
')
#######################################
#
# Unconfined plugin local policy
#
optional_policy(`
unconfined_domain(unconfined_munin_plugin_t)
')