2005-10-22 23:50:23 +00:00
|
|
|
|
2007-03-20 18:47:18 +00:00
|
|
|
policy_module(spamassassin,1.5.5)
|
2005-10-22 23:50:23 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
|
|
|
# spamassassin client executable
|
|
|
|
type spamc_exec_t;
|
2006-04-19 21:43:02 +00:00
|
|
|
corecmd_executable_file(spamc_exec_t)
|
2005-10-22 23:50:23 +00:00
|
|
|
|
|
|
|
type spamd_t;
|
|
|
|
type spamd_exec_t;
|
|
|
|
init_daemon_domain(spamd_t,spamd_exec_t)
|
|
|
|
|
2006-06-07 17:43:10 +00:00
|
|
|
type spamd_spool_t;
|
|
|
|
files_type(spamd_spool_t)
|
|
|
|
|
2005-10-22 23:50:23 +00:00
|
|
|
type spamd_tmp_t;
|
|
|
|
files_tmp_file(spamd_tmp_t)
|
|
|
|
|
2007-03-07 21:33:22 +00:00
|
|
|
# var/lib files
|
|
|
|
type spamd_var_lib_t;
|
|
|
|
files_type(spamd_var_lib_t)
|
|
|
|
|
2005-10-22 23:50:23 +00:00
|
|
|
type spamd_var_run_t;
|
|
|
|
files_pid_file(spamd_var_run_t)
|
|
|
|
|
|
|
|
type spamassassin_exec_t;
|
2006-04-19 21:43:02 +00:00
|
|
|
corecmd_executable_file(spamassassin_exec_t)
|
2005-10-22 23:50:23 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Spamassassin daemon local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
# Spamassassin, when run as root and using per-user config files,
|
|
|
|
# setuids to the user running spamc. Comment this if you are not
|
|
|
|
# using this ability.
|
|
|
|
|
|
|
|
allow spamd_t self:capability { setuid setgid dac_override sys_tty_config };
|
|
|
|
dontaudit spamd_t self:capability sys_tty_config;
|
|
|
|
allow spamd_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
|
|
|
|
allow spamd_t self:fd use;
|
2006-12-12 20:08:08 +00:00
|
|
|
allow spamd_t self:fifo_file rw_fifo_file_perms;
|
|
|
|
allow spamd_t self:sock_file read_sock_file_perms;
|
2005-10-22 23:50:23 +00:00
|
|
|
allow spamd_t self:shm create_shm_perms;
|
|
|
|
allow spamd_t self:sem create_sem_perms;
|
|
|
|
allow spamd_t self:msgq create_msgq_perms;
|
|
|
|
allow spamd_t self:msg { send receive };
|
|
|
|
allow spamd_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow spamd_t self:unix_stream_socket create_stream_socket_perms;
|
|
|
|
allow spamd_t self:unix_dgram_socket sendto;
|
|
|
|
allow spamd_t self:unix_stream_socket connectto;
|
|
|
|
allow spamd_t self:tcp_socket create_stream_socket_perms;
|
|
|
|
allow spamd_t self:udp_socket create_socket_perms;
|
2006-10-31 21:01:48 +00:00
|
|
|
allow spamd_t self:netlink_route_socket r_netlink_socket_perms;
|
2005-10-22 23:50:23 +00:00
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
manage_dirs_pattern(spamd_t,spamd_spool_t,spamd_spool_t)
|
|
|
|
manage_files_pattern(spamd_t,spamd_spool_t,spamd_spool_t)
|
2006-06-07 17:43:10 +00:00
|
|
|
files_spool_filetrans(spamd_t,spamd_spool_t, { file dir })
|
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
manage_dirs_pattern(spamd_t,spamd_tmp_t,spamd_tmp_t)
|
|
|
|
manage_files_pattern(spamd_t,spamd_tmp_t,spamd_tmp_t)
|
2006-02-21 18:40:44 +00:00
|
|
|
files_tmp_filetrans(spamd_t, spamd_tmp_t, { file dir })
|
2005-10-22 23:50:23 +00:00
|
|
|
|
2007-03-07 21:33:22 +00:00
|
|
|
# var/lib files for spamd
|
|
|
|
allow spamd_t spamd_var_lib_t:dir list_dir_perms;
|
|
|
|
read_files_pattern(spamd_t,spamd_var_lib_t,spamd_var_lib_t)
|
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
manage_files_pattern(spamd_t,spamd_var_run_t,spamd_var_run_t)
|
2006-03-02 23:41:11 +00:00
|
|
|
files_pid_filetrans(spamd_t,spamd_var_run_t,file)
|
2005-10-22 23:50:23 +00:00
|
|
|
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_all_sysctls(spamd_t)
|
2005-10-22 23:50:23 +00:00
|
|
|
kernel_read_system_state(spamd_t)
|
|
|
|
|
2006-05-26 18:04:46 +00:00
|
|
|
corenet_non_ipsec_sendrecv(spamd_t)
|
2005-10-22 23:50:23 +00:00
|
|
|
corenet_tcp_sendrecv_all_if(spamd_t)
|
|
|
|
corenet_udp_sendrecv_all_if(spamd_t)
|
|
|
|
corenet_tcp_sendrecv_all_nodes(spamd_t)
|
|
|
|
corenet_udp_sendrecv_all_nodes(spamd_t)
|
2005-10-24 17:06:34 +00:00
|
|
|
corenet_tcp_sendrecv_all_ports(spamd_t)
|
|
|
|
corenet_udp_sendrecv_all_ports(spamd_t)
|
2005-10-22 23:50:23 +00:00
|
|
|
corenet_tcp_bind_all_nodes(spamd_t)
|
|
|
|
corenet_tcp_bind_spamd_port(spamd_t)
|
2006-05-26 18:04:46 +00:00
|
|
|
corenet_tcp_connect_razor_port(spamd_t)
|
2006-05-30 19:46:34 +00:00
|
|
|
corenet_sendrecv_razor_client_packets(spamd_t)
|
|
|
|
corenet_sendrecv_spamd_server_packets(spamd_t)
|
2005-12-09 15:42:39 +00:00
|
|
|
# spamassassin 3.1 needs this for its
|
|
|
|
# DnsResolver.pm module which binds to
|
|
|
|
# random ports >= 1024.
|
2006-05-30 19:46:34 +00:00
|
|
|
corenet_udp_bind_all_nodes(spamd_t)
|
2005-12-09 15:42:39 +00:00
|
|
|
corenet_udp_bind_generic_port(spamd_t)
|
2006-02-20 16:31:54 +00:00
|
|
|
corenet_udp_bind_imaze_port(spamd_t)
|
2006-12-04 20:10:56 +00:00
|
|
|
corenet_dontaudit_udp_bind_all_ports(spamd_t)
|
2006-05-30 19:46:34 +00:00
|
|
|
corenet_sendrecv_imaze_server_packets(spamd_t)
|
|
|
|
corenet_sendrecv_generic_server_packets(spamd_t)
|
2005-10-22 23:50:23 +00:00
|
|
|
|
|
|
|
dev_read_sysfs(spamd_t)
|
|
|
|
dev_read_urand(spamd_t)
|
|
|
|
|
|
|
|
fs_getattr_all_fs(spamd_t)
|
|
|
|
fs_search_auto_mountpoints(spamd_t)
|
|
|
|
|
|
|
|
auth_dontaudit_read_shadow(spamd_t)
|
|
|
|
|
|
|
|
corecmd_exec_bin(spamd_t)
|
|
|
|
corecmd_search_sbin(spamd_t)
|
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds(spamd_t)
|
2005-10-22 23:50:23 +00:00
|
|
|
|
|
|
|
files_read_usr_files(spamd_t)
|
|
|
|
files_read_etc_files(spamd_t)
|
|
|
|
files_read_etc_runtime_files(spamd_t)
|
2007-02-16 23:01:42 +00:00
|
|
|
# /var/lib/spamassin
|
|
|
|
files_read_var_lib_files(spamd_t)
|
2005-10-22 23:50:23 +00:00
|
|
|
|
2006-01-18 18:08:39 +00:00
|
|
|
init_dontaudit_rw_utmp(spamd_t)
|
2005-10-22 23:50:23 +00:00
|
|
|
|
|
|
|
libs_use_ld_so(spamd_t)
|
|
|
|
libs_use_shared_libs(spamd_t)
|
|
|
|
# Various Perl bits
|
2006-02-02 21:08:12 +00:00
|
|
|
libs_use_lib_files(spamd_t)
|
2005-10-22 23:50:23 +00:00
|
|
|
|
|
|
|
logging_send_syslog_msg(spamd_t)
|
|
|
|
|
|
|
|
miscfiles_read_localization(spamd_t)
|
|
|
|
|
|
|
|
sysnet_read_config(spamd_t)
|
2006-02-06 22:47:46 +00:00
|
|
|
sysnet_use_ldap(spamd_t)
|
2006-05-26 18:04:46 +00:00
|
|
|
sysnet_dns_name_resolve(spamd_t)
|
2005-10-22 23:50:23 +00:00
|
|
|
|
2006-02-21 18:40:44 +00:00
|
|
|
userdom_use_unpriv_users_fds(spamd_t)
|
2006-02-20 21:33:25 +00:00
|
|
|
userdom_search_unpriv_users_home_dirs(spamd_t)
|
2006-02-21 18:40:44 +00:00
|
|
|
userdom_dontaudit_search_sysadm_home_dirs(spamd_t)
|
2005-10-22 23:50:23 +00:00
|
|
|
|
|
|
|
ifdef(`targeted_policy',`
|
2006-02-02 21:08:12 +00:00
|
|
|
term_dontaudit_use_unallocated_ttys(spamd_t)
|
|
|
|
term_dontaudit_use_generic_ptys(spamd_t)
|
2006-09-01 15:52:05 +00:00
|
|
|
|
2006-01-31 19:21:01 +00:00
|
|
|
files_dontaudit_read_root_files(spamd_t)
|
2006-09-01 15:52:05 +00:00
|
|
|
|
2006-02-20 16:31:54 +00:00
|
|
|
tunable_policy(`spamd_enable_home_dirs',`
|
2006-02-21 18:40:44 +00:00
|
|
|
userdom_manage_generic_user_home_content_dirs(spamd_t)
|
|
|
|
userdom_manage_generic_user_home_content_files(spamd_t)
|
|
|
|
userdom_manage_generic_user_home_content_symlinks(spamd_t)
|
2007-03-08 19:01:21 +00:00
|
|
|
userdom_generic_user_home_dir_filetrans_generic_user_home_content(spamd_t,dir)
|
2006-02-20 16:31:54 +00:00
|
|
|
')
|
2005-10-22 23:50:23 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
tunable_policy(`use_nfs_home_dirs',`
|
|
|
|
fs_manage_nfs_files(spamd_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
tunable_policy(`use_samba_home_dirs',`
|
|
|
|
fs_manage_cifs_files(spamd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-05-03 19:58:01 +00:00
|
|
|
amavis_manage_lib_files(spamd_t)
|
2005-10-22 23:50:23 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-05-03 19:58:01 +00:00
|
|
|
cron_system_entry(spamd_t,spamd_exec_t)
|
2006-03-07 21:15:24 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-01-16 18:30:14 +00:00
|
|
|
daemontools_service_domain(spamd_t,spamd_exec_t)
|
|
|
|
')
|
|
|
|
|
2006-05-04 17:44:26 +00:00
|
|
|
optional_policy(`
|
|
|
|
dcc_domtrans_client(spamd_t)
|
|
|
|
dcc_stream_connect_dccifd(spamd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-10-22 23:50:23 +00:00
|
|
|
nis_use_ypbind(spamd_t)
|
|
|
|
')
|
|
|
|
|
2006-08-29 02:41:00 +00:00
|
|
|
optional_policy(`
|
|
|
|
postfix_read_config(spamd_t)
|
|
|
|
')
|
|
|
|
|
2006-05-03 19:58:01 +00:00
|
|
|
optional_policy(`
|
|
|
|
postgresql_stream_connect(spamd_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
pyzor_domtrans(spamd_t)
|
2007-03-08 17:53:52 +00:00
|
|
|
pyzor_signal(spamd_t)
|
2006-05-03 19:58:01 +00:00
|
|
|
')
|
|
|
|
|
2006-05-05 19:26:50 +00:00
|
|
|
optional_policy(`
|
|
|
|
razor_domtrans(spamd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-10-22 23:50:23 +00:00
|
|
|
seutil_sigchld_newrole(spamd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-10-22 23:50:23 +00:00
|
|
|
sendmail_stub(spamd_t)
|
|
|
|
mta_read_config(spamd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-10-22 23:50:23 +00:00
|
|
|
udev_read_db(spamd_t)
|
|
|
|
')
|