Chris PeBenito 17de1b
## <summary>Dovecot POP and IMAP mail server</summary>
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito bb8816
##	Connect to dovecot auth unix domain stream socket.
Chris PeBenito bb8816
## </summary>
Chris PeBenito bb8816
## <param name="domain">
Chris PeBenito bb8816
##	<summary>
Chris PeBenito bb8816
##	Domain allowed access.
Chris PeBenito bb8816
##	</summary>
Chris PeBenito bb8816
## </param>
Chris PeBenito bb8816
#
Chris PeBenito bb8816
interface(`dovecot_stream_connect_auth',`
Chris PeBenito bb8816
	gen_require(`
Chris PeBenito bb8816
		type dovecot_auth_t, dovecot_var_run_t;
Chris PeBenito bb8816
	')
Chris PeBenito bb8816
Dominick Grift 1e9280
	files_search_pids($1)
Chris PeBenito bb8816
	stream_connect_pattern($1, dovecot_var_run_t, dovecot_var_run_t, dovecot_auth_t)
Chris PeBenito bb8816
')
Chris PeBenito bb8816
Chris PeBenito bb8816
########################################
Chris PeBenito bb8816
## <summary>
Chris PeBenito bb8816
##	Execute dovecot_deliver in the dovecot_deliver domain.
Chris PeBenito bb8816
## </summary>
Chris PeBenito bb8816
## <param name="domain">
Chris PeBenito bb8816
##	<summary>
Dominick Grift 288845
##	Domain allowed to transition.
Chris PeBenito bb8816
##	</summary>
Chris PeBenito bb8816
## </param>
Chris PeBenito bb8816
#
Chris PeBenito bb8816
interface(`dovecot_domtrans_deliver',`
Chris PeBenito bb8816
	gen_require(`
Chris PeBenito bb8816
		type dovecot_deliver_t, dovecot_deliver_exec_t;
Chris PeBenito bb8816
	')
Chris PeBenito bb8816
Chris PeBenito bb8816
	domtrans_pattern($1, dovecot_deliver_exec_t, dovecot_deliver_t)
Chris PeBenito bb8816
')
Chris PeBenito bb8816
Chris PeBenito bb8816
########################################
Chris PeBenito bb8816
## <summary>
Chris PeBenito 17de1b
##	Create, read, write, and delete the dovecot spool files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`dovecot_manage_spool',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type dovecot_spool_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Dominick Grift 1e9280
	files_search_spool($1)
Chris PeBenito 0bfccd
	manage_files_pattern($1, dovecot_spool_t, dovecot_spool_t)
Chris PeBenito 0bfccd
	manage_lnk_files_pattern($1, dovecot_spool_t, dovecot_spool_t)
Chris PeBenito 17de1b
')
Chris PeBenito 834401
Chris PeBenito 834401
########################################
Chris PeBenito 834401
## <summary>
Chris PeBenito ff8f0a
##	Do not audit attempts to delete dovecot lib files.
Chris PeBenito 834401
## </summary>
Chris PeBenito 834401
## <param name="domain">
Chris PeBenito ff8f0a
##	<summary>
Chris PeBenito ff8f0a
##	Domain to not audit.
Chris PeBenito ff8f0a
##	</summary>
Chris PeBenito 834401
## </param>
Chris PeBenito 834401
#
Chris PeBenito 834401
interface(`dovecot_dontaudit_unlink_lib_files',`
Chris PeBenito 834401
	gen_require(`
Chris PeBenito 834401
		type dovecot_var_lib_t;
Chris PeBenito 834401
	')
Chris PeBenito 834401
Chris PeBenito 834401
	dontaudit $1 dovecot_var_lib_t:file unlink;
Chris PeBenito 834401
')
Chris PeBenito bb8816
Chris PeBenito bb8816
########################################
Chris PeBenito bb8816
## <summary>
Chris PeBenito d8eb3c
##	All of the rules required to administrate
Chris PeBenito bb8816
##	an dovecot environment
Chris PeBenito bb8816
## </summary>
Chris PeBenito bb8816
## <param name="domain">
Chris PeBenito bb8816
##	<summary>
Chris PeBenito bb8816
##	Domain allowed access.
Chris PeBenito bb8816
##	</summary>
Chris PeBenito bb8816
## </param>
Chris PeBenito bb8816
## <param name="role">
Chris PeBenito bb8816
##	<summary>
Chris PeBenito bb8816
##	The role to be allowed to manage the dovecot domain.
Chris PeBenito bb8816
##	</summary>
Chris PeBenito bb8816
## </param>
Chris PeBenito bb8816
## <rolecap/>
Chris PeBenito bb8816
#
Chris PeBenito bb8816
interface(`dovecot_admin',`
Chris PeBenito bb8816
	gen_require(`
Dan Walsh 3eaa99
		type dovecot_t, dovecot_etc_t, dovecot_auth_tmp_t;
Dominick Grift 6bb4d4
		type dovecot_spool_t, dovecot_var_lib_t, dovecot_var_log_t;
Dominick Grift 6bb4d4
		type dovecot_var_run_t, dovecot_tmp_t, dovecot_keytab_t;
Dominick Grift 6bb4d4
		type dovecot_cert_t, dovecot_passwd_t, dovecot_initrc_exec_t;
Chris PeBenito bb8816
	')
Chris PeBenito bb8816
Chris PeBenito bb8816
	allow $1 dovecot_t:process { ptrace signal_perms };
Chris PeBenito bb8816
	ps_process_pattern($1, dovecot_t)
Chris PeBenito bb8816
Chris PeBenito bb8816
	init_labeled_script_domtrans($1, dovecot_initrc_exec_t)
Chris PeBenito bb8816
	domain_system_change_exemption($1)
Chris PeBenito bb8816
	role_transition $2 dovecot_initrc_exec_t system_r;
Chris PeBenito bb8816
	allow $2 system_r;
Chris PeBenito bb8816
Chris PeBenito bb8816
	files_list_etc($1)
Chris PeBenito bb8816
	admin_pattern($1, dovecot_etc_t)
Chris PeBenito bb8816
Dan Walsh 3eaa99
	files_list_tmp($1)
Dan Walsh 3eaa99
	admin_pattern($1, dovecot_auth_tmp_t)
Dan Walsh 3eaa99
	admin_pattern($1, dovecot_tmp_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	admin_pattern($1, dovecot_keytab_t)
Chris PeBenito bb8816
Chris PeBenito bb8816
	files_list_spool($1)
Chris PeBenito bb8816
	admin_pattern($1, dovecot_spool_t)
Chris PeBenito bb8816
Chris PeBenito bb8816
	files_list_var_lib($1)
Chris PeBenito bb8816
	admin_pattern($1, dovecot_var_lib_t)
Chris PeBenito bb8816
Dan Walsh 3eaa99
	logging_search_logs($1)
Dan Walsh 3eaa99
	admin_pattern($1, dovecot_var_log_t)
Dan Walsh 3eaa99
Chris PeBenito bb8816
	files_list_pids($1)
Chris PeBenito bb8816
	admin_pattern($1, dovecot_var_run_t)
Chris PeBenito bb8816
Chris PeBenito bb8816
	admin_pattern($1, dovecot_cert_t)
Chris PeBenito bb8816
Chris PeBenito bb8816
	admin_pattern($1, dovecot_passwd_t)
Chris PeBenito bb8816
')