## TCP/IP encryption ######################################## ## ## Execute ipsec in the ipsec domain. ## ## ## ## Domain allowed to transition. ## ## # interface(`ipsec_domtrans',` gen_require(` type ipsec_t, ipsec_exec_t; ') domtrans_pattern($1, ipsec_exec_t, ipsec_t) ') ####################################### ## ## Allow read/write ipsec pipes ## ## ## ## Domain allowed access. ## ## # interface(`ipsec_rw_inherited_pipes',` gen_require(` type ipsec_t; ') allow $1 ipsec_t:fifo_file rw_inherited_fifo_file_perms; ') ######################################## ## ## Connect to IPSEC using a unix domain stream socket. ## ## ## ## Domain allowed access. ## ## # interface(`ipsec_stream_connect',` gen_require(` type ipsec_t, ipsec_var_run_t; ') files_search_pids($1) stream_connect_pattern($1, ipsec_var_run_t, ipsec_var_run_t, ipsec_t) ') ######################################## ## ## Execute ipsec in the ipsec mgmt domain. ## ## ## ## Domain allowed access. ## ## # interface(`ipsec_domtrans_mgmt',` gen_require(` type ipsec_mgmt_t, ipsec_mgmt_exec_t; ') domtrans_pattern($1, ipsec_mgmt_exec_t, ipsec_mgmt_t) ') ####################################### ## ## Allow to create OBJECT in /etc with ipsec_key_file_t. ## ## ## ## Domain allowed access. ## ## # interface(`ipsec_filetrans_key_file',` gen_require(` type ipsec_key_file_t; ') files_etc_filetrans($1, ipsec_key_file_t, file) ') ####################################### ## ## Allow to manage ipsec key files. ## ## ## ## Domain allowed access. ## ## # interface(`ipsec_manage_key_file',` gen_require(` type ipsec_key_file_t; ') manage_files_pattern($1, ipsec_key_file_t, ipsec_key_file_t) files_etc_filetrans($1, ipsec_key_file_t, file, "ipsec.secrets") ') ######################################## ## ## Read the ipsec_mgmt_var_run_t files. ## ## ## ## Domain allowed access. ## ## # interface(`ipsec_mgmt_read_pid',` gen_require(` type ipsec_var_run_t; type ipsec_mgmt_var_run_t; ') files_search_pids($1) read_files_pattern($1, ipsec_var_run_t, ipsec_mgmt_var_run_t) ') ######################################## ## ## Connect to racoon using a unix domain stream socket. ## ## ## ## Domain allowed access. ## ## # interface(`ipsec_stream_connect_racoon',` gen_require(` type racoon_t, ipsec_var_run_t; ') files_search_pids($1) stream_connect_pattern($1, ipsec_var_run_t, ipsec_var_run_t, racoon_t) ') ######################################## ## ## Get the attributes of an IPSEC key socket. ## ## ## ## Domain allowed access. ## ## # interface(`ipsec_getattr_key_sockets',` gen_require(` type ipsec_t; ') allow $1 ipsec_t:key_socket getattr; ') ######################################## ## ## Execute the IPSEC management program in the caller domain. ## ## ## ## Domain allowed access. ## ## # interface(`ipsec_exec_mgmt',` gen_require(` type ipsec_exec_t; ') can_exec($1, ipsec_exec_t) ') ######################################## ## ## Send ipsec mgmt a general signal. ## ## ## ## Domain allowed access. ## ## # interface(`ipsec_signal_mgmt',` gen_require(` type ipsec_mgmt_t; ') allow $1 ipsec_mgmt_t:process signal; ') ######################################## ## ## Send ipsec mgmt a null signal. ## ## ## ## Domain allowed access. ## ## # interface(`ipsec_signull_mgmt',` gen_require(` type ipsec_mgmt_t; ') allow $1 ipsec_mgmt_t:process signull; ') ######################################## ## ## Send ipsec mgmt a kill signal. ## ## ## ## Domain allowed access. ## ## # interface(`ipsec_kill_mgmt',` gen_require(` type ipsec_mgmt_t; ') allow $1 ipsec_mgmt_t:process sigkill; ') ######################################## ## ## Send ipsec a general signal. ## ## ## ## Domain allowed access. ## ## # interface(`ipsec_signal',` gen_require(` type ipsec_t; ') allow $1 ipsec_t:process signal; ') ######################################## ## ## Send ipsec a null signal. ## ## ## ## Domain allowed access. ## ## # interface(`ipsec_signull',` gen_require(` type ipsec_t; ') allow $1 ipsec_t:process signull; ') ######################################## ## ## Send ipsec a kill signal. ## ## ## ## Domain allowed access. ## ## # interface(`ipsec_kill',` gen_require(` type ipsec_t; ') allow $1 ipsec_t:process sigkill; ') ###################################### ## ## Send and receive messages from ## ipsec-mgmt over dbus. ## ## ## ## Domain allowed access. ## ## # interface(`ipsec_mgmt_dbus_chat',` gen_require(` type ipsec_mgmt_t; class dbus send_msg; ') allow $1 ipsec_mgmt_t:dbus send_msg; allow ipsec_mgmt_t $1:dbus send_msg; ') ######################################## ## ## Read the IPSEC configuration ## ## ## ## Domain allowed access. ## ## ## # interface(`ipsec_read_config',` gen_require(` type ipsec_conf_file_t; ') files_search_etc($1) allow $1 ipsec_conf_file_t:file read_file_perms; allow $1 ipsec_conf_file_t:dir list_dir_perms; ') ######################################## ## ## Match the default SPD entry. ## ## ## ## Domain allowed access. ## ## # interface(`ipsec_match_default_spd',` gen_require(` type ipsec_spd_t; ') allow $1 ipsec_spd_t:association polmatch; allow $1 self:association sendto; allow $1 self:peer recv; ') ######################################## ## ## Set the context of a SPD entry to ## the default context. ## ## ## ## Domain allowed access. ## ## # interface(`ipsec_setcontext_default_spd',` gen_require(` type ipsec_spd_t; ') allow $1 ipsec_spd_t:association setcontext; ') ######################################## ## ## write the ipsec_var_run_t files. ## ## ## ## Domain allowed access. ## ## # interface(`ipsec_write_pid',` gen_require(` type ipsec_var_run_t; ') files_search_pids($1) write_files_pattern($1, ipsec_var_run_t, ipsec_var_run_t) ') ######################################## ## ## Allow read the IPSEC pid files. ## ## ## ## Domain allowed access. ## ## # interface(`ipsec_read_pid',` gen_require(` type ipsec_var_run_t; ') files_search_pids($1) read_files_pattern($1, ipsec_var_run_t, ipsec_var_run_t) read_sock_files_pattern($1, ipsec_var_run_t, ipsec_var_run_t) ') ######################################## ## ## Create, read, write, and delete the IPSEC pid files. ## ## ## ## Domain allowed access. ## ## # interface(`ipsec_manage_pid',` gen_require(` type ipsec_var_run_t; ') files_search_pids($1) manage_files_pattern($1, ipsec_var_run_t, ipsec_var_run_t) ') ######################################## ## ## Execute racoon in the racoon domain. ## ## ## ## Domain allowed to transition. ## ## # interface(`ipsec_domtrans_racoon',` gen_require(` type racoon_t, racoon_exec_t; ') domtrans_pattern($1, racoon_exec_t, racoon_t) ') ######################################## ## ## Execute racoon and allow the specified role the domain. ## ## ## ## Domain allowed to transition. ## ## ## ## ## Role allowed access. ## ## ## # interface(`ipsec_run_racoon',` gen_require(` type racoon_t; ') ipsec_domtrans_racoon($1) role $2 types racoon_t; ') ######################################## ## ## Execute setkey in the setkey domain. ## ## ## ## Domain allowed to transition. ## ## # interface(`ipsec_domtrans_setkey',` gen_require(` type setkey_t, setkey_exec_t; ') domtrans_pattern($1, setkey_exec_t, setkey_t) ') ######################################## ## ## Execute setkey and allow the specified role the domains. ## ## ## ## Domain allowed to transition. ## ## ## ## ## Role allowed access.. ## ## ## # interface(`ipsec_run_setkey',` gen_require(` type setkey_t; ') ipsec_domtrans_setkey($1) role $2 types setkey_t; ') ####################################### ## ## Execute strongswan in the ipsec_mgmt domain. ## ## ## ## Domain allowed to transition. ## ## # interface(`ipsec_mgmt_systemctl',` gen_require(` type ipsec_mgmt_unit_file_t; type ipsec_mgmt_t; ') systemd_exec_systemctl($1) init_reload_services($1) allow $1 ipsec_mgmt_unit_file_t:file read_file_perms; allow $1 ipsec_mgmt_unit_file_t:service manage_service_perms; ps_process_pattern($1, ipsec_mgmt_t) ')