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 17de1b
	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 c0868a
	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 c0868a
	manage_files_pattern(courier_$1_t,courier_var_run_t,courier_var_run_t)
Chris PeBenito c0868a
	manage_lnk_files_pattern(courier_$1_t,courier_var_run_t,courier_var_run_t)
Chris PeBenito c0868a
	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 17de1b
	corenet_non_ipsec_sendrecv(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 17de1b
	corenet_tcp_sendrecv_all_nodes(courier_$1_t)
Chris PeBenito 17de1b
	corenet_udp_sendrecv_all_nodes(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
	term_dontaudit_use_console(courier_$1_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	init_use_fds(courier_$1_t)
Chris PeBenito 17de1b
	init_use_script_ptys(courier_$1_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	libs_use_ld_so(courier_$1_t)
Chris PeBenito 17de1b
	libs_use_shared_libs(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
	ifdef(`targeted_policy',`
Chris PeBenito 17de1b
		term_dontaudit_use_unallocated_ttys(courier_$1_t)
Chris PeBenito 17de1b
		term_dontaudit_use_generic_ptys(courier_$1_t)
Chris PeBenito 17de1b
		files_dontaudit_read_root_files(courier_$1_t)
Chris PeBenito 17de1b
	')
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
')