Chris PeBenito 31b7c0
#DESC Spamd - Spamassassin daemon
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Author: Colin Walters <walters@debian.org>
Chris PeBenito 31b7c0
# X-Debian-Packages: spamassassin
Chris PeBenito 31b7c0
# Depends: spamassassin.te
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
daemon_domain(spamd)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
tmp_domain(spamd)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
general_domain_access(spamd_t)
Chris PeBenito 31b7c0
uses_shlib(spamd_t)
Chris PeBenito 31b7c0
read_sysctl(spamd_t)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Various Perl bits
Chris PeBenito 31b7c0
allow spamd_t lib_t:file rx_file_perms;
Chris PeBenito 31b7c0
dontaudit spamd_t shadow_t:file { getattr read };
Chris PeBenito 31b7c0
dontaudit spamd_t initrc_var_run_t:file { read write lock };
Chris PeBenito 31b7c0
dontaudit spamd_t sysadm_home_dir_t:dir { getattr search };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
can_network_server(spamd_t)
Chris PeBenito 31b7c0
allow spamd_t spamd_port_t:tcp_socket name_bind;
Chris PeBenito 31b7c0
allow spamd_t port_type:udp_socket name_bind;
Chris PeBenito 31b7c0
dontaudit spamd_t reserved_port_type:udp_socket name_bind;
Chris PeBenito 31b7c0
can_ypbind(spamd_t)
Chris PeBenito 31b7c0
can_resolve(spamd_t)
Chris PeBenito 31b7c0
allow spamd_t self:capability net_bind_service;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow spamd_t proc_t:file { getattr read };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Spamassassin, when run as root and using per-user config files,
Chris PeBenito 31b7c0
# setuids to the user running spamc.  Comment this if you are not
Chris PeBenito 31b7c0
# using this ability.
Chris PeBenito 31b7c0
allow spamd_t self:capability { setuid setgid dac_override sys_tty_config };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow spamd_t { bin_t sbin_t }:dir { getattr search };
Chris PeBenito 31b7c0
can_exec(spamd_t, bin_t)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
ifdef(`sendmail.te', `
Chris PeBenito 31b7c0
allow spamd_t etc_mail_t:dir { getattr read search };
Chris PeBenito 31b7c0
allow spamd_t etc_mail_t:file { getattr ioctl read };
Chris PeBenito 31b7c0
')
Chris PeBenito 31b7c0
allow spamd_t { etc_t etc_runtime_t }:file { getattr ioctl read };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
ifdef(`amavis.te', `
Chris PeBenito 31b7c0
# for bayes tokens
Chris PeBenito 31b7c0
allow spamd_t var_lib_t:dir { getattr search };
Chris PeBenito 31b7c0
rw_dir_create_file(spamd_t, amavisd_lib_t)
Chris PeBenito 31b7c0
')
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow spamd_t usr_t:file { getattr ioctl read };
Chris PeBenito 31b7c0
allow spamd_t usr_t:lnk_file { getattr read };
Chris PeBenito 31b7c0
allow spamd_t urandom_device_t:chr_file { getattr read };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
system_crond_entry(spamd_exec_t, spamd_t)
Chris PeBenito 31b7c0
ifdef(`targeted_policy', `home_domain_access(spamd_t, user)')