Chris PeBenito 57869a
## <summary>Policy for GNU Privacy Guard and related programs.</summary>
Chris PeBenito b2b38c
Chris PeBenito 296273
############################################################
Chris PeBenito 414e41
## <summary>
Chris PeBenito 296273
##	Role access for gpg
Chris PeBenito 414e41
## </summary>
Chris PeBenito 296273
## <param name="role">
Chris PeBenito 885b83
##	<summary>
Chris PeBenito 296273
##	Role allowed access
Chris PeBenito 885b83
##	</summary>
Chris PeBenito 451c1e
## </param>
Chris PeBenito 296273
## <param name="domain">
Chris PeBenito 885b83
##	<summary>
Chris PeBenito 296273
##	User domain for the role
Chris PeBenito 885b83
##	</summary>
Chris PeBenito 451c1e
## </param>
Chris PeBenito b2b38c
#
Chris PeBenito 296273
interface(`gpg_role',`
Chris PeBenito 12ae75
	gen_require(`
Chris PeBenito 296273
		type gpg_t, gpg_exec_t;
Chris PeBenito 296273
		type gpg_agent_t, gpg_agent_exec_t;
Chris PeBenito 296273
		type gpg_agent_tmp_t;
Chris PeBenito 296273
		type gpg_helper_t, gpg_pinentry_t;
Chris PeBenito 12ae75
	')
Chris PeBenito 12ae75
Chris PeBenito 296273
	role $1 types { gpg_t gpg_agent_t gpg_helper_t gpg_pinentry_t };
Chris PeBenito b2b38c
Chris PeBenito 1f6524
	# transition from the userdomain to the derived domain
Chris PeBenito 296273
	domtrans_pattern($2, gpg_exec_t, gpg_t)
Chris PeBenito 1f6524
Chris PeBenito 1f6524
	# allow ps to show gpg
Chris PeBenito 296273
	ps_process_pattern($2, gpg_t)
Chris PeBenito ca7fa5
	allow $2 gpg_t:process { signull sigstop signal sigkill };
Chris PeBenito b2b38c
Chris PeBenito c0868a
	# communicate with the user 
Chris PeBenito 296273
	allow gpg_helper_t $2:fd use;
Chris PeBenito 296273
	allow gpg_helper_t $2:fifo_file write;
Chris PeBenito ebdc3b
Chris PeBenito 1f6524
	# allow ps to show gpg-agent
Chris PeBenito 296273
	ps_process_pattern($2, gpg_agent_t)
Chris PeBenito 1f6524
Chris PeBenito ebdc3b
	# Allow the user shell to signal the gpg-agent program.
Chris PeBenito 296273
	allow $2 gpg_agent_t:process { signal sigkill };
Chris PeBenito 0c73cd
Chris PeBenito 296273
	manage_dirs_pattern($2, gpg_agent_tmp_t, gpg_agent_tmp_t)
Chris PeBenito 296273
	manage_files_pattern($2, gpg_agent_tmp_t, gpg_agent_tmp_t)
Chris PeBenito 296273
	manage_sock_files_pattern($2, gpg_agent_tmp_t, gpg_agent_tmp_t)
Chris PeBenito 296273
	files_tmp_filetrans(gpg_agent_t, gpg_agent_tmp_t, { file sock_file dir })
Chris PeBenito 0c73cd
Chris PeBenito 296273
	# Transition from the user domain to the agent domain.
Chris PeBenito 296273
	domtrans_pattern($2, gpg_agent_exec_t, gpg_agent_t)
Chris PeBenito e4f73a
Chris PeBenito e4f73a
	ifdef(`hide_broken_symptoms',`
Chris PeBenito e4f73a
		#Leaked File Descriptors
Chris PeBenito e4f73a
		dontaudit gpg_t $2:fifo_file rw_fifo_file_perms;
Chris PeBenito e4f73a
		dontaudit gpg_t $2:tcp_socket rw_socket_perms;
Chris PeBenito e4f73a
		dontaudit gpg_t $2:udp_socket rw_socket_perms;
Chris PeBenito e4f73a
		dontaudit gpg_t $2:unix_stream_socket rw_socket_perms;
Chris PeBenito e4f73a
		dontaudit gpg_t $2:unix_dgram_socket rw_socket_perms;
Chris PeBenito e4f73a
	')
Chris PeBenito 0c73cd
')
Chris PeBenito 004db9
Chris PeBenito 185272
########################################
Chris PeBenito 185272
## <summary>
Chris PeBenito ff8f0a
##	Transition to a user gpg domain.
Chris PeBenito 185272
## </summary>
Chris PeBenito 185272
## <param name="domain">
Chris PeBenito 185272
##	<summary>
Chris PeBenito ff8f0a
##	Domain allowed access.
Chris PeBenito 185272
##	</summary>
Chris PeBenito 185272
## </param>
Chris PeBenito 185272
#
Chris PeBenito 296273
interface(`gpg_domtrans',`
Chris PeBenito 185272
	gen_require(`
Chris PeBenito 296273
		type gpg_t, gpg_exec_t;
Chris PeBenito 185272
	')
Chris PeBenito 185272
Chris PeBenito 296273
	domtrans_pattern($1, gpg_exec_t, gpg_t)
Chris PeBenito 185272
')
Chris PeBenito 185272
Chris PeBenito edf241
########################################
Chris PeBenito edf241
## <summary>
Chris PeBenito ff8f0a
##	Send generic signals to user gpg processes.
Chris PeBenito edf241
## </summary>
Chris PeBenito edf241
## <param name="domain">
Chris PeBenito edf241
##	<summary>
Chris PeBenito ff8f0a
##	Domain allowed access.
Chris PeBenito edf241
##	</summary>
Chris PeBenito edf241
## </param>
Chris PeBenito edf241
#
Chris PeBenito 296273
interface(`gpg_signal',`
Chris PeBenito edf241
	gen_require(`
Chris PeBenito 296273
		type gpg_t;
Chris PeBenito edf241
	')
Chris PeBenito edf241
Chris PeBenito 296273
	allow $1 gpg_t:process signal;
Chris PeBenito edf241
')