Chris PeBenito 17de1b
## <summary>TCP/IP encryption</summary>
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute ipsec in the ipsec domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the process performing this action.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`ipsec_domtrans',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type ipsec_t, ipsec_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 3f67f7
	domtrans_pattern($1, ipsec_exec_t, ipsec_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Connect to IPSEC using a unix domain stream socket.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the process performing this action.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`ipsec_stream_connect',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type ipsec_t, ipsec_var_run_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_pids($1)
Chris PeBenito 3f67f7
	stream_connect_pattern($1, ipsec_var_run_t, ipsec_var_run_t, ipsec_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Get the attributes of an IPSEC key socket.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the process performing this action.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`ipsec_getattr_key_sockets',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type ipsec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 ipsec_t:key_socket getattr;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute the IPSEC management program in the caller domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the process performing this action.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`ipsec_exec_mgmt',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type ipsec_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 3f67f7
	can_exec($1, ipsec_exec_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read the IPSEC configuration
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the process performing this action.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`ipsec_read_config',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type ipsec_conf_file_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_etc($1)
Chris PeBenito c0868a
	allow $1 ipsec_conf_file_t:file read_file_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 982035
##	Match the default SPD entry.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 982035
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 982035
interface(`ipsec_match_default_spd',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 982035
		type ipsec_spd_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 982035
	allow $1 ipsec_spd_t:association polmatch;
Chris PeBenito 0b6aca
	allow $1 self:association sendto;
Chris PeBenito 17de1b
')
Chris PeBenito 9e8f65
Chris PeBenito 9e8f65
########################################
Chris PeBenito 9e8f65
## <summary>
Chris PeBenito 982035
##	Set the context of a SPD entry to
Chris PeBenito 982035
##	the default context.
Chris PeBenito bdccba
## </summary>
Chris PeBenito bdccba
## <param name="domain">
Chris PeBenito 982035
##	<summary>
Chris PeBenito 982035
##	Domain allowed access.
Chris PeBenito 982035
##	</summary>
Chris PeBenito bdccba
## </param>
Chris PeBenito bdccba
#
Chris PeBenito bdccba
interface(`ipsec_setcontext_default_spd',`
Chris PeBenito bdccba
	gen_require(`
Chris PeBenito bdccba
		type ipsec_spd_t;
Chris PeBenito bdccba
	')
Chris PeBenito bdccba
Chris PeBenito bdccba
	allow $1 ipsec_spd_t:association setcontext;
Chris PeBenito bdccba
')
Chris PeBenito bdccba
Chris PeBenito bdccba
########################################
Chris PeBenito bdccba
## <summary>
Chris PeBenito e0ed76
##	write the ipsec_var_run_t files.
Chris PeBenito e0ed76
## </summary>
Chris PeBenito e0ed76
## <param name="domain">
Chris PeBenito e0ed76
##	<summary>
Chris PeBenito e0ed76
##	Domain allowed access.
Chris PeBenito e0ed76
##	</summary>
Chris PeBenito e0ed76
## </param>
Chris PeBenito e0ed76
#
Chris PeBenito e0ed76
interface(`ipsec_write_pid',`
Chris PeBenito e0ed76
	gen_require(`
Chris PeBenito e0ed76
		type ipsec_var_run_t;
Chris PeBenito e0ed76
	')
Chris PeBenito e0ed76
Chris PeBenito e0ed76
	files_search_pids($1)
Chris PeBenito e0ed76
	write_files_pattern($1, ipsec_var_run_t, ipsec_var_run_t)
Chris PeBenito e0ed76
')
Chris PeBenito e0ed76
Chris PeBenito e0ed76
########################################
Chris PeBenito e0ed76
## <summary>
Chris PeBenito 982035
##	Create, read, write, and delete the IPSEC pid files.
Chris PeBenito 982035
## </summary>
Chris PeBenito 982035
## <param name="domain">
Chris PeBenito 982035
##	<summary>
Chris PeBenito 982035
##	The type of the process performing this action.
Chris PeBenito 982035
##	</summary>
Chris PeBenito 982035
## </param>
Chris PeBenito 982035
#
Chris PeBenito 982035
interface(`ipsec_manage_pid',`
Chris PeBenito 982035
	gen_require(`
Chris PeBenito 982035
		type ipsec_var_run_t;
Chris PeBenito 982035
	')
Chris PeBenito 982035
Chris PeBenito 982035
	files_search_pids($1)
Chris PeBenito 3f67f7
	manage_files_pattern($1, ipsec_var_run_t, ipsec_var_run_t)
Chris PeBenito 982035
')
Chris PeBenito 982035
Chris PeBenito 982035
########################################
Chris PeBenito 982035
## <summary>
Chris PeBenito 9e8f65
##	Execute racoon in the racoon domain.
Chris PeBenito 9e8f65
## </summary>
Chris PeBenito 9e8f65
## <param name="domain">
Chris PeBenito 9e8f65
##	<summary>
Chris PeBenito 9e8f65
##	The type of the process performing this action.
Chris PeBenito 9e8f65
##	</summary>
Chris PeBenito 9e8f65
## </param>
Chris PeBenito 9e8f65
#
Chris PeBenito 9e8f65
interface(`ipsec_domtrans_racoon',`
Chris PeBenito 9e8f65
	gen_require(`
Chris PeBenito 9e8f65
		type racoon_t, racoon_exec_t;
Chris PeBenito 9e8f65
	')
Chris PeBenito 9e8f65
Chris PeBenito 3f67f7
	domtrans_pattern($1, racoon_exec_t, racoon_t)
Chris PeBenito 9e8f65
')
Chris PeBenito 9e8f65
Chris PeBenito 9e8f65
########################################
Chris PeBenito 9e8f65
## <summary>
Chris PeBenito 9e8f65
##	Execute setkey in the setkey domain.
Chris PeBenito 9e8f65
## </summary>
Chris PeBenito 9e8f65
## <param name="domain">
Chris PeBenito 9e8f65
##	<summary>
Chris PeBenito 9e8f65
##	The type of the process performing this action.
Chris PeBenito 9e8f65
##	</summary>
Chris PeBenito 9e8f65
## </param>
Chris PeBenito 9e8f65
#
Chris PeBenito 9e8f65
interface(`ipsec_domtrans_setkey',`
Chris PeBenito 9e8f65
	gen_require(`
Chris PeBenito 9e8f65
		type setkey_t, setkey_exec_t;
Chris PeBenito 9e8f65
	')
Chris PeBenito 9e8f65
Chris PeBenito 3f67f7
	domtrans_pattern($1, setkey_exec_t, setkey_t)
Chris PeBenito 9e8f65
')
Chris PeBenito 9e8f65
Chris PeBenito 9e8f65
########################################
Chris PeBenito 9e8f65
## <summary>
Chris PeBenito 9e8f65
##	Execute setkey and allow the specified role the domains.
Chris PeBenito 9e8f65
## </summary>
Chris PeBenito 9e8f65
## <param name="domain">
Chris PeBenito 9e8f65
##	<summary>
Chris PeBenito 9e8f65
##	Domain allowed access.
Chris PeBenito 9e8f65
##	</summary>
Chris PeBenito 9e8f65
## </param>
Chris PeBenito 9e8f65
## <param name="role">
Chris PeBenito 9e8f65
##	<summary>
Chris PeBenito 9e8f65
##	The role to be allowed the racoon and setkey domains.
Chris PeBenito 9e8f65
##	</summary>
Chris PeBenito 9e8f65
## </param>
Chris PeBenito 9e8f65
## <rolecap/>
Chris PeBenito 9e8f65
#
Chris PeBenito 9e8f65
interface(`ipsec_run_setkey',`
Chris PeBenito 9e8f65
	gen_require(`
Chris PeBenito 9e8f65
		type setkey_t;
Chris PeBenito 9e8f65
	')
Chris PeBenito 9e8f65
Chris PeBenito 9e8f65
	ipsec_domtrans_setkey($1)
Chris PeBenito 9e8f65
	role $2 types setkey_t;
Chris PeBenito 9e8f65
')