Chris PeBenito 57869a6
## <summary>Policy for GNU Privacy Guard and related programs.</summary>
Chris PeBenito b2b38c7
Chris PeBenito 296273a
############################################################
Chris PeBenito 414e415
## <summary>
Chris PeBenito 296273a
##	Role access for gpg
Chris PeBenito 414e415
## </summary>
Chris PeBenito 296273a
## <param name="role">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 296273a
##	Role allowed access
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 451c1e3
## </param>
Chris PeBenito 296273a
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 296273a
##	User domain for the role
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 451c1e3
## </param>
Chris PeBenito b2b38c7
#
Chris PeBenito 296273a
interface(`gpg_role',`
Chris PeBenito 12ae755
	gen_require(`
Chris PeBenito 296273a
		type gpg_t, gpg_exec_t;
Chris PeBenito 296273a
		type gpg_agent_t, gpg_agent_exec_t;
Chris PeBenito 296273a
		type gpg_agent_tmp_t;
Chris PeBenito 296273a
		type gpg_helper_t, gpg_pinentry_t;
Chris PeBenito 12ae755
	')
Chris PeBenito 12ae755
Chris PeBenito 296273a
	role $1 types { gpg_t gpg_agent_t gpg_helper_t gpg_pinentry_t };
Chris PeBenito b2b38c7
Chris PeBenito 1f6524a
	# transition from the userdomain to the derived domain
Chris PeBenito 296273a
	domtrans_pattern($2, gpg_exec_t, gpg_t)
Chris PeBenito 1f6524a
Chris PeBenito 1f6524a
	# allow ps to show gpg
Chris PeBenito 296273a
	ps_process_pattern($2, gpg_t)
Chris PeBenito 296273a
	allow $2 gpg_t:process signal;
Chris PeBenito b2b38c7
Chris PeBenito c0868a7
	# communicate with the user 
Chris PeBenito 296273a
	allow gpg_helper_t $2:fd use;
Chris PeBenito 296273a
	allow gpg_helper_t $2:fifo_file write;
Chris PeBenito ebdc3b7
Chris PeBenito 1f6524a
	# allow ps to show gpg-agent
Chris PeBenito 296273a
	ps_process_pattern($2, gpg_agent_t)
Chris PeBenito 1f6524a
Chris PeBenito ebdc3b7
	# Allow the user shell to signal the gpg-agent program.
Chris PeBenito 296273a
	allow $2 gpg_agent_t:process { signal sigkill };
Chris PeBenito 0c73cd2
Chris PeBenito 296273a
	manage_dirs_pattern($2, gpg_agent_tmp_t, gpg_agent_tmp_t)
Chris PeBenito 296273a
	manage_files_pattern($2, gpg_agent_tmp_t, gpg_agent_tmp_t)
Chris PeBenito 296273a
	manage_sock_files_pattern($2, gpg_agent_tmp_t, gpg_agent_tmp_t)
Chris PeBenito 296273a
	files_tmp_filetrans(gpg_agent_t, gpg_agent_tmp_t, { file sock_file dir })
Chris PeBenito 0c73cd2
Chris PeBenito 296273a
	# Transition from the user domain to the agent domain.
Chris PeBenito 296273a
	domtrans_pattern($2, gpg_agent_exec_t, gpg_agent_t)
Chris PeBenito 0c73cd2
')
Chris PeBenito 004db90
Chris PeBenito 1852726
########################################
Chris PeBenito 1852726
## <summary>
Chris PeBenito 1852726
##      Transition to a user gpg domain.
Chris PeBenito 1852726
## </summary>
Chris PeBenito 1852726
## <param name="domain">
Chris PeBenito 1852726
##	<summary>
Chris PeBenito 1852726
##      Domain allowed access.
Chris PeBenito 1852726
##	</summary>
Chris PeBenito 1852726
## </param>
Chris PeBenito 1852726
#
Chris PeBenito 296273a
interface(`gpg_domtrans',`
Chris PeBenito 1852726
	gen_require(`
Chris PeBenito 296273a
		type gpg_t, gpg_exec_t;
Chris PeBenito 1852726
	')
Chris PeBenito 1852726
Chris PeBenito 296273a
	domtrans_pattern($1, gpg_exec_t, gpg_t)
Chris PeBenito 1852726
')
Chris PeBenito 1852726
Chris PeBenito edf241c
########################################
Chris PeBenito edf241c
## <summary>
Chris PeBenito edf241c
##      Send generic signals to user gpg processes.
Chris PeBenito edf241c
## </summary>
Chris PeBenito edf241c
## <param name="domain">
Chris PeBenito edf241c
##	<summary>
Chris PeBenito edf241c
##      Domain allowed access.
Chris PeBenito edf241c
##	</summary>
Chris PeBenito edf241c
## </param>
Chris PeBenito edf241c
#
Chris PeBenito 296273a
interface(`gpg_signal',`
Chris PeBenito edf241c
	gen_require(`
Chris PeBenito 296273a
		type gpg_t;
Chris PeBenito edf241c
	')
Chris PeBenito edf241c
Chris PeBenito 296273a
	allow $1 gpg_t:process signal;
Chris PeBenito edf241c
')