## TCP/IP encryption
########################################
##
## Execute ipsec in the ipsec domain.
##
##
##
## The type of the process performing this action.
##
##
#
interface(`ipsec_domtrans',`
gen_require(`
type ipsec_t, ipsec_exec_t;
')
domtrans_pattern($1,ipsec_exec_t,ipsec_t)
')
########################################
##
## Connect to IPSEC using a unix domain stream socket.
##
##
##
## The type of the process performing this action.
##
##
#
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)
')
########################################
##
## Get the attributes of an IPSEC key socket.
##
##
##
## The type of the process performing this action.
##
##
#
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.
##
##
##
## The type of the process performing this action.
##
##
#
interface(`ipsec_exec_mgmt',`
gen_require(`
type ipsec_exec_t;
')
can_exec($1,ipsec_exec_t)
')
########################################
##
## Read the IPSEC configuration
##
##
##
## The type of the process performing this action.
##
##
##
#
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;
')
########################################
##
## 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;
')
########################################
##
## 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)
')
########################################
##
## Create, read, write, and delete the IPSEC pid files.
##
##
##
## The type of the process performing this action.
##
##
#
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.
##
##
##
## The type of the process performing this action.
##
##
#
interface(`ipsec_domtrans_racoon',`
gen_require(`
type racoon_t, racoon_exec_t;
')
domtrans_pattern($1,racoon_exec_t,racoon_t)
')
########################################
##
## Execute setkey in the setkey domain.
##
##
##
## The type of the process performing this action.
##
##
#
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 access.
##
##
##
##
## The role to be allowed the racoon and setkey domains.
##
##
##
#
interface(`ipsec_run_setkey',`
gen_require(`
type setkey_t;
')
ipsec_domtrans_setkey($1)
role $2 types setkey_t;
')