|
Chris PeBenito |
2705f9 |
# DESC selinux policy for djbdns
|
|
Chris PeBenito |
2705f9 |
# http://cr.yp.to/djbdns.html
|
|
Chris PeBenito |
2705f9 |
#
|
|
Chris PeBenito |
2705f9 |
# Author: petre rodan <kaiowas@gentoo.org>
|
|
Chris PeBenito |
2705f9 |
#
|
|
Chris PeBenito |
2705f9 |
# this policy depends on ucspi-tcp and daemontools policies
|
|
Chris PeBenito |
2705f9 |
#
|
|
Chris PeBenito |
2705f9 |
|
|
Chris PeBenito |
2705f9 |
ifdef(`daemontools.te', `
|
|
Chris PeBenito |
2705f9 |
ifdef(`ucspi-tcp.te', `
|
|
Chris PeBenito |
2705f9 |
|
|
Chris PeBenito |
2705f9 |
define(`djbdns_daemon_domain', `
|
|
Chris PeBenito |
2705f9 |
type djbdns_$1_conf_t, file_type, sysadmfile;
|
|
Chris PeBenito |
2705f9 |
daemon_domain(djbdns_$1)
|
|
Chris PeBenito |
2705f9 |
domain_auto_trans( svc_run_t, djbdns_$1_exec_t, djbdns_$1_t)
|
|
Chris PeBenito |
2705f9 |
svc_ipc_domain(djbdns_$1_t)
|
|
Chris PeBenito |
2705f9 |
can_network(djbdns_$1_t)
|
|
Chris PeBenito |
2705f9 |
allow djbdns_$1_t port_type:tcp_socket name_connect;
|
|
Chris PeBenito |
2705f9 |
allow djbdns_$1_t dns_port_t:{ udp_socket tcp_socket } name_bind;
|
|
Chris PeBenito |
2705f9 |
allow djbdns_$1_t port_t:udp_socket name_bind;
|
|
Chris PeBenito |
2705f9 |
r_dir_file(djbdns_$1_t, djbdns_$1_conf_t)
|
|
Chris PeBenito |
2705f9 |
allow djbdns_$1_t self:capability { net_bind_service setgid setuid sys_chroot };
|
|
Chris PeBenito |
2705f9 |
allow djbdns_$1_t svc_svc_t:dir r_dir_perms;
|
|
Chris PeBenito |
2705f9 |
')
|
|
Chris PeBenito |
2705f9 |
|
|
Chris PeBenito |
2705f9 |
define(`djbdns_tcpserver_domain', `
|
|
Chris PeBenito |
2705f9 |
type djbdns_$1_conf_t, file_type, sysadmfile;
|
|
Chris PeBenito |
2705f9 |
daemon_domain(djbdns_$1)
|
|
Chris PeBenito |
2705f9 |
domain_auto_trans(utcpserver_t, djbdns_$1_exec_t, djbdns_$1_t)
|
|
Chris PeBenito |
2705f9 |
svc_ipc_domain(djbdns_$1_t)
|
|
Chris PeBenito |
2705f9 |
allow utcpserver_t dns_port_t:{ udp_socket tcp_socket } name_bind;
|
|
Chris PeBenito |
2705f9 |
r_dir_file(djbdns_$1_t, djbdns_$1_conf_t)
|
|
Chris PeBenito |
2705f9 |
allow djbdns_$1_t utcpserver_t:tcp_socket { read write };
|
|
Chris PeBenito |
2705f9 |
')
|
|
Chris PeBenito |
2705f9 |
|
|
Chris PeBenito |
2705f9 |
djbdns_daemon_domain(dnscache)
|
|
Chris PeBenito |
2705f9 |
# read seed file
|
|
Chris PeBenito |
2705f9 |
allow djbdns_dnscache_t svc_svc_t:file r_file_perms;
|
|
Chris PeBenito |
2705f9 |
|
|
Chris PeBenito |
2705f9 |
djbdns_daemon_domain(tinydns)
|
|
Chris PeBenito |
2705f9 |
|
|
Chris PeBenito |
2705f9 |
djbdns_tcpserver_domain(axfrdns)
|
|
Chris PeBenito |
2705f9 |
r_dir_file(djbdns_axfrdns_t, djbdns_tinydns_t)
|
|
Chris PeBenito |
2705f9 |
|
|
Chris PeBenito |
2705f9 |
') dnl ifdef ucspi-tcp.te
|
|
Chris PeBenito |
2705f9 |
') dnl ifdef daemontools.te
|