## Service daemon with a D-BUS interface that provides a dynamic managed firewall.
########################################
##
## Read firewalld config
##
##
##
## Domain allowed access.
##
##
#
interface(`firewalld_read_config',`
gen_require(`
type firewalld_etc_rw_t;
')
files_search_etc($1)
read_files_pattern($1, firewalld_etc_rw_t, firewalld_etc_rw_t)
')
########################################
##
## Execute firewalld server in the firewalld domain.
##
##
##
## The type of the process performing this action.
##
##
#
interface(`firewalld_initrc_domtrans',`
gen_require(`
type firewalld_initrc_exec_t;
')
init_labeled_script_domtrans($1, firewalld_initrc_exec_t)
')
########################################
##
## Execute firewalld server in the firewalld domain.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`firewalld_systemctl',`
gen_require(`
type firewalld_t;
type firewalld_unit_file_t;
')
systemd_exec_systemctl($1)
init_reload_services($1)
allow $1 firewalld_unit_file_t:file read_file_perms;
allow $1 firewalld_unit_file_t:service manage_service_perms;
ps_process_pattern($1, firewalld_t)
')
########################################
##
## Send and receive messages from
## firewalld over dbus.
##
##
##
## Domain allowed access.
##
##
#
interface(`firewalld_dbus_chat',`
gen_require(`
type firewalld_t;
class dbus send_msg;
')
allow $1 firewalld_t:dbus send_msg;
allow firewalld_t $1:dbus send_msg;
')
########################################
##
## Dontaudit attempts to write
## firewalld tmp files.
##
##
##
## Domain to not audit.
##
##
#
interface(`firewalld_dontaudit_write_tmp_files',`
gen_require(`
type firewalld_tmp_t;
')
dontaudit $1 firewalld_tmp_t:file write;
')
########################################
##
## Read firewalld PID files.
##
##
##
## Domain allowed access.
##
##
#
interface(`firewalld_read_pid_files',`
gen_require(`
type firewalld_var_run_t;
')
files_search_pids($1)
allow $1 firewalld_var_run_t:file read_file_perms;
')
########################################
##
## Dontaudit read and write leaked firewalld file descriptors
##
##
##
## Domain to not audit.
##
##
#
interface(`firewalld_dontaudit_leaks',`
gen_require(`
type firewalld_tmpfs_t;
')
dontaudit $1 firewalld_tmpfs_t:file rw_inherited_file_perms;
')
########################################
##
## All of the rules required to administrate
## an firewalld environment
##
##
##
## Domain allowed access.
##
##
##
##
## Role allowed access.
##
##
##
#
interface(`firewalld_admin',`
gen_require(`
type firewalld_t, firewalld_initrc_exec_t;
type firewalld_etc_rw_t, firewalld_var_run_t;
type firewalld_var_log_t;
')
allow $1 firewalld_t:process signal_perms;
ps_process_pattern($1, firewalld_t)
tunable_policy(`deny_ptrace',`',`
allow $1 firewalld_t:process ptrace;
')
firewalld_initrc_domtrans($1)
domain_system_change_exemption($1)
role_transition $2 firewalld_initrc_exec_t system_r;
allow $2 system_r;
files_search_pids($1)
admin_pattern($1, firewalld_var_run_t)
logging_search_logs($1)
admin_pattern($1, firewalld_var_log_t)
admin_pattern($1, firewalld_etc_rw_t)
admin_pattern($1, firewalld_unit_file_t)
firewalld_systemctl($1)
allow $1 firewalld_unit_file_t:service all_service_perms;
')