Chris PeBenito 17de1b
## <summary>Filter used for removing unsolicited email.</summary>
Chris PeBenito 17de1b
Chris PeBenito 296273
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 296273
##	Role access for spamassassin
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 296273
## <param name="role">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 296273
##	Role allowed access
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 296273
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 296273
##	User domain for the role
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 296273
interface(`spamassassin_role',`
Chris PeBenito 6b19be
	gen_require(`
Chris PeBenito 296273
		type spamc_t, spamc_exec_t, spamc_tmp_t;
Chris PeBenito 296273
		type spamassassin_t, spamassassin_exec_t;
Chris PeBenito 296273
		type spamassassin_home_t, spamassassin_tmp_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 296273
	role $1 types { spamc_t spamassassin_t };
Chris PeBenito 350b6a
Chris PeBenito 296273
	domtrans_pattern($2, spamassassin_exec_t, spamassassin_t)
Dominick Grift 4ff4dd
Dominick Grift 4ff4dd
	allow $2 spamassassin_t:process { ptrace signal_perms };
Chris PeBenito 296273
	ps_process_pattern($2, spamassassin_t)
Chris PeBenito 17de1b
Chris PeBenito 296273
	domtrans_pattern($2, spamc_exec_t, spamc_t)
Dominick Grift 4ff4dd
Dominick Grift 4ff4dd
	allow $2 spamc_t:process { ptrace signal_perms };
Chris PeBenito 296273
	ps_process_pattern($2, spamc_t)
Chris PeBenito 17de1b
Chris PeBenito 296273
	manage_dirs_pattern($2, spamassassin_home_t, spamassassin_home_t)
Chris PeBenito 296273
	manage_files_pattern($2, spamassassin_home_t, spamassassin_home_t)
Chris PeBenito 296273
	manage_lnk_files_pattern($2, spamassassin_home_t, spamassassin_home_t)
Chris PeBenito 296273
	relabel_dirs_pattern($2, spamassassin_home_t, spamassassin_home_t)
Chris PeBenito 296273
	relabel_files_pattern($2, spamassassin_home_t, spamassassin_home_t)
Chris PeBenito 296273
	relabel_lnk_files_pattern($2, spamassassin_home_t, spamassassin_home_t)
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 0bfccd
	can_exec($1, spamassassin_exec_t)
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 ff8f0a
##	<summary>
Chris PeBenito a72e42
##	Domain allowed access.
Chris PeBenito ff8f0a
##	</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 0bfccd
	can_exec($1, spamd_exec_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito ff8f0a
##	Execute spamassassin client in the spamassassin client domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 296273
##	<summary>
Dominick Grift 288845
##	Domain allowed to transition.
Chris PeBenito 296273
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 296273
interface(`spamassassin_domtrans_client',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 296273
		type spamc_t, spamc_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 296273
	domtrans_pattern($1, spamc_exec_t, spamc_t)
Dan Walsh 3eaa99
	allow $1 spamc_exec_t:file ioctl;
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
## <summary>
Dan Walsh 3eaa99
##	Send kill signal to spamassassin client
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dan Walsh 3eaa99
##	<summary>
Dan Walsh 3eaa99
##	Domain allowed access.
Dan Walsh 3eaa99
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
interface(`spamassassin_kill_client',`
Dan Walsh 3eaa99
	gen_require(`
Dan Walsh 3eaa99
		type spamc_t;
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	allow $1 spamc_t:process sigkill;
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
## <summary>
Dan Walsh 3eaa99
##	Manage spamc home files.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dan Walsh 3eaa99
##	<summary>
Dan Walsh 3eaa99
##	Domain allowed access.
Dan Walsh 3eaa99
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
interface(`spamassassin_manage_home_client',`
Dan Walsh 3eaa99
	gen_require(`
Dan Walsh 3eaa99
		type spamc_home_t;
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dominick Grift f92662
	userdom_search_user_home_dirs($1)
Dan Walsh 3eaa99
	manage_dirs_pattern($1, spamc_home_t, spamc_home_t)
Dan Walsh 3eaa99
	manage_files_pattern($1, spamc_home_t, spamc_home_t)
Dan Walsh 3eaa99
	manage_lnk_files_pattern($1, spamc_home_t, spamc_home_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 0bfccd
	can_exec($1, spamc_exec_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 296273
##	Execute spamassassin standalone client in the user spamassassin domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 296273
##	<summary>
Dominick Grift 288845
##	Domain allowed to transition.
Chris PeBenito 296273
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 296273
interface(`spamassassin_domtrans_local_client',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 296273
		type spamassassin_t, spamassassin_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 296273
	domtrans_pattern($1, spamassassin_exec_t, 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)
Dan Walsh 3eaa99
	list_dirs_pattern($1, spamd_var_lib_t, spamd_var_lib_t)
Chris PeBenito 0bfccd
	read_files_pattern($1, spamd_var_lib_t, spamd_var_lib_t)
Dan Walsh 3eaa99
	read_lnk_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 0bfccd
	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 ff8f0a
##	Read temporary spamd file.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito ff8f0a
##	<summary>
Chris PeBenito a72e42
##	Domain allowed access.
Chris PeBenito ff8f0a
##	</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
Dominick Grift f92662
	files_search_tmp($1)
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 ff8f0a
##	<summary>
Chris PeBenito 17de1b
##	Domain to not audit.
Chris PeBenito ff8f0a
##	</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
Dominick Grift 59c034
	dontaudit $1 spamd_tmp_t:sock_file getattr_sock_file_perms;
Chris PeBenito 17de1b
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
## <summary>
Dan Walsh 3eaa99
##	Connect to run spamd.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dan Walsh 3eaa99
##	<summary>
Dan Walsh 3eaa99
##	Domain allowed to connect.
Dan Walsh 3eaa99
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
interface(`spamd_stream_connect',`
Dan Walsh 3eaa99
	gen_require(`
Dominick Grift c5cadd
		type spamd_t, spamd_var_run_t;
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dominick Grift f92662
	files_search_pids($1)
Dan Walsh 3eaa99
	stream_connect_pattern($1, spamd_var_run_t, spamd_var_run_t, spamd_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
## <summary>
Dan Walsh 3eaa99
##	All of the rules required to administrate
Dan Walsh 3eaa99
##	an spamassassin environment
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dan Walsh 3eaa99
##	<summary>
Dan Walsh 3eaa99
##	Domain allowed access.
Dan Walsh 3eaa99
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
## <param name="role">
Dan Walsh 3eaa99
##	<summary>
Dan Walsh 3eaa99
##	The role to be allowed to manage the spamassassin domain.
Dan Walsh 3eaa99
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
## <rolecap/>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
interface(`spamassassin_spamd_admin',`
Dan Walsh 3eaa99
	gen_require(`
Dan Walsh 3eaa99
		type spamd_t, spamd_tmp_t, spamd_log_t;
Dan Walsh 3eaa99
		type spamd_spool_t, spamd_var_lib_t, spamd_var_run_t;
Dan Walsh 3eaa99
		type spamd_initrc_exec_t;
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	allow $1 spamd_t:process { ptrace signal_perms };
Dan Walsh 3eaa99
	ps_process_pattern($1, spamd_t)
Dominick Grift dcf874
Dan Walsh 3eaa99
	init_labeled_script_domtrans($1, spamd_initrc_exec_t)
Dan Walsh 3eaa99
	domain_system_change_exemption($1)
Dan Walsh 3eaa99
	role_transition $2 spamd_initrc_exec_t system_r;
Dan Walsh 3eaa99
	allow $2 system_r;
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	files_list_tmp($1)
Dan Walsh 3eaa99
	admin_pattern($1, spamd_tmp_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	logging_list_logs($1)
Dan Walsh 3eaa99
	admin_pattern($1, spamd_log_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	files_list_spool($1)
Dan Walsh 3eaa99
	admin_pattern($1, spamd_spool_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	files_list_var_lib($1)
Dan Walsh 3eaa99
	admin_pattern($1, spamd_var_lib_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	files_list_pids($1)
Dan Walsh 3eaa99
	admin_pattern($1, spamd_var_run_t)
Dan Walsh 3eaa99
')