2005-06-20 18:40:44 +00:00
|
|
|
## <summary>Policy for GNU Privacy Guard and related programs.</summary>
|
2005-05-05 21:40:32 +00:00
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
############################################################
|
2005-06-23 21:30:57 +00:00
|
|
|
## <summary>
|
2008-11-05 16:10:46 +00:00
|
|
|
## Role access for gpg
|
2005-06-23 21:30:57 +00:00
|
|
|
## </summary>
|
2008-11-05 16:10:46 +00:00
|
|
|
## <param name="role">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2008-11-05 16:10:46 +00:00
|
|
|
## Role allowed access
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-08-30 15:48:57 +00:00
|
|
|
## </param>
|
2008-11-05 16:10:46 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2008-11-05 16:10:46 +00:00
|
|
|
## User domain for the role
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-08-30 15:48:57 +00:00
|
|
|
## </param>
|
2005-05-05 21:40:32 +00:00
|
|
|
#
|
2008-11-05 16:10:46 +00:00
|
|
|
interface(`gpg_role',`
|
2005-10-18 18:25:33 +00:00
|
|
|
gen_require(`
|
2008-11-05 16:10:46 +00:00
|
|
|
type gpg_t, gpg_exec_t;
|
|
|
|
type gpg_agent_t, gpg_agent_exec_t;
|
|
|
|
type gpg_agent_tmp_t;
|
|
|
|
type gpg_helper_t, gpg_pinentry_t;
|
2005-10-18 18:25:33 +00:00
|
|
|
')
|
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
role $1 types { gpg_t gpg_agent_t gpg_helper_t gpg_pinentry_t };
|
2005-05-05 21:40:32 +00:00
|
|
|
|
2006-07-06 17:00:29 +00:00
|
|
|
# transition from the userdomain to the derived domain
|
2008-11-05 16:10:46 +00:00
|
|
|
domtrans_pattern($2, gpg_exec_t, gpg_t)
|
2006-07-06 17:00:29 +00:00
|
|
|
|
|
|
|
# allow ps to show gpg
|
2008-11-05 16:10:46 +00:00
|
|
|
ps_process_pattern($2, gpg_t)
|
2009-07-21 14:07:38 +00:00
|
|
|
allow $2 gpg_t:process { signal sigkill };
|
2005-05-05 21:40:32 +00:00
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
# communicate with the user
|
2008-11-05 16:10:46 +00:00
|
|
|
allow gpg_helper_t $2:fd use;
|
|
|
|
allow gpg_helper_t $2:fifo_file write;
|
2005-06-29 20:53:53 +00:00
|
|
|
|
2006-07-06 17:00:29 +00:00
|
|
|
# allow ps to show gpg-agent
|
2008-11-05 16:10:46 +00:00
|
|
|
ps_process_pattern($2, gpg_agent_t)
|
2006-07-06 17:00:29 +00:00
|
|
|
|
2005-06-29 20:53:53 +00:00
|
|
|
# Allow the user shell to signal the gpg-agent program.
|
2008-11-05 16:10:46 +00:00
|
|
|
allow $2 gpg_agent_t:process { signal sigkill };
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
manage_dirs_pattern($2, gpg_agent_tmp_t, gpg_agent_tmp_t)
|
|
|
|
manage_files_pattern($2, gpg_agent_tmp_t, gpg_agent_tmp_t)
|
|
|
|
manage_sock_files_pattern($2, gpg_agent_tmp_t, gpg_agent_tmp_t)
|
|
|
|
files_tmp_filetrans(gpg_agent_t, gpg_agent_tmp_t, { file sock_file dir })
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
# Transition from the user domain to the agent domain.
|
|
|
|
domtrans_pattern($2, gpg_agent_exec_t, gpg_agent_t)
|
2009-07-21 14:07:38 +00:00
|
|
|
|
|
|
|
ifdef(`hide_broken_symptoms',`
|
|
|
|
#Leaked File Descriptors
|
|
|
|
dontaudit gpg_t $2:fifo_file rw_fifo_file_perms;
|
|
|
|
dontaudit gpg_t $2:tcp_socket rw_socket_perms;
|
|
|
|
dontaudit gpg_t $2:udp_socket rw_socket_perms;
|
|
|
|
dontaudit gpg_t $2:unix_stream_socket rw_socket_perms;
|
|
|
|
dontaudit gpg_t $2:unix_dgram_socket rw_socket_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
')
|
2005-06-01 18:34:34 +00:00
|
|
|
|
2006-03-08 20:09:42 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
2008-12-03 19:16:20 +00:00
|
|
|
## Transition to a user gpg domain.
|
2006-03-08 20:09:42 +00:00
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
2008-12-03 19:16:20 +00:00
|
|
|
## Domain allowed access.
|
2006-03-08 20:09:42 +00:00
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
2008-11-05 16:10:46 +00:00
|
|
|
interface(`gpg_domtrans',`
|
2006-03-08 20:09:42 +00:00
|
|
|
gen_require(`
|
2008-11-05 16:10:46 +00:00
|
|
|
type gpg_t, gpg_exec_t;
|
2006-03-08 20:09:42 +00:00
|
|
|
')
|
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
domtrans_pattern($1, gpg_exec_t, gpg_t)
|
2006-03-08 20:09:42 +00:00
|
|
|
')
|
|
|
|
|
2006-03-13 21:36:49 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
2008-12-03 19:16:20 +00:00
|
|
|
## Send generic signals to user gpg processes.
|
2006-03-13 21:36:49 +00:00
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
2008-12-03 19:16:20 +00:00
|
|
|
## Domain allowed access.
|
2006-03-13 21:36:49 +00:00
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
2008-11-05 16:10:46 +00:00
|
|
|
interface(`gpg_signal',`
|
2006-03-13 21:36:49 +00:00
|
|
|
gen_require(`
|
2008-11-05 16:10:46 +00:00
|
|
|
type gpg_t;
|
2006-03-13 21:36:49 +00:00
|
|
|
')
|
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
allow $1 gpg_t:process signal;
|
2006-03-13 21:36:49 +00:00
|
|
|
')
|