Skip to contentSkip to conversation

policy update for dnsmasq

PATCH Greg Norris 1 participant 1 message Sep 15, 2004 SELinux security module

lore
Share & tools
lore
#0 lore raw

I've attached a small patch against the dnsmasq policy, which provides the updates indicated below. Thanx to Simon Kelley, author of this wondrous beastie, for bringing the relevant enhancements to my attention. ;-)

1) Allow binding to port 53 TCP. Beginning with version 2.10, dnsmasq supports DNS queries over both TCP and UDP.

2) Allow the creation of RAWIP sockets, in order to enable ICMP echo requests. This is used as a sanity-check before assigning an IP address via DHCP, to ensure that it isn't already in use.

I've been running with the modified policy for the past few days (while trying to stress it appropriately), and everything appears to be working as expected... I think it's ready to be merged into CVS. As always, comments are most welcome.

dnsmasq.te renamed from dnsmasq.te.orig +2 -1
@@ -18,12 +18,13 @@
 # network-related goodies
 can_network(dnsmasq_t)
 allow dnsmasq_t self:packet_socket create_socket_perms;
+allow dnsmasq_t self:rawip_socket create_socket_perms;
 allow dnsmasq_t self:unix_dgram_socket create_socket_perms;
 allow dnsmasq_t self:unix_stream_socket create_stream_socket_perms;
 
 # UDP ports 53 and 67
 allow dnsmasq_t dhcpd_port_t:udp_socket name_bind;
-allow dnsmasq_t dns_port_t:udp_socket name_bind;
+allow dnsmasq_t dns_port_t:{ tcp_socket udp_socket } name_bind;
 
 # By default, dnsmasq binds to the wildcard address to listen for DNS requests.
 # Comment out the following entry if you do not want to allow this behaviour.