aboutsummaryrefslogtreecommitdiff
blob: 8c0bd7086eacbf2e3dc585e4e8c7f1a9868e721c (plain)
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
policy_module(zabbix, 1.5.0)

########################################
#
# Declarations
#

type zabbix_t;
type zabbix_exec_t;
init_daemon_domain(zabbix_t, zabbix_exec_t)

type zabbix_initrc_exec_t;
init_script_file(zabbix_initrc_exec_t)

type zabbix_agent_t;
type zabbix_agent_exec_t;
init_daemon_domain(zabbix_agent_t, zabbix_agent_exec_t)

type zabbix_agent_initrc_exec_t;
init_script_file(zabbix_agent_initrc_exec_t)

# log files
type zabbix_log_t;
logging_log_file(zabbix_log_t)

# shared memory
type zabbix_tmpfs_t;
files_tmpfs_file(zabbix_tmpfs_t)

# pid files
type zabbix_var_run_t;
files_pid_file(zabbix_var_run_t)

########################################
#
# zabbix local policy
#

allow zabbix_t self:capability { setuid setgid };
allow zabbix_t self:fifo_file rw_file_perms;
allow zabbix_t self:process { setsched getsched signal };
allow zabbix_t self:unix_stream_socket create_stream_socket_perms;
allow zabbix_t self:sem create_sem_perms;
allow zabbix_t self:shm create_shm_perms;
allow zabbix_t self:tcp_socket create_stream_socket_perms;

# log files
allow zabbix_t zabbix_log_t:dir setattr;
manage_files_pattern(zabbix_t, zabbix_log_t, zabbix_log_t)
logging_log_filetrans(zabbix_t, zabbix_log_t, file)

# shared memory
rw_files_pattern(zabbix_t, zabbix_tmpfs_t, zabbix_tmpfs_t)
fs_tmpfs_filetrans(zabbix_t, zabbix_tmpfs_t, file)

# pid file
manage_dirs_pattern(zabbix_t, zabbix_var_run_t, zabbix_var_run_t)
manage_files_pattern(zabbix_t, zabbix_var_run_t, zabbix_var_run_t)
files_pid_filetrans(zabbix_t, zabbix_var_run_t, { dir file })

corenet_tcp_bind_generic_node(zabbix_t)
corenet_tcp_bind_zabbix_port(zabbix_t)

files_read_etc_files(zabbix_t)

miscfiles_read_localization(zabbix_t)

sysnet_dns_name_resolve(zabbix_t)

zabbix_agent_tcp_connect(zabbix_t)

optional_policy(`
	mysql_stream_connect(zabbix_t)
	mysql_tcp_connect(zabbix_t)
')

optional_policy(`
	postgresql_stream_connect(zabbix_t)
')

########################################
#
# zabbix agent local policy
#

allow zabbix_agent_t self:capability { setuid setgid };
allow zabbix_agent_t self:process { setsched getsched signal };
allow zabbix_agent_t self:fifo_file rw_file_perms;
allow zabbix_agent_t self:sem create_sem_perms;
allow zabbix_agent_t self:shm create_shm_perms;
allow zabbix_agent_t self:tcp_socket create_stream_socket_perms;
allow zabbix_agent_t self:unix_stream_socket create_stream_socket_perms;

# Logging access
filetrans_pattern(zabbix_agent_t, zabbix_log_t, zabbix_log_t, file)
manage_files_pattern(zabbix_agent_t, zabbix_log_t, zabbix_log_t)

# Shared Memory support
rw_files_pattern(zabbix_agent_t, zabbix_tmpfs_t, zabbix_tmpfs_t)
fs_tmpfs_filetrans(zabbix_agent_t, zabbix_tmpfs_t, file)

# PID file management
manage_files_pattern(zabbix_agent_t, zabbix_var_run_t, zabbix_var_run_t)
files_pid_filetrans(zabbix_agent_t, zabbix_var_run_t, file)

kernel_read_all_sysctls(zabbix_agent_t)
kernel_read_system_state(zabbix_agent_t)

corecmd_read_all_executables(zabbix_agent_t)

corenet_tcp_bind_generic_node(zabbix_agent_t)
corenet_tcp_bind_zabbix_agent_port(zabbix_agent_t)
corenet_tcp_connect_ssh_port(zabbix_agent_t)
corenet_tcp_connect_zabbix_port(zabbix_agent_t)

dev_getattr_all_blk_files(zabbix_agent_t)
dev_getattr_all_chr_files(zabbix_agent_t)

domain_search_all_domains_state(zabbix_agent_t)

files_getattr_all_dirs(zabbix_agent_t)
files_getattr_all_files(zabbix_agent_t)
files_read_all_symlinks(zabbix_agent_t)
files_read_etc_files(zabbix_agent_t)

fs_getattr_all_fs(zabbix_agent_t)

init_read_utmp(zabbix_agent_t)

logging_search_logs(zabbix_agent_t)

miscfiles_read_localization(zabbix_agent_t)

sysnet_dns_name_resolve(zabbix_agent_t)

# Network access to zabbix server
zabbix_tcp_connect(zabbix_agent_t)