Chris PeBenito 17de1b
## <summary>small and secure DNS daemon</summary>
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 44b380
##	Create a set of derived types for djbdns
Chris PeBenito 17de1b
##	components that are directly supervised by daemontools.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="prefix">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito ff8f0a
##	The prefix to be used for deriving type names.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
template(`djbdns_daemontools_domain_template',`
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	type djbdns_$1_t;
Chris PeBenito 17de1b
	type djbdns_$1_exec_t;
Chris PeBenito 17de1b
	type djbdns_$1_conf_t;
Chris PeBenito 17de1b
	files_config_file(djbdns_$1_conf_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	domain_type(djbdns_$1_t)
Chris PeBenito 0bfccd
	domain_entry_file(djbdns_$1_t, djbdns_$1_exec_t)
Chris PeBenito 17de1b
	role system_r types djbdns_$1_t;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	daemontools_service_domain(djbdns_$1_t, djbdns_$1_exec_t)
Chris PeBenito 17de1b
	daemontools_read_svc(djbdns_$1_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow djbdns_$1_t self:capability { net_bind_service setgid setuid sys_chroot };
Chris PeBenito 44b380
	allow djbdns_$1_t self:process signal;
Chris PeBenito 44b380
	allow djbdns_$1_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 17de1b
	allow djbdns_$1_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 17de1b
	allow djbdns_$1_t self:udp_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito c0868a
	allow djbdns_$1_t djbdns_$1_conf_t:dir list_dir_perms;
Chris PeBenito c0868a
	allow djbdns_$1_t djbdns_$1_conf_t:file read_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 190066
	corenet_all_recvfrom_unlabeled(djbdns_$1_t)
Chris PeBenito 190066
	corenet_all_recvfrom_netlabel(djbdns_$1_t)
Chris PeBenito 668b30
	corenet_tcp_sendrecv_generic_if(djbdns_$1_t)
Chris PeBenito 668b30
	corenet_udp_sendrecv_generic_if(djbdns_$1_t)
Chris PeBenito c12621
	corenet_tcp_sendrecv_generic_node(djbdns_$1_t)
Chris PeBenito c12621
	corenet_udp_sendrecv_generic_node(djbdns_$1_t)
Chris PeBenito 17de1b
	corenet_tcp_sendrecv_all_ports(djbdns_$1_t)
Chris PeBenito 17de1b
	corenet_udp_sendrecv_all_ports(djbdns_$1_t)
Chris PeBenito c12621
	corenet_tcp_bind_generic_node(djbdns_$1_t)
Chris PeBenito c12621
	corenet_udp_bind_generic_node(djbdns_$1_t)
Chris PeBenito 17de1b
	corenet_tcp_bind_dns_port(djbdns_$1_t)
Chris PeBenito 17de1b
	corenet_udp_bind_dns_port(djbdns_$1_t)
Chris PeBenito 17de1b
	corenet_udp_bind_generic_port(djbdns_$1_t)
Chris PeBenito 17de1b
	corenet_sendrecv_dns_server_packets(djbdns_$1_t)
Chris PeBenito 17de1b
	corenet_sendrecv_generic_server_packets(djbdns_$1_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_var(djbdns_$1_t)
Chris PeBenito 17de1b
')
Chris PeBenito 44b380
Chris PeBenito 44b380
#####################################
Chris PeBenito 44b380
## <summary>
Chris PeBenito 44b380
##	Allow search the djbdns-tinydns key ring.
Chris PeBenito 44b380
## </summary>
Chris PeBenito 44b380
## <param name="domain">
Chris PeBenito 44b380
##	<summary>
Chris PeBenito 44b380
##	Domain allowed access.
Chris PeBenito 44b380
##	</summary>
Chris PeBenito 44b380
## </param>
Chris PeBenito 44b380
#
Chris PeBenito 44b380
interface(`djbdns_search_tinydns_keys',`
Chris PeBenito 44b380
	gen_require(`
Chris PeBenito 44b380
		type djbdns_tinydns_t;
Chris PeBenito 44b380
	')
Chris PeBenito 44b380
Chris PeBenito 44b380
	allow $1 djbdns_tinydns_t:key search;
Chris PeBenito 44b380
')
Chris PeBenito 44b380
Chris PeBenito 44b380
#####################################
Chris PeBenito 44b380
## <summary>
Chris PeBenito 44b380
##	Allow link to the djbdns-tinydns key ring.
Chris PeBenito 44b380
## </summary>
Chris PeBenito 44b380
## <param name="domain">
Chris PeBenito 44b380
##	<summary>
Chris PeBenito 44b380
##	Domain allowed access.
Chris PeBenito 44b380
##	</summary>
Chris PeBenito 44b380
## </param>
Chris PeBenito 44b380
#
Chris PeBenito 44b380
interface(`djbdns_link_tinydns_keys',`
Chris PeBenito 44b380
	gen_require(`
Chris PeBenito 44b380
		type djbdns_tinydn_t;
Chris PeBenito 44b380
	')
Chris PeBenito 44b380
Chris PeBenito 44b380
	allow $1 djbdns_tinydn_t:key link;
Chris PeBenito 44b380
')