## DNS forwarder and DHCP server. ######################################## ## ## Execute dnsmasq server in the dnsmasq domain. ## ## ## ## Domain allowed to transition. ## ## # # interface(`dnsmasq_domtrans',` gen_require(` type dnsmasq_exec_t, dnsmasq_t; ') corecmd_search_bin($1) domtrans_pattern($1, dnsmasq_exec_t, dnsmasq_t) ') ######################################## ## ## Execute the dnsmasq init script in ## the init script domain. ## ## ## ## Domain allowed to transition. ## ## # # interface(`dnsmasq_initrc_domtrans',` gen_require(` type dnsmasq_initrc_exec_t; ') init_labeled_script_domtrans($1, dnsmasq_initrc_exec_t) ') ######################################## ## ## Send generic signals to dnsmasq. ## ## ## ## Domain allowed access. ## ## # # interface(`dnsmasq_signal',` gen_require(` type dnsmasq_t; ') allow $1 dnsmasq_t:process signal; ') ######################################## ## ## Send null signals to dnsmasq. ## ## ## ## Domain allowed access. ## ## # # interface(`dnsmasq_signull',` gen_require(` type dnsmasq_t; ') allow $1 dnsmasq_t:process signull; ') ######################################## ## ## Send kill signals to dnsmasq. ## ## ## ## Domain allowed access. ## ## # # interface(`dnsmasq_kill',` gen_require(` type dnsmasq_t; ') allow $1 dnsmasq_t:process sigkill; ') ######################################## ## ## Read dnsmasq config files. ## ## ## ## Domain allowed access. ## ## # interface(`dnsmasq_read_config',` gen_require(` type dnsmasq_etc_t; ') read_files_pattern($1, dnsmasq_etc_t, dnsmasq_etc_t) files_search_etc($1) ') ######################################## ## ## Write dnsmasq config files. ## ## ## ## Domain allowed access. ## ## # interface(`dnsmasq_write_config',` gen_require(` type dnsmasq_etc_t; ') write_files_pattern($1, dnsmasq_etc_t, dnsmasq_etc_t) files_search_etc($1) ') ######################################## ## ## Delete dnsmasq pid files. ## ## ## ## Domain allowed access. ## ## # # interface(`dnsmasq_delete_pid_files',` gen_require(` type dnsmasq_var_run_t; ') delete_files_pattern($1, dnsmasq_var_run_t, dnsmasq_var_run_t) ') ######################################## ## ## Create, read, write, and delete ## dnsmasq pid files ## ## ## ## Domain allowed access. ## ## # interface(`dnsmasq_manage_pid_files',` gen_require(` type dnsmasq_var_run_t; ') files_search_pids($1) manage_files_pattern($1, dnsmasq_var_run_t, dnsmasq_var_run_t) ') ######################################## ## ## Read dnsmasq pid files. ## ## ## ## Domain allowed access. ## ## # # interface(`dnsmasq_read_pid_files',` gen_require(` type dnsmasq_var_run_t; ') read_files_pattern($1, dnsmasq_var_run_t, dnsmasq_var_run_t) ') ######################################## ## ## Create dnsmasq pid directories. ## ## ## ## Domain allowed access. ## ## # interface(`dnsmasq_create_pid_dirs',` gen_require(` type dnsmasq_var_run_t; ') files_search_pids($1) allow $1 dnsmasq_var_run_t:dir create_dir_perms; ') ######################################## ## ## Create specified objects in specified ## directories with a type transition to ## the dnsmasq pid file type. ## ## ## ## Domain allowed access. ## ## ## ## ## Directory to transition on. ## ## ## ## ## The object class of the object being created. ## ## ## ## ## The name of the object being created. ## ## # interface(`dnsmasq_spec_filetrans_pid',` gen_require(` type dnsmasq_var_run_t; ') filetrans_pattern($1, $2, dnsmasq_var_run_t, $3, $4) ') ######################################## ## ## All of the rules required to ## administrate an dnsmasq environment. ## ## ## ## Domain allowed access. ## ## ## ## ## Role allowed access. ## ## ## # interface(`dnsmasq_admin',` gen_require(` type dnsmasq_t, dnsmasq_lease_t, dnsmasq_var_run_t; type dnsmasq_initrc_exec_t, dnsmasq_var_log_t; ') allow $1 dnsmasq_t:process { ptrace signal_perms }; ps_process_pattern($1, dnsmasq_t) init_startstop_service($1, $2, dnsmasq_t, dnsmasq_initrc_exec_t) files_list_var_lib($1) admin_pattern($1, dnsmasq_lease_t) logging_search_logs($1) admin_pattern($1, dnsmasq_var_log_t) files_list_pids($1) admin_pattern($1, dnsmasq_var_run_t) ')