## Berkeley internet name domain DNS server.
########################################
##
## Execute ndc in the ndc domain.
##
##
## The type of the process performing this action.
##
#
interface(`bind_domtrans_ndc',`
gen_require(`
type ndc_t, ndc_exec_t;
class process sigchld;
class fd use;
class fifo_file rw_file_perms;
')
domain_auto_trans($1,ndc_exec_t,ndc_t)
allow $1 ndc_t:fd use;
allow ndc_t $1:fd use;
allow ndc_t $1:fifo_file rw_file_perms;
allow ndc_t $1:process sigchld;
')
########################################
##
## Execute ndc in the ndc domain, and
## allow the specified role the ndc domain.
##
##
## The type of the process performing this action.
##
##
## The role to be allowed the bind domain.
##
##
## The type of the terminal allow the bind domain to use.
##
#
interface(`bind_run_ndc',`
gen_require(`
type ndc_t;
class chr_file rw_term_perms;
')
bind_domtrans_ndc($1)
role $2 types ndc_t;
allow ndc_t $3:chr_file rw_term_perms;
')
########################################
##
## Read BIND named configuration files.
##
##
## Domain allowed access.
##
#
interface(`bind_read_config',`
gen_require(`
type named_conf_t;
class dir search;
class file { getattr read };
')
allow $1 named_conf_t:dir search;
allow $1 named_conf_t:file { getattr read };
')
########################################
##
## Write BIND named configuration files.
##
##
## Domain allowed access.
##
#
interface(`bind_write_config',`
gen_require(`
type named_conf_t;
class dir search;
class file { write setattr };
')
allow $1 named_conf_t:dir search;
allow $1 named_conf_t:file { write setattr };
')
########################################
##
## Do not audit attempts to set the attributes
## of the BIND pid directory.
##
##
## Domain allowed access.
##
#
interface(`bind_setattr_pid_dir',`
gen_require(`
type named_var_run_t;
class dir setattr;
')
allow $1 named_var_run_t:dir setattr;
')