Chris PeBenito 17de1b
Chris PeBenito d46cfe
policy_module(spamassassin,1.7.1)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 56e1b3
ifdef(`strict_policy',`
Chris PeBenito 56e1b3
## <desc>
Chris PeBenito 56e1b3
## 

Chris PeBenito 56e1b3
## Allow user spamassassin clients to use the network.
Chris PeBenito 56e1b3
## 

Chris PeBenito 56e1b3
## </desc>
Chris PeBenito 56e1b3
gen_tunable(spamassassin_can_network,false)
Chris PeBenito 56e1b3
')
Chris PeBenito 56e1b3
Chris PeBenito 56e1b3
ifdef(`targeted_policy',`
Chris PeBenito 56e1b3
## <desc>
Chris PeBenito 56e1b3
## 

Chris PeBenito 56e1b3
## Allow spamd to read/write user home directories.
Chris PeBenito 56e1b3
## 

Chris PeBenito 56e1b3
## </desc>
Chris PeBenito 56e1b3
gen_tunable(spamd_enable_home_dirs,true)
Chris PeBenito 56e1b3
')
Chris PeBenito 56e1b3
Chris PeBenito 17de1b
# spamassassin client executable
Chris PeBenito 17de1b
type spamc_exec_t;
Chris PeBenito d46cfe
application_executable_file(spamc_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type spamd_t;
Chris PeBenito 17de1b
type spamd_exec_t;
Chris PeBenito 17de1b
init_daemon_domain(spamd_t,spamd_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type spamd_spool_t;
Chris PeBenito 17de1b
files_type(spamd_spool_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type spamd_tmp_t;
Chris PeBenito 17de1b
files_tmp_file(spamd_tmp_t)
Chris PeBenito 17de1b
Chris PeBenito 59bedc
# var/lib files
Chris PeBenito 59bedc
type spamd_var_lib_t;
Chris PeBenito 59bedc
files_type(spamd_var_lib_t)
Chris PeBenito 59bedc
Chris PeBenito 17de1b
type spamd_var_run_t;
Chris PeBenito 17de1b
files_pid_file(spamd_var_run_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type spamassassin_exec_t;
Chris PeBenito d46cfe
application_executable_file(spamassassin_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Spamassassin daemon local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Spamassassin, when run as root and using per-user config files,
Chris PeBenito 17de1b
# setuids to the user running spamc.  Comment this if you are not
Chris PeBenito 17de1b
# using this ability.
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow spamd_t self:capability { setuid setgid dac_override sys_tty_config };
Chris PeBenito 17de1b
dontaudit spamd_t self:capability sys_tty_config;
Chris PeBenito 17de1b
allow spamd_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
Chris PeBenito 17de1b
allow spamd_t self:fd use;
Chris PeBenito c0868a
allow spamd_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito c0868a
allow spamd_t self:sock_file read_sock_file_perms;
Chris PeBenito 17de1b
allow spamd_t self:shm create_shm_perms;
Chris PeBenito 17de1b
allow spamd_t self:sem create_sem_perms;
Chris PeBenito 17de1b
allow spamd_t self:msgq create_msgq_perms;
Chris PeBenito 17de1b
allow spamd_t self:msg { send receive };
Chris PeBenito 17de1b
allow spamd_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 17de1b
allow spamd_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow spamd_t self:unix_dgram_socket sendto;
Chris PeBenito 17de1b
allow spamd_t self:unix_stream_socket connectto;
Chris PeBenito 17de1b
allow spamd_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow spamd_t self:udp_socket create_socket_perms;
Chris PeBenito d9845a
allow spamd_t self:netlink_route_socket r_netlink_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito c0868a
manage_dirs_pattern(spamd_t,spamd_spool_t,spamd_spool_t)
Chris PeBenito c0868a
manage_files_pattern(spamd_t,spamd_spool_t,spamd_spool_t)
Chris PeBenito 17de1b
files_spool_filetrans(spamd_t,spamd_spool_t, { file dir })
Chris PeBenito 17de1b
Chris PeBenito c0868a
manage_dirs_pattern(spamd_t,spamd_tmp_t,spamd_tmp_t)
Chris PeBenito c0868a
manage_files_pattern(spamd_t,spamd_tmp_t,spamd_tmp_t)
Chris PeBenito 17de1b
files_tmp_filetrans(spamd_t, spamd_tmp_t, { file dir })
Chris PeBenito 17de1b
Chris PeBenito 59bedc
# var/lib files for spamd
Chris PeBenito 59bedc
allow spamd_t spamd_var_lib_t:dir list_dir_perms;
Chris PeBenito 59bedc
read_files_pattern(spamd_t,spamd_var_lib_t,spamd_var_lib_t)
Chris PeBenito 59bedc
Chris PeBenito c0868a
manage_files_pattern(spamd_t,spamd_var_run_t,spamd_var_run_t)
Chris PeBenito 17de1b
files_pid_filetrans(spamd_t,spamd_var_run_t,file)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_all_sysctls(spamd_t)
Chris PeBenito 17de1b
kernel_read_system_state(spamd_t)
Chris PeBenito 17de1b
Chris PeBenito 190066
corenet_all_recvfrom_unlabeled(spamd_t)
Chris PeBenito 190066
corenet_all_recvfrom_netlabel(spamd_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_if(spamd_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_if(spamd_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_nodes(spamd_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_nodes(spamd_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_ports(spamd_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_ports(spamd_t)
Chris PeBenito 17de1b
corenet_tcp_bind_all_nodes(spamd_t)
Chris PeBenito 17de1b
corenet_tcp_bind_spamd_port(spamd_t)
Chris PeBenito 17de1b
corenet_tcp_connect_razor_port(spamd_t)
Chris PeBenito 6649ae
corenet_tcp_connect_smtp_port(spamd_t)
Chris PeBenito 17de1b
corenet_sendrecv_razor_client_packets(spamd_t)
Chris PeBenito 17de1b
corenet_sendrecv_spamd_server_packets(spamd_t)
Chris PeBenito 17de1b
# spamassassin 3.1 needs this for its
Chris PeBenito 17de1b
# DnsResolver.pm module which binds to
Chris PeBenito 17de1b
# random ports >= 1024.
Chris PeBenito 17de1b
corenet_udp_bind_all_nodes(spamd_t)
Chris PeBenito 17de1b
corenet_udp_bind_generic_port(spamd_t)
Chris PeBenito 17de1b
corenet_udp_bind_imaze_port(spamd_t)
Chris PeBenito d6d16b
corenet_dontaudit_udp_bind_all_ports(spamd_t)
Chris PeBenito 17de1b
corenet_sendrecv_imaze_server_packets(spamd_t)
Chris PeBenito 17de1b
corenet_sendrecv_generic_server_packets(spamd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_sysfs(spamd_t)
Chris PeBenito 17de1b
dev_read_urand(spamd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
fs_getattr_all_fs(spamd_t)
Chris PeBenito 17de1b
fs_search_auto_mountpoints(spamd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
auth_dontaudit_read_shadow(spamd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
corecmd_exec_bin(spamd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_use_interactive_fds(spamd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_read_usr_files(spamd_t)
Chris PeBenito 17de1b
files_read_etc_files(spamd_t)
Chris PeBenito 17de1b
files_read_etc_runtime_files(spamd_t)
Chris PeBenito 6b19be
# /var/lib/spamassin
Chris PeBenito 6b19be
files_read_var_lib_files(spamd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
init_dontaudit_rw_utmp(spamd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
libs_use_ld_so(spamd_t)
Chris PeBenito 17de1b
libs_use_shared_libs(spamd_t)
Chris PeBenito 17de1b
# Various Perl bits
Chris PeBenito 17de1b
libs_use_lib_files(spamd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_send_syslog_msg(spamd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(spamd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
sysnet_read_config(spamd_t)
Chris PeBenito 17de1b
sysnet_use_ldap(spamd_t)
Chris PeBenito 17de1b
sysnet_dns_name_resolve(spamd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
userdom_use_unpriv_users_fds(spamd_t)
Chris PeBenito 17de1b
userdom_search_unpriv_users_home_dirs(spamd_t)
Chris PeBenito 17de1b
userdom_dontaudit_search_sysadm_home_dirs(spamd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`targeted_policy',`
Chris PeBenito 17de1b
	term_dontaudit_use_unallocated_ttys(spamd_t)
Chris PeBenito 17de1b
	term_dontaudit_use_generic_ptys(spamd_t)
Chris PeBenito eac818
Chris PeBenito 17de1b
	files_dontaudit_read_root_files(spamd_t)
Chris PeBenito eac818
Chris PeBenito 17de1b
	tunable_policy(`spamd_enable_home_dirs',`
Chris PeBenito 17de1b
		userdom_manage_generic_user_home_content_dirs(spamd_t)
Chris PeBenito 17de1b
		userdom_manage_generic_user_home_content_files(spamd_t)
Chris PeBenito 17de1b
		userdom_manage_generic_user_home_content_symlinks(spamd_t)
Chris PeBenito 0cca51
		userdom_generic_user_home_dir_filetrans_generic_user_home_content(spamd_t,dir)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
tunable_policy(`use_nfs_home_dirs',`
Chris PeBenito 17de1b
	fs_manage_nfs_files(spamd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
tunable_policy(`use_samba_home_dirs',`
Chris PeBenito 17de1b
	fs_manage_cifs_files(spamd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	amavis_manage_lib_files(spamd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	cron_system_entry(spamd_t,spamd_exec_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	daemontools_service_domain(spamd_t,spamd_exec_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	dcc_domtrans_client(spamd_t)
Chris PeBenito 17de1b
	dcc_stream_connect_dccifd(spamd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 6649ae
	mysql_search_db(spamd_t)
Chris PeBenito 6649ae
	mysql_stream_connect(spamd_t)
Chris PeBenito 6649ae
')
Chris PeBenito 6649ae
Chris PeBenito 6649ae
optional_policy(`
Chris PeBenito 17de1b
	nis_use_ypbind(spamd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito a5e213
	postfix_read_config(spamd_t)
Chris PeBenito a5e213
')
Chris PeBenito a5e213
Chris PeBenito a5e213
optional_policy(`
Chris PeBenito 17de1b
	postgresql_stream_connect(spamd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	pyzor_domtrans(spamd_t)
Chris PeBenito b5a6c8
	pyzor_signal(spamd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	razor_domtrans(spamd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	seutil_sigchld_newrole(spamd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	sendmail_stub(spamd_t)
Chris PeBenito 17de1b
	mta_read_config(spamd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	udev_read_db(spamd_t)
Chris PeBenito 17de1b
')