Skip to contentSkip to conversation

bind9 policy patch

PATCH Russell Coker 2 participants 2 messages Sep 15, 2002 – Sep 21, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

The attached patch for the policy is needed for bind9 operation.

Signature · 3 lines
I do not get viruses because I do not use MS software.
If you use Outlook then please do not put my email address in your
address-book so that WHEN you get a virus it won't use my address in the
Quoted 1 line

From field.

usr/share/selinux/policy/current/domains/program/dpkg.te renamed from usr/share/selinux/policy/default/domains/program/dpkg.te +3 -0
diff -ru /usr/share/selinux/policy/default/domains/program/dpkg.te /usr/share/selinux/policy/current/domains/program/dpkg.te
@@ -52,6 +52,9 @@
 ifdef(`apache.te', `
 domain_auto_trans(dpkg_t, httpd_exec_t, httpd_t)
 ')
+ifdef(`named.te', `
+file_type_auto_trans(dpkg_t, named_zone_t, rndc_conf_t)
+')
 
 # for apt
 type apt_t, domain, admin;
usr/share/selinux/policy/current/domains/program/named.te renamed from usr/share/selinux/policy/default/domains/program/named.te +7 -3
diff -ru /usr/share/selinux/policy/default/domains/program/named.te /usr/share/selinux/policy/current/domains/program/named.te
@@ -9,7 +9,8 @@
 #
 # Rules for the named_t domain.
 #
-type named_port_t,port_type;
+type named_port_t, port_type;
+type rndc_port_t, port_type;
 
 daemon_domain(named)
 # ndc_t is the domain for the ndc program
@@ -25,7 +26,8 @@
 allow named_t self:process setsched;
 
 # A type for configuration files of named.
-type named_conf_t, file_type,sysadmfile;
+type named_conf_t, file_type, sysadmfile;
+type rndc_conf_t, file_type, sysadmfile;
 
 # for primary zone files
 type named_zone_t, file_type, sysadmfile;
@@ -49,7 +51,7 @@
 
 # Bind to the named port.
 allow named_t named_port_t:udp_socket name_bind;
-allow named_t named_port_t:tcp_socket name_bind;
+allow named_t { named_port_t rndc_port_t }:tcp_socket name_bind;
 
 #read configuration files
 r_dir_file(named_t, named_conf_t)
@@ -89,6 +91,8 @@
 type ndc_exec_t, file_type,sysadmfile, exec_type;
 domain_auto_trans(sysadm_t, ndc_exec_t, ndc_t)
 uses_shlib(ndc_t)
+can_tcp_connect(ndc_t, named_t)
+allow { named_t ndc_t } rndc_conf_t:file { getattr read };
 
 allow ndc_t etc_t:dir r_dir_perms;
 allow ndc_t self:unix_stream_socket create_stream_socket_perms;
usr/share/selinux/policy/current/file_contexts/program/named.fc renamed from usr/share/selinux/policy/default/file_contexts/program/named.fc +1 -0
diff -ru /usr/share/selinux/policy/default/file_contexts/program/named.fc /usr/share/selinux/policy/current/file_contexts/program/named.fc
@@ -3,6 +3,7 @@
 /etc/named.conf       		system_u:object_r:named_conf_t
 /etc/bind(/.*)?			system_u:object_r:named_zone_t
 /etc/bind/named.conf		system_u:object_r:named_conf_t
+/etc/bind/rndc.key		system_u:object_r:rndc_conf_t
 /usr/sbin/named.*      		system_u:object_r:named_exec_t
 /usr/sbin/ndc			system_u:object_r:ndc_exec_t
 /var/cache/bind(/.*)?		system_u:object_r:named_cache_t
usr/share/selinux/policy/current/net_contexts renamed from usr/share/selinux/policy/default/net_contexts +1 -0
diff -ru /usr/share/selinux/policy/default/net_contexts /usr/share/selinux/policy/current/net_contexts
@@ -57,6 +57,7 @@
 ifdef(`rshd.te', `portcon tcp 514 system_u:object_r:rsh_port_t')
 ifdef(`lpd.te', `portcon tcp 515 system_u:object_r:printer_port_t')
 ifdef(`cups.te', `portcon tcp 631 system_u:object_r:ipp_port_t')
+ifdef(`named.te', `portcon tcp 953 system_u:object_r:rndc_port_t')
 ifdef(`use_pop', `
 portcon tcp 993 system_u:object_r:pop_port_t
 portcon tcp 995 system_u:object_r:pop_port_t
#1 lore raw
Quoted 1 line · Russell Coker

The attached patch for the policy is needed for bind9 operation.

Thanks, merged.

--
Stephen D. Smalley, NAI Labs
[email protected]

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.