Chris PeBenito f932d8
Chris PeBenito d3d270
policy_module(spamassassin,1.2.0)
Chris PeBenito f932d8
Chris PeBenito f932d8
########################################
Chris PeBenito f932d8
#
Chris PeBenito f932d8
# Declarations
Chris PeBenito f932d8
#
Chris PeBenito f932d8
Chris PeBenito f932d8
# spamassassin client executable
Chris PeBenito f932d8
type spamc_exec_t;
Chris PeBenito f932d8
files_type(spamc_exec_t)
Chris PeBenito f932d8
Chris PeBenito f932d8
type spamd_t;
Chris PeBenito f932d8
type spamd_exec_t;
Chris PeBenito f932d8
init_daemon_domain(spamd_t,spamd_exec_t)
Chris PeBenito f932d8
Chris PeBenito f932d8
type spamd_tmp_t;
Chris PeBenito f932d8
files_tmp_file(spamd_tmp_t)
Chris PeBenito f932d8
Chris PeBenito f932d8
type spamd_var_run_t;
Chris PeBenito f932d8
files_pid_file(spamd_var_run_t)
Chris PeBenito f932d8
Chris PeBenito f932d8
type spamassassin_exec_t;
Chris PeBenito f932d8
files_type(spamassassin_exec_t)
Chris PeBenito f932d8
Chris PeBenito f932d8
########################################
Chris PeBenito f932d8
#
Chris PeBenito f932d8
# Spamassassin daemon local policy
Chris PeBenito f932d8
#
Chris PeBenito f932d8
Chris PeBenito f932d8
# Spamassassin, when run as root and using per-user config files,
Chris PeBenito f932d8
# setuids to the user running spamc.  Comment this if you are not
Chris PeBenito f932d8
# using this ability.
Chris PeBenito f932d8
Chris PeBenito f932d8
allow spamd_t self:capability { setuid setgid dac_override sys_tty_config };
Chris PeBenito f932d8
dontaudit spamd_t self:capability sys_tty_config;
Chris PeBenito f932d8
allow spamd_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
Chris PeBenito f932d8
allow spamd_t self:fd use;
Chris PeBenito f932d8
allow spamd_t self:fifo_file rw_file_perms;
Chris PeBenito 725926
allow spamd_t self:sock_file r_file_perms;
Chris PeBenito f932d8
allow spamd_t self:shm create_shm_perms;
Chris PeBenito f932d8
allow spamd_t self:sem create_sem_perms;
Chris PeBenito f932d8
allow spamd_t self:msgq create_msgq_perms;
Chris PeBenito f932d8
allow spamd_t self:msg { send receive };
Chris PeBenito f932d8
allow spamd_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito f932d8
allow spamd_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito f932d8
allow spamd_t self:unix_dgram_socket sendto;
Chris PeBenito f932d8
allow spamd_t self:unix_stream_socket connectto;
Chris PeBenito f932d8
allow spamd_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito f932d8
allow spamd_t self:udp_socket create_socket_perms;
Chris PeBenito f932d8
Chris PeBenito f932d8
allow spamd_t spamd_tmp_t:dir create_dir_perms;
Chris PeBenito f932d8
allow spamd_t spamd_tmp_t:file create_file_perms;
Chris PeBenito 9d5949
files_filetrans_tmp(spamd_t, spamd_tmp_t, { file dir })
Chris PeBenito f932d8
Chris PeBenito f932d8
allow spamd_t spamd_var_run_t:file create_file_perms;
Chris PeBenito f932d8
allow spamd_t spamd_var_run_t:dir rw_dir_perms;
Chris PeBenito 9d5949
files_filetrans_pid(spamd_t,spamd_var_run_t)
Chris PeBenito f932d8
Chris PeBenito f932d8
kernel_read_all_sysctl(spamd_t)
Chris PeBenito f932d8
kernel_read_system_state(spamd_t)
Chris PeBenito 6820a3
kernel_tcp_recvfrom(spamd_t)
Chris PeBenito f932d8
Chris PeBenito f932d8
corenet_tcp_sendrecv_all_if(spamd_t)
Chris PeBenito f932d8
corenet_udp_sendrecv_all_if(spamd_t)
Chris PeBenito f932d8
corenet_raw_sendrecv_all_if(spamd_t)
Chris PeBenito f932d8
corenet_tcp_sendrecv_all_nodes(spamd_t)
Chris PeBenito f932d8
corenet_udp_sendrecv_all_nodes(spamd_t)
Chris PeBenito f932d8
corenet_raw_sendrecv_all_nodes(spamd_t)
Chris PeBenito 162dfc
corenet_tcp_sendrecv_all_ports(spamd_t)
Chris PeBenito 162dfc
corenet_udp_sendrecv_all_ports(spamd_t)
Chris PeBenito bd7037
corenet_non_ipsec_sendrecv(spamd_t)
Chris PeBenito f932d8
corenet_tcp_bind_all_nodes(spamd_t)
Chris PeBenito f932d8
corenet_udp_bind_all_nodes(spamd_t)
Chris PeBenito f932d8
corenet_tcp_bind_spamd_port(spamd_t)
Chris PeBenito 049e11
# spamassassin 3.1 needs this for its
Chris PeBenito 049e11
# DnsResolver.pm module which binds to
Chris PeBenito 049e11
# random ports >= 1024.
Chris PeBenito 049e11
corenet_udp_bind_generic_port(spamd_t)
Chris PeBenito f932d8
Chris PeBenito f932d8
dev_read_sysfs(spamd_t)
Chris PeBenito f932d8
dev_read_urand(spamd_t)
Chris PeBenito f932d8
Chris PeBenito f932d8
fs_getattr_all_fs(spamd_t)
Chris PeBenito f932d8
fs_search_auto_mountpoints(spamd_t)
Chris PeBenito f932d8
Chris PeBenito f932d8
term_dontaudit_use_console(spamd_t)
Chris PeBenito f932d8
Chris PeBenito f932d8
auth_dontaudit_read_shadow(spamd_t)
Chris PeBenito f932d8
Chris PeBenito f932d8
corecmd_exec_bin(spamd_t)
Chris PeBenito f932d8
corecmd_search_sbin(spamd_t)
Chris PeBenito f932d8
Chris PeBenito f932d8
domain_use_wide_inherit_fd(spamd_t)
Chris PeBenito f932d8
Chris PeBenito f932d8
files_read_usr_files(spamd_t)
Chris PeBenito f932d8
files_read_etc_files(spamd_t)
Chris PeBenito f932d8
files_read_etc_runtime_files(spamd_t)
Chris PeBenito f932d8
Chris PeBenito f932d8
init_use_fd(spamd_t)
Chris PeBenito f932d8
init_use_script_pty(spamd_t)
Chris PeBenito 68228b
init_dontaudit_rw_utmp(spamd_t)
Chris PeBenito f932d8
Chris PeBenito f932d8
libs_use_ld_so(spamd_t)
Chris PeBenito f932d8
libs_use_shared_libs(spamd_t)
Chris PeBenito f932d8
# Various Perl bits
Chris PeBenito f932d8
libs_use_lib(spamd_t)
Chris PeBenito f932d8
Chris PeBenito f932d8
logging_send_syslog_msg(spamd_t)
Chris PeBenito f932d8
Chris PeBenito f932d8
miscfiles_read_localization(spamd_t)
Chris PeBenito f932d8
Chris PeBenito f932d8
sysnet_read_config(spamd_t)
Chris PeBenito f932d8
Chris PeBenito f932d8
userdom_use_unpriv_users_fd(spamd_t)
Chris PeBenito f932d8
userdom_search_unpriv_user_home_dirs(spamd_t)
Chris PeBenito f932d8
userdom_dontaudit_search_sysadm_home_dir(spamd_t)
Chris PeBenito f932d8
Chris PeBenito f932d8
ifdef(`targeted_policy',`
Chris PeBenito f932d8
	term_dontaudit_use_unallocated_tty(spamd_t)
Chris PeBenito f932d8
	term_dontaudit_use_generic_pty(spamd_t)
Chris PeBenito f932d8
	files_dontaudit_read_root_file(spamd_t)
Chris PeBenito 9cca1c
	userdom_manage_generic_user_home_dirs(spamd_t)
Chris PeBenito 9cca1c
	userdom_manage_generic_user_home_files(spamd_t)
Chris PeBenito f932d8
')
Chris PeBenito f932d8
Chris PeBenito f932d8
tunable_policy(`use_nfs_home_dirs',`
Chris PeBenito f932d8
	fs_manage_nfs_files(spamd_t)
Chris PeBenito f932d8
')
Chris PeBenito f932d8
Chris PeBenito f932d8
tunable_policy(`use_samba_home_dirs',`
Chris PeBenito f932d8
	fs_manage_cifs_files(spamd_t)
Chris PeBenito f932d8
')
Chris PeBenito f932d8
Chris PeBenito 132880
optional_policy(`cron',`
Chris PeBenito f932d8
	cron_system_entry(spamd_t,spamd_exec_t)
Chris PeBenito f932d8
')
Chris PeBenito f932d8
Chris PeBenito 44d5d9
optional_policy(`daemontools',`
Chris PeBenito 44d5d9
	daemontools_service_domain(spamd_t,spamd_exec_t)
Chris PeBenito 44d5d9
')
Chris PeBenito 44d5d9
Chris PeBenito 132880
optional_policy(`nis',`
Chris PeBenito f932d8
	nis_use_ypbind(spamd_t)
Chris PeBenito f932d8
')
Chris PeBenito f932d8
Chris PeBenito 132880
optional_policy(`selinuxutil',`
Chris PeBenito f932d8
	seutil_sigchld_newrole(spamd_t)
Chris PeBenito f932d8
')
Chris PeBenito f932d8
Chris PeBenito 132880
optional_policy(`sendmail',`
Chris PeBenito f932d8
	sendmail_stub(spamd_t)
Chris PeBenito f932d8
	mta_read_config(spamd_t)
Chris PeBenito f932d8
')
Chris PeBenito f932d8
Chris PeBenito 132880
optional_policy(`udev',`
Chris PeBenito f932d8
	udev_read_db(spamd_t)
Chris PeBenito f932d8
')
Chris PeBenito f932d8
Chris PeBenito f932d8
ifdef(`TODO',`
Chris PeBenito 132880
optional_policy(`amavis', `
Chris PeBenito f932d8
# for bayes tokens
Chris PeBenito f932d8
allow spamd_t var_lib_t:dir { getattr search };
Chris PeBenito f932d8
allow spamd_t amavisd_lib_t:dir rw_dir_perms;
Chris PeBenito f932d8
allow spamd_t amavisd_lib_t:file create_file_perms;
Chris PeBenito f932d8
allow spamd_t amavisd_lib_t:lnk_file create_lnk_perms;
Chris PeBenito f932d8
')
Chris PeBenito f932d8
') dnl end TODO