Chris PeBenito 17de1b
## <summary>Filter used for removing unsolicited email.</summary>
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#######################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito bbcd3c
##	The per role template for the spamassassin module.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <desc>
Chris PeBenito 17de1b
##	

Chris PeBenito bbcd3c
##	The per role template for the spamassassin module.
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	This template is invoked automatically for each user, and
Chris PeBenito 17de1b
##	generally does not need to be invoked directly
Chris PeBenito 17de1b
##	by policy writers.
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
## </desc>
Chris PeBenito 17de1b
## <param name="userdomain_prefix">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The prefix of the user domain (e.g., user
Chris PeBenito 17de1b
##	is the prefix for user_t).
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="user_domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The type of the user domain.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="user_role">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	The role associated with the user domain.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# cjp: when tunables are available, spamc stuff should be
Chris PeBenito 17de1b
# toggled on activation of spamc, and similarly for spamd.
Chris PeBenito bbcd3c
template(`spamassassin_per_role_template',`
Chris PeBenito 17de1b
Chris PeBenito 6b19be
	gen_require(`
Chris PeBenito 6b19be
		type spamc_exec_t, spamassassin_exec_t;
Chris PeBenito 6b19be
		type spamd_t, spamd_tmp_t;
Chris PeBenito 6b19be
	')
Chris PeBenito 6b19be
Chris PeBenito 17de1b
	##############################
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
	# Declarations
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	type $1_spamc_t;
Chris PeBenito d46cfe
	application_domain($1_spamc_t,spamc_exec_t)
Chris PeBenito 17de1b
	role $3 types $1_spamc_t;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	type $1_spamc_tmp_t;
Chris PeBenito 17de1b
	files_tmp_file($1_spamc_tmp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	type $1_spamassassin_t;
Chris PeBenito d46cfe
	application_domain($1_spamassassin_t,spamassassin_exec_t)
Chris PeBenito 17de1b
	role $3 types $1_spamassassin_t;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	type $1_spamassassin_home_t alias $1_spamassassin_rw_t;
Chris PeBenito 17de1b
	userdom_user_home_content($1,$1_spamassassin_home_t)
Chris PeBenito 17de1b
	files_poly_member($1_spamassassin_home_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	type $1_spamassassin_tmp_t;
Chris PeBenito 17de1b
	files_tmp_file($1_spamassassin_tmp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	##############################
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
	# $1_spamc_t local policy
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1_spamc_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
Chris PeBenito 17de1b
	allow $1_spamc_t self:fd use;
Chris PeBenito c0868a
	allow $1_spamc_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito c0868a
	allow $1_spamc_t self:sock_file read_sock_file_perms;
Chris PeBenito 17de1b
	allow $1_spamc_t self:shm create_shm_perms;
Chris PeBenito 17de1b
	allow $1_spamc_t self:sem create_sem_perms;
Chris PeBenito 17de1b
	allow $1_spamc_t self:msgq create_msgq_perms;
Chris PeBenito 17de1b
	allow $1_spamc_t self:msg { send receive };
Chris PeBenito 17de1b
	allow $1_spamc_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 17de1b
	allow $1_spamc_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 17de1b
	allow $1_spamc_t self:unix_dgram_socket sendto;
Chris PeBenito 17de1b
	allow $1_spamc_t self:unix_stream_socket connectto;
Chris PeBenito 17de1b
	allow $1_spamc_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 17de1b
	allow $1_spamc_t self:udp_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito c0868a
	manage_dirs_pattern($1_spamc_t,$1_spamc_tmp_t,$1_spamc_tmp_t)
Chris PeBenito c0868a
	manage_files_pattern($1_spamc_t,$1_spamc_tmp_t,$1_spamc_tmp_t)
Chris PeBenito 17de1b
	files_tmp_filetrans($1_spamc_t, $1_spamc_tmp_t, { file dir })
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# Allow connecting to a local spamd
Chris PeBenito 17de1b
	allow $1_spamc_t spamd_t:unix_stream_socket connectto;
Chris PeBenito 17de1b
	allow $1_spamc_t spamd_tmp_t:sock_file rw_file_perms;
Chris PeBenito 17de1b
Chris PeBenito c0868a
	domtrans_pattern($2, spamc_exec_t, $1_spamc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	kernel_read_kernel_sysctls($1_spamc_t)
Chris PeBenito 17de1b
Chris PeBenito 190066
	corenet_all_recvfrom_unlabeled($1_spamc_t)
Chris PeBenito 190066
	corenet_all_recvfrom_netlabel($1_spamc_t)
Chris PeBenito 17de1b
	corenet_tcp_sendrecv_generic_if($1_spamc_t)
Chris PeBenito 17de1b
	corenet_udp_sendrecv_generic_if($1_spamc_t)
Chris PeBenito 17de1b
	corenet_tcp_sendrecv_all_nodes($1_spamc_t)
Chris PeBenito 17de1b
	corenet_udp_sendrecv_all_nodes($1_spamc_t)
Chris PeBenito 17de1b
	corenet_tcp_sendrecv_all_ports($1_spamc_t)
Chris PeBenito 17de1b
	corenet_udp_sendrecv_all_ports($1_spamc_t)
Chris PeBenito 17de1b
	corenet_tcp_connect_all_ports($1_spamc_t)
Chris PeBenito 17de1b
	corenet_sendrecv_all_client_packets($1_spamc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	fs_search_auto_mountpoints($1_spamc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# cjp: these should probably be removed:
Chris PeBenito 17de1b
	corecmd_list_bin($1_spamc_t)
Chris PeBenito 17de1b
	corecmd_read_bin_symlinks($1_spamc_t)
Chris PeBenito 17de1b
	corecmd_read_bin_files($1_spamc_t)
Chris PeBenito 17de1b
	corecmd_read_bin_pipes($1_spamc_t)
Chris PeBenito 17de1b
	corecmd_read_bin_sockets($1_spamc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	domain_use_interactive_fds($1_spamc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_read_etc_files($1_spamc_t)
Chris PeBenito 17de1b
	files_read_etc_runtime_files($1_spamc_t)
Chris PeBenito 17de1b
	files_read_usr_files($1_spamc_t)
Chris PeBenito 17de1b
	files_dontaudit_search_var($1_spamc_t)
Chris PeBenito 17de1b
	# cjp: this may be removable:
Chris PeBenito 17de1b
	files_list_home($1_spamc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	libs_use_ld_so($1_spamc_t)
Chris PeBenito 17de1b
	libs_use_shared_libs($1_spamc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	logging_send_syslog_msg($1_spamc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	miscfiles_read_localization($1_spamc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# cjp: this should probably be removed:
Chris PeBenito 17de1b
	seutil_read_config($1_spamc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	sysnet_read_config($1_spamc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	userdom_use_unpriv_users_fds($1_spamc_t)
Chris PeBenito 17de1b
	# cjp: this really should just be the
Chris PeBenito 17de1b
	# terminal specific to the role
Chris PeBenito 17de1b
	userdom_use_unpriv_users_ptys($1_spamc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# cjp: this should probably be removed:
Chris PeBenito 17de1b
	tunable_policy(`read_default_t',`
Chris PeBenito 17de1b
		files_list_default($1_spamc_t)
Chris PeBenito 17de1b
		files_read_default_files($1_spamc_t)
Chris PeBenito 17de1b
		files_read_default_symlinks($1_spamc_t)
Chris PeBenito 17de1b
		files_read_default_sockets($1_spamc_t)
Chris PeBenito 17de1b
		files_read_default_pipes($1_spamc_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		# Allow connection to spamd socket above
Chris PeBenito 17de1b
		evolution_stream_connect($1,$1_spamc_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		nis_use_ypbind($1_spamc_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		nscd_socket_use($1_spamc_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		mta_read_config($1_spamc_t)
Chris PeBenito 17de1b
		sendmail_stub($1_spamc_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	##############################
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
	# $1_spamassassin_t local policy
Chris PeBenito 17de1b
	#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1_spamassassin_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
Chris PeBenito 17de1b
	allow $1_spamassassin_t self:fd use;
Chris PeBenito c0868a
	allow $1_spamassassin_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito c0868a
	allow $1_spamassassin_t self:sock_file read_sock_file_perms;
Chris PeBenito 17de1b
	allow $1_spamassassin_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 17de1b
	allow $1_spamassassin_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 17de1b
	allow $1_spamassassin_t self:unix_dgram_socket sendto;
Chris PeBenito 17de1b
	allow $1_spamassassin_t self:unix_stream_socket connectto;
Chris PeBenito 17de1b
	allow $1_spamassassin_t self:shm create_shm_perms;
Chris PeBenito 17de1b
	allow $1_spamassassin_t self:sem create_sem_perms;
Chris PeBenito 17de1b
	allow $1_spamassassin_t self:msgq create_msgq_perms;
Chris PeBenito 17de1b
	allow $1_spamassassin_t self:msg { send receive };
Chris PeBenito 17de1b
Chris PeBenito c0868a
	manage_dirs_pattern($1_spamassassin_t, $1_spamassassin_home_t,$1_spamassassin_home_t)
Chris PeBenito c0868a
	manage_files_pattern($1_spamassassin_t, $1_spamassassin_home_t,$1_spamassassin_home_t)
Chris PeBenito c0868a
	manage_lnk_files_pattern($1_spamassassin_t, $1_spamassassin_home_t,$1_spamassassin_home_t)
Chris PeBenito c0868a
	manage_fifo_files_pattern($1_spamassassin_t, $1_spamassassin_home_t,$1_spamassassin_home_t)
Chris PeBenito c0868a
	manage_sock_files_pattern($1_spamassassin_t, $1_spamassassin_home_t,$1_spamassassin_home_t)
Chris PeBenito 17de1b
	userdom_user_home_dir_filetrans($1,$1_spamassassin_t,$1_spamassassin_home_t,{ dir file lnk_file sock_file fifo_file })
Chris PeBenito 17de1b
Chris PeBenito c0868a
	manage_dirs_pattern($1_spamassassin_t, $1_spamassassin_tmp_t,$1_spamassassin_tmp_t)
Chris PeBenito c0868a
	manage_files_pattern($1_spamassassin_t, $1_spamassassin_tmp_t,$1_spamassassin_tmp_t)
Chris PeBenito 17de1b
	files_tmp_filetrans($1_spamassassin_t, $1_spamassassin_tmp_t, { file dir })
Chris PeBenito 17de1b
Chris PeBenito c0868a
	manage_dirs_pattern($2, $1_spamassassin_home_t,$1_spamassassin_home_t)
Chris PeBenito c0868a
	manage_files_pattern($2, $1_spamassassin_home_t,$1_spamassassin_home_t)
Chris PeBenito c0868a
	manage_lnk_files_pattern($2, $1_spamassassin_home_t,$1_spamassassin_home_t)
Chris PeBenito c0868a
	relabel_dirs_pattern($2, $1_spamassassin_home_t,$1_spamassassin_home_t)
Chris PeBenito c0868a
	relabel_files_pattern($2, $1_spamassassin_home_t,$1_spamassassin_home_t)
Chris PeBenito c0868a
	relabel_lnk_files_pattern($2, $1_spamassassin_home_t,$1_spamassassin_home_t)
Chris PeBenito c0868a
Chris PeBenito c0868a
	domtrans_pattern($2, spamassassin_exec_t, $1_spamassassin_t)
Chris PeBenito c0868a
Chris PeBenito c0868a
	manage_dirs_pattern(spamd_t, $1_spamassassin_home_t,$1_spamassassin_home_t)
Chris PeBenito c0868a
	manage_files_pattern(spamd_t, $1_spamassassin_home_t,$1_spamassassin_home_t)
Chris PeBenito c0868a
	manage_lnk_files_pattern(spamd_t, $1_spamassassin_home_t,$1_spamassassin_home_t)
Chris PeBenito c0868a
	manage_fifo_files_pattern(spamd_t, $1_spamassassin_home_t,$1_spamassassin_home_t)
Chris PeBenito c0868a
	manage_sock_files_pattern(spamd_t, $1_spamassassin_home_t,$1_spamassassin_home_t)
Chris PeBenito 17de1b
	userdom_user_home_dir_filetrans($1,spamd_t,$1_spamassassin_home_t,{ dir file lnk_file sock_file fifo_file })
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	kernel_read_kernel_sysctls($1_spamassassin_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	dev_read_urand($1_spamassassin_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	fs_search_auto_mountpoints($1_spamassassin_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# this should probably be removed
Chris PeBenito 17de1b
	corecmd_list_bin($1_spamassassin_t)
Chris PeBenito 17de1b
	corecmd_read_bin_symlinks($1_spamassassin_t)
Chris PeBenito 17de1b
	corecmd_read_bin_files($1_spamassassin_t)
Chris PeBenito 17de1b
	corecmd_read_bin_pipes($1_spamassassin_t)
Chris PeBenito 17de1b
	corecmd_read_bin_sockets($1_spamassassin_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	domain_use_interactive_fds($1_spamassassin_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_read_etc_files($1_spamassassin_t)
Chris PeBenito 17de1b
	files_read_etc_runtime_files($1_spamassassin_t)
Chris PeBenito 17de1b
	files_list_home($1_spamassassin_t)
Chris PeBenito 17de1b
	files_read_usr_files($1_spamassassin_t)
Chris PeBenito 17de1b
	files_dontaudit_search_var($1_spamassassin_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	libs_use_ld_so($1_spamassassin_t)
Chris PeBenito 17de1b
	libs_use_shared_libs($1_spamassassin_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	logging_send_syslog_msg($1_spamassassin_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	miscfiles_read_localization($1_spamassassin_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# cjp: this could probably be removed
Chris PeBenito 17de1b
	seutil_read_config($1_spamassassin_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	sysnet_dns_name_resolve($1_spamassassin_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	userdom_use_unpriv_users_fds($1_spamassassin_t)
Chris PeBenito 17de1b
	userdom_search_user_home_dirs($1,$1_spamassassin_t)
Chris PeBenito 17de1b
	# cjp: this really should just be the
Chris PeBenito 17de1b
	# terminal specific to the role
Chris PeBenito 17de1b
	userdom_use_unpriv_users_ptys($1_spamassassin_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# this should probably be removed:
Chris PeBenito 17de1b
	tunable_policy(`read_default_t',`
Chris PeBenito 17de1b
		files_list_default($1_spamassassin_t)
Chris PeBenito 17de1b
		files_read_default_files($1_spamassassin_t)
Chris PeBenito 17de1b
		files_read_default_symlinks($1_spamassassin_t)
Chris PeBenito 17de1b
		files_read_default_sockets($1_spamassassin_t)
Chris PeBenito 17de1b
		files_read_default_pipes($1_spamassassin_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# set tunable if you have spamassassin do DNS lookups
Chris PeBenito 17de1b
	tunable_policy(`spamassassin_can_network',`
Chris PeBenito 17de1b
		allow $1_spamassassin_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 17de1b
		allow $1_spamassassin_t self:udp_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 190066
		corenet_all_recvfrom_unlabeled($1_spamassassin_t)
Chris PeBenito 190066
		corenet_all_recvfrom_netlabel($1_spamassassin_t)
Chris PeBenito 17de1b
		corenet_tcp_sendrecv_generic_if($1_spamassassin_t)
Chris PeBenito 17de1b
		corenet_udp_sendrecv_generic_if($1_spamassassin_t)
Chris PeBenito 17de1b
		corenet_tcp_sendrecv_all_nodes($1_spamassassin_t)
Chris PeBenito 17de1b
		corenet_udp_sendrecv_all_nodes($1_spamassassin_t)
Chris PeBenito 17de1b
		corenet_tcp_sendrecv_all_ports($1_spamassassin_t)
Chris PeBenito 17de1b
		corenet_udp_sendrecv_all_ports($1_spamassassin_t)
Chris PeBenito 17de1b
		corenet_tcp_connect_all_ports($1_spamassassin_t)
Chris PeBenito 17de1b
		corenet_sendrecv_all_client_packets($1_spamassassin_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
		sysnet_read_config($1_spamassassin_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	tunable_policy(`use_nfs_home_dirs',`
Chris PeBenito 17de1b
		fs_manage_nfs_dirs($1_spamassassin_t)
Chris PeBenito 17de1b
		fs_manage_nfs_files($1_spamassassin_t)
Chris PeBenito 17de1b
		fs_manage_nfs_symlinks($1_spamassassin_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	tunable_policy(`use_samba_home_dirs',`
Chris PeBenito 17de1b
		fs_manage_cifs_dirs($1_spamassassin_t)
Chris PeBenito 17de1b
		fs_manage_cifs_files($1_spamassassin_t)
Chris PeBenito 17de1b
		fs_manage_cifs_symlinks($1_spamassassin_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		# Write pid file and socket in ~/.evolution/cache/tmp
Chris PeBenito 17de1b
		evolution_home_filetrans($1,spamd_t,spamd_tmp_t,{ file sock_file })
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		# cjp: clearly some redundancy here
Chris PeBenito 17de1b
Chris PeBenito 17de1b
		nis_use_ypbind($1_spamassassin_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
		tunable_policy(`spamassassin_can_network && allow_ypbind',`
Chris PeBenito 17de1b
			nis_use_ypbind_uncond($1_spamassassin_t)
Chris PeBenito 17de1b
		')
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	optional_policy(`
Chris PeBenito 17de1b
		mta_read_config($1_spamassassin_t)
Chris PeBenito 17de1b
		sendmail_stub($1_spamassassin_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	# For perl libraries.
Chris PeBenito 17de1b
	allow $1_spamassassin_t lib_t:file rx_file_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute the standalone spamassassin
Chris PeBenito 17de1b
##	program in the caller directory.
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(`spamassassin_exec',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type spamassassin_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	can_exec($1,spamassassin_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Singnal the spam assassin daemon
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##      <summary>
Chris PeBenito 17de1b
##      The type of the process performing this action.
Chris PeBenito 17de1b
##      </summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`spamassassin_signal_spamd',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type spamd_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 spamd_t:process signal;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute the spamassassin daemon
Chris PeBenito 17de1b
##	program in the caller directory.
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(`spamassassin_exec_spamd',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type spamd_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	can_exec($1,spamd_exec_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##      Execute spamassassin client in the user spamassassin client domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <desc>
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	This is a template and should only be called 
Chris PeBenito 17de1b
##	from per user domain tempaltes.
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
## </desc>
Chris PeBenito 17de1b
## <param name="prefix">
Chris PeBenito 17de1b
##      <summary>
Chris PeBenito 17de1b
##      The prefix of the user domain. eg user would be the prefix of user_t.
Chris PeBenito 17de1b
##      </summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##      <summary>
Chris PeBenito 17de1b
##      The type of the process performing this action.
Chris PeBenito 17de1b
##      </summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
template(`spamassassin_domtrans_user_client',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type $1_spamc_t, spamc_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito c0868a
	domtrans_pattern($2,spamc_exec_t,$1_spamc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute the spamassassin client
Chris PeBenito 17de1b
##	program in the caller directory.
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(`spamassassin_exec_client',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type spamc_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	can_exec($1,spamc_exec_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##      Execute spamassassin in the user spamassassin domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <desc>
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##	This is a template and should only be called 
Chris PeBenito 17de1b
##	from per user domain tempaltes.
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
## </desc>
Chris PeBenito 17de1b
## <param name="prefix">
Chris PeBenito 17de1b
##      <summary>
Chris PeBenito 17de1b
##	The prefix of the user domain. eg user would be the prefix of user_t.
Chris PeBenito 17de1b
##      </summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##      <summary>
Chris PeBenito 17de1b
##      The type of the process performing this action.
Chris PeBenito 17de1b
##      </summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
template(`spamassassin_domtrans_user_local_client',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type $1_spamassassin_t, spamassassin_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito c0868a
	domtrans_pattern($2,spamassassin_exec_t,$1_spamassassin_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 59bedc
##	read spamd lib files.
Chris PeBenito 59bedc
## </summary>
Chris PeBenito 59bedc
## <param name="domain">
Chris PeBenito 59bedc
##	<summary>
Chris PeBenito 59bedc
##	Domain allowed access.
Chris PeBenito 59bedc
##	</summary>
Chris PeBenito 59bedc
## </param>
Chris PeBenito 59bedc
#
Chris PeBenito 59bedc
interface(`spamassassin_read_lib_files',`
Chris PeBenito 59bedc
	gen_require(`
Chris PeBenito 59bedc
		type spamd_var_lib_t;
Chris PeBenito 59bedc
	')
Chris PeBenito 59bedc
Chris PeBenito 59bedc
	files_search_var_lib($1)
Chris PeBenito 59bedc
	read_files_pattern($1,spamd_var_lib_t,spamd_var_lib_t)
Chris PeBenito 59bedc
')
Chris PeBenito 59bedc
Chris PeBenito 59bedc
########################################
Chris PeBenito 59bedc
## <summary>
Chris PeBenito 59bedc
##	Create, read, write, and delete
Chris PeBenito 59bedc
##	spamd lib files.
Chris PeBenito 59bedc
## </summary>
Chris PeBenito 59bedc
## <param name="domain">
Chris PeBenito 59bedc
##	<summary>
Chris PeBenito 59bedc
##	Domain allowed access.
Chris PeBenito 59bedc
##	</summary>
Chris PeBenito 59bedc
## </param>
Chris PeBenito 59bedc
#
Chris PeBenito 59bedc
interface(`spamassassin_manage_lib_files',`
Chris PeBenito 59bedc
	gen_require(`
Chris PeBenito 59bedc
		type spamd_var_lib_t;
Chris PeBenito 59bedc
	')
Chris PeBenito 59bedc
Chris PeBenito 59bedc
	files_search_var_lib($1)
Chris PeBenito 59bedc
	manage_files_pattern($1,spamd_var_lib_t,spamd_var_lib_t)
Chris PeBenito 59bedc
')
Chris PeBenito 59bedc
Chris PeBenito 59bedc
########################################
Chris PeBenito 59bedc
## <summary>
Chris PeBenito 17de1b
##      Read temporary spamd file.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##      <summary>
Chris PeBenito 17de1b
##      The type of the process performing this action.
Chris PeBenito 17de1b
##      </summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`spamassassin_read_spamd_tmp_files',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type spamd_tmp_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito c0868a
	allow $1 spamd_tmp_t:file read_file_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Do not audit attempts to get attributes of temporary
Chris PeBenito 17de1b
##	spamd sockets/
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##      <summary>
Chris PeBenito 17de1b
##	Domain to not audit.
Chris PeBenito 17de1b
##      </summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`spamassassin_dontaudit_getattr_spamd_tmp_sockets',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type spamd_tmp_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	dontaudit $1 spamd_tmp_t:sock_file getattr;
Chris PeBenito 17de1b
')