forked from fedora-selinux/selinux-policy-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bind.te
310 lines (230 loc) · 7.63 KB
/
bind.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
policy_module(bind, 1.13.1)
########################################
#
# Declarations
#
## <desc>
## <p>
## Determine whether Bind can bind tcp socket to http ports.
## </p>
## </desc>
gen_tunable(named_tcp_bind_http_port, false)
## <desc>
## <p>
## Determine whether Bind can write to master zone files.
## Generally this is used for dynamic DNS or zone transfers.
## </p>
## </desc>
gen_tunable(named_write_master_zones, false)
attribute_role ndc_roles;
type dnssec_t;
files_security_file(dnssec_t)
files_mountpoint(dnssec_t)
type named_t;
type named_exec_t;
init_daemon_domain(named_t, named_exec_t)
type named_checkconf_exec_t;
init_system_domain(named_t, named_checkconf_exec_t)
type named_conf_t;
files_config_file(named_conf_t)
files_mountpoint(named_conf_t)
# for secondary zone files
type named_cache_t;
files_type(named_cache_t)
type named_initrc_exec_t;
init_script_file(named_initrc_exec_t)
type named_unit_file_t;
systemd_unit_file(named_unit_file_t)
type named_keytab_t;
files_type(named_keytab_t)
type named_log_t;
logging_log_file(named_log_t)
type named_tmp_t;
files_tmp_file(named_tmp_t)
type named_var_run_t;
files_pid_file(named_var_run_t)
init_daemon_run_dir(named_var_run_t, "named")
# for primary zone files
type named_zone_t;
files_type(named_zone_t)
type ndc_t;
type ndc_exec_t;
init_system_domain(ndc_t, ndc_exec_t)
role ndc_roles types ndc_t;
########################################
#
# Local policy
#
allow named_t self:capability { chown dac_read_search dac_override fowner net_admin net_raw setgid setuid sys_chroot sys_nice sys_resource };
dontaudit named_t self:capability sys_tty_config;
allow named_t self:capability2 block_suspend;
allow named_t self:process { setsched getcap setcap setrlimit signal_perms };
allow named_t self:fifo_file rw_fifo_file_perms;
allow named_t self:unix_stream_socket { accept listen };
allow named_t self:tcp_socket { accept listen };
allow named_t dnssec_t:file read_file_perms;
allow named_t named_conf_t:dir list_dir_perms;
read_files_pattern(named_t, named_conf_t, named_conf_t)
read_lnk_files_pattern(named_t, named_conf_t, named_conf_t)
manage_dirs_pattern(named_t, named_cache_t, named_cache_t)
manage_files_pattern(named_t, named_cache_t, named_cache_t)
manage_lnk_files_pattern(named_t, named_cache_t, named_cache_t)
allow named_t named_keytab_t:file read_file_perms;
manage_files_pattern(named_t, named_log_t, named_log_t)
logging_log_filetrans(named_t, named_log_t, file)
manage_dirs_pattern(named_t, named_tmp_t, named_tmp_t)
manage_files_pattern(named_t, named_tmp_t, named_tmp_t)
files_tmp_filetrans(named_t, named_tmp_t, { file dir })
manage_dirs_pattern(named_t, named_var_run_t, named_var_run_t)
manage_files_pattern(named_t, named_var_run_t, named_var_run_t)
manage_sock_files_pattern(named_t, named_var_run_t, named_var_run_t)
files_pid_filetrans(named_t, named_var_run_t, { dir file sock_file })
can_exec(named_t, named_exec_t)
allow named_t named_zone_t:dir list_dir_perms;
read_files_pattern(named_t, named_zone_t, named_zone_t)
read_lnk_files_pattern(named_t, named_zone_t, named_zone_t)
kernel_read_kernel_sysctls(named_t)
kernel_read_system_state(named_t)
kernel_read_network_state(named_t)
kernel_read_net_sysctls(named_t)
corecmd_search_bin(named_t)
corenet_all_recvfrom_netlabel(named_t)
corenet_tcp_sendrecv_generic_if(named_t)
corenet_udp_sendrecv_generic_if(named_t)
corenet_tcp_sendrecv_generic_node(named_t)
corenet_udp_sendrecv_generic_node(named_t)
corenet_tcp_bind_generic_node(named_t)
corenet_udp_bind_generic_node(named_t)
corenet_sendrecv_all_server_packets(named_t)
corenet_tcp_bind_dns_port(named_t)
corenet_udp_bind_dns_port(named_t)
corenet_udp_bind_ipp_port(named_t)
corenet_udp_bind_rtsp_port(named_t)
corenet_udp_bind_dhcpc_port(named_t)
corenet_udp_bind_kerberos_port(named_t)
corenet_udp_bind_flash_port(named_t)
corenet_udp_bind_bgp_port(named_t)
corenet_tcp_sendrecv_dns_port(named_t)
corenet_udp_sendrecv_dns_port(named_t)
corenet_udp_bind_whois_port(named_t)
corenet_tcp_bind_rndc_port(named_t)
corenet_tcp_sendrecv_rndc_port(named_t)
corenet_dontaudit_udp_bind_all_reserved_ports(named_t)
corenet_udp_bind_all_unreserved_ports(named_t)
corenet_udp_sendrecv_all_ports(named_t)
corenet_sendrecv_all_client_packets(named_t)
corenet_tcp_connect_all_ports(named_t)
corenet_tcp_sendrecv_all_ports(named_t)
corenet_tcp_bind_all_ephemeral_ports(named_t)
corenet_udp_bind_all_ephemeral_ports(named_t)
dev_read_sysfs(named_t)
dev_read_rand(named_t)
dev_read_urand(named_t)
dev_dontaudit_write_urand(named_t)
domain_use_interactive_fds(named_t)
files_read_etc_runtime_files(named_t)
files_mmap_usr_files(named_t)
fs_getattr_all_fs(named_t)
fs_search_auto_mountpoints(named_t)
auth_use_nsswitch(named_t)
logging_send_syslog_msg(named_t)
miscfiles_read_generic_certs(named_t)
miscfiles_read_localization(named_t)
userdom_dontaudit_use_unpriv_user_fds(named_t)
userdom_dontaudit_search_user_home_dirs(named_t)
tunable_policy(`named_tcp_bind_http_port',`
corenet_sendrecv_http_server_packets(named_t)
corenet_tcp_bind_http_port(named_t)
corenet_tcp_sendrecv_http_port(named_t)
')
tunable_policy(`named_write_master_zones',`
manage_dirs_pattern(named_t, named_zone_t, named_zone_t)
manage_files_pattern(named_t, named_zone_t, named_zone_t)
manage_lnk_files_pattern(named_t, named_zone_t, named_zone_t)
')
optional_policy(`
cron_system_entry(named_t, named_exec_t)
')
optional_policy(`
# needed by FreeIPA with DNS support
dirsrv_stream_connect(named_t)
')
optional_policy(`
dnssec_trigger_manage_pid_files(named_t)
')
optional_policy(`
dbus_system_domain(named_t, named_exec_t)
init_dbus_chat_script(named_t)
sysnet_dbus_chat_dhcpc(named_t)
optional_policy(`
networkmanager_dbus_chat(named_t)
')
')
optional_policy(`
ipa_manage_lib(named_t)
')
optional_policy(`
ipsec_rw_inherited_pipes(named_t)
')
optional_policy(`
kerberos_filetrans_named_content(named_t)
kerberos_read_keytab(named_t)
kerberos_read_host_rcache(named_t)
kerberos_use(named_t)
')
optional_policy(`
ldap_stream_connect(named_t)
')
optional_policy(`
networkmanager_rw_udp_sockets(named_t)
networkmanager_rw_packet_sockets(named_t)
networkmanager_rw_routing_sockets(named_t)
')
optional_policy(`
seutil_sigchld_newrole(named_t)
')
optional_policy(`
udev_read_db(named_t)
')
########################################
#
# NDC local policy
#
allow ndc_t self:capability { dac_read_search net_admin };
allow ndc_t self:capability2 block_suspend;
allow ndc_t self:process { fork signal_perms };
allow ndc_t self:fifo_file rw_fifo_file_perms;
allow ndc_t self:unix_stream_socket { accept listen };
allow ndc_t dnssec_t:file read_file_perms;
allow ndc_t dnssec_t:lnk_file read_lnk_file_perms;
stream_connect_pattern(ndc_t, named_var_run_t, named_var_run_t, named_t)
allow ndc_t named_conf_t:file read_file_perms;
allow ndc_t named_conf_t:lnk_file read_lnk_file_perms;
allow ndc_t named_zone_t:dir search_dir_perms;
kernel_read_system_state(ndc_t)
kernel_read_kernel_sysctls(ndc_t)
corenet_all_recvfrom_netlabel(ndc_t)
corenet_tcp_sendrecv_generic_if(ndc_t)
corenet_tcp_sendrecv_generic_node(ndc_t)
corenet_tcp_sendrecv_all_ports(ndc_t)
corenet_tcp_bind_generic_node(ndc_t)
corenet_tcp_connect_rndc_port(ndc_t)
corenet_sendrecv_rndc_client_packets(ndc_t)
dev_read_rand(ndc_t)
dev_read_urand(ndc_t)
domain_use_interactive_fds(ndc_t)
files_search_pids(ndc_t)
fs_getattr_xattr_fs(ndc_t)
term_dontaudit_use_console(ndc_t)
auth_use_nsswitch(ndc_t)
init_use_fds(ndc_t)
init_use_script_ptys(ndc_t)
logging_send_syslog_msg(ndc_t)
userdom_use_inherited_user_terminals(ndc_t)
userdom_use_user_terminals(ndc_t)
ifdef(`distro_redhat',`
allow ndc_t named_conf_t:dir search_dir_perms;
')
optional_policy(`
ppp_dontaudit_use_fds(ndc_t)
')