Chris PeBenito 17de1b
## <summary>Courier IMAP and POP3 email servers</summary>
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Template for creating courier server processes.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="prefix">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Prefix name of the server process.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
template(`courier_domain_template',`
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	##############################
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
	# Declarations
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	type courier_$1_t;
Chris PeBenito 17de1b
	type courier_$1_exec_t;
Chris PeBenito 0bfccd
	init_daemon_domain(courier_$1_t, courier_$1_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	##############################
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
	# Declarations
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow courier_$1_t self:capability dac_override;
Chris PeBenito 17de1b
	dontaudit courier_$1_t self:capability sys_tty_config;
Chris PeBenito 17de1b
	allow courier_$1_t self:process { setpgid signal_perms };
Chris PeBenito 17de1b
	allow courier_$1_t self:fifo_file { read write getattr };
Chris PeBenito 17de1b
	allow courier_$1_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 17de1b
	allow courier_$1_t self:udp_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	can_exec(courier_$1_t, courier_$1_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 3f67f7
	read_files_pattern(courier_$1_t, courier_etc_t, courier_etc_t)
Chris PeBenito c0868a
	allow courier_$1_t courier_etc_t:dir list_dir_perms;
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
	manage_files_pattern(courier_$1_t, courier_var_run_t, courier_var_run_t)
Chris PeBenito 0bfccd
	manage_lnk_files_pattern(courier_$1_t, courier_var_run_t, courier_var_run_t)
Chris PeBenito 0bfccd
	manage_sock_files_pattern(courier_$1_t, courier_var_run_t, courier_var_run_t)
Chris PeBenito 17de1b
	files_search_pids(courier_$1_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	kernel_read_system_state(courier_$1_t)
Chris PeBenito 17de1b
	kernel_read_kernel_sysctls(courier_$1_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	corecmd_exec_bin(courier_$1_t)
Chris PeBenito 17de1b
Chris PeBenito 190066
	corenet_all_recvfrom_unlabeled(courier_$1_t)
Chris PeBenito 190066
	corenet_all_recvfrom_netlabel(courier_$1_t)
Chris PeBenito 17de1b
	corenet_tcp_sendrecv_generic_if(courier_$1_t)
Chris PeBenito 17de1b
	corenet_udp_sendrecv_generic_if(courier_$1_t)
Chris PeBenito c12621
	corenet_tcp_sendrecv_generic_node(courier_$1_t)
Chris PeBenito c12621
	corenet_udp_sendrecv_generic_node(courier_$1_t)
Chris PeBenito 17de1b
	corenet_tcp_sendrecv_all_ports(courier_$1_t)
Chris PeBenito 17de1b
	corenet_udp_sendrecv_all_ports(courier_$1_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	dev_read_sysfs(courier_$1_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	domain_use_interactive_fds(courier_$1_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_read_etc_files(courier_$1_t)
Chris PeBenito 17de1b
	files_read_etc_runtime_files(courier_$1_t)
Chris PeBenito 17de1b
	files_read_usr_files(courier_$1_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	fs_getattr_xattr_fs(courier_$1_t)
Chris PeBenito 17de1b
	fs_search_auto_mountpoints(courier_$1_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	logging_send_syslog_msg(courier_$1_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	sysnet_read_config(courier_$1_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	userdom_dontaudit_use_unpriv_user_fds(courier_$1_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		seutil_sigchld_newrole(courier_$1_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		udev_read_db(courier_$1_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute the courier authentication daemon with
Chris PeBenito 17de1b
##	a domain transition.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="prefix">
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(`courier_domtrans_authdaemon',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type courier_authdaemon_t, courier_authdaemon_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito c0868a
	domtrans_pattern($1, courier_authdaemon_exec_t, courier_authdaemon_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute the courier POP3 and IMAP server with
Chris PeBenito 17de1b
##	a domain transition.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="prefix">
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(`courier_domtrans_pop',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type courier_pop_t, courier_pop_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito c0868a
	domtrans_pattern($1, courier_pop_exec_t, courier_pop_t)
Chris PeBenito 17de1b
')
Chris PeBenito 3e5987
Chris PeBenito 3e5987
########################################
Chris PeBenito 3e5987
## <summary>
Chris PeBenito 3e5987
##	Read courier config files
Chris PeBenito 3e5987
## </summary>
Chris PeBenito 3e5987
## <param name="prefix">
Chris PeBenito 3e5987
##	<summary>
Chris PeBenito 3e5987
##	Domain allowed access.
Chris PeBenito 3e5987
##	</summary>
Chris PeBenito 3e5987
## </param>
Chris PeBenito 3e5987
#
Chris PeBenito 3e5987
interface(`courier_read_config',`
Chris PeBenito 3e5987
	gen_require(`
Chris PeBenito 3e5987
		type courier_etc_t;
Chris PeBenito 3e5987
	')
Chris PeBenito 3e5987
Chris PeBenito 3e5987
	read_files_pattern($1, courier_etc_t, courier_etc_t)
Chris PeBenito 3e5987
')
Chris PeBenito 3e5987
Chris PeBenito 3e5987
########################################
Chris PeBenito 3e5987
## <summary>
Chris PeBenito 3e5987
##	Create, read, write, and delete courier
Chris PeBenito 3e5987
##	spool directories.
Chris PeBenito 3e5987
## </summary>
Chris PeBenito 3e5987
## <param name="prefix">
Chris PeBenito 3e5987
##	<summary>
Chris PeBenito 3e5987
##	Domain allowed access.
Chris PeBenito 3e5987
##	</summary>
Chris PeBenito 3e5987
## </param>
Chris PeBenito 3e5987
#
Chris PeBenito 3e5987
interface(`courier_manage_spool_dirs',`
Chris PeBenito 3e5987
	gen_require(`
Chris PeBenito 3e5987
		type courier_spool_t;
Chris PeBenito 3e5987
	')
Chris PeBenito 3e5987
Chris PeBenito 3e5987
	manage_dirs_pattern($1, courier_spool_t, courier_spool_t)
Chris PeBenito 3e5987
')
Chris PeBenito 3e5987
Chris PeBenito 3e5987
########################################
Chris PeBenito 3e5987
## <summary>
Chris PeBenito 3e5987
##	Create, read, write, and delete courier
Chris PeBenito 3e5987
##	spool files.
Chris PeBenito 3e5987
## </summary>
Chris PeBenito 3e5987
## <param name="prefix">
Chris PeBenito 3e5987
##	<summary>
Chris PeBenito 3e5987
##	Domain allowed access.
Chris PeBenito 3e5987
##	</summary>
Chris PeBenito 3e5987
## </param>
Chris PeBenito 3e5987
#
Chris PeBenito 3e5987
interface(`courier_manage_spool_files',`
Chris PeBenito 3e5987
	gen_require(`
Chris PeBenito 3e5987
		type courier_spool_t;
Chris PeBenito 3e5987
	')
Chris PeBenito 3e5987
Chris PeBenito 3e5987
	manage_files_pattern($1, courier_spool_t, courier_spool_t)
Chris PeBenito 3e5987
')
Chris PeBenito 3e5987
Chris PeBenito 3e5987
########################################
Chris PeBenito 3e5987
## <summary>
Chris PeBenito 3e5987
##	Read and write to courier spool pipes.
Chris PeBenito 3e5987
## </summary>
Chris PeBenito 3e5987
## <param name="domain">
Chris PeBenito 3e5987
##	<summary>
Chris PeBenito 3e5987
##	Domain to not audit.
Chris PeBenito 3e5987
##	</summary>
Chris PeBenito 3e5987
## </param>
Chris PeBenito 3e5987
#
Chris PeBenito 3e5987
interface(`courier_rw_spool_pipes',`
Chris PeBenito 3e5987
	gen_require(`
Chris PeBenito 3e5987
		type courier_spool_t;
Chris PeBenito 3e5987
	')
Chris PeBenito 3e5987
Chris PeBenito 3e5987
	allow $1 courier_spool_t:fifo_file rw_fifo_file_perms;
Chris PeBenito 3e5987
')