Chris PeBenito 801b2a
#DESC Procmail - Mail delivery agent for mail servers
Chris PeBenito 801b2a
#
Chris PeBenito 801b2a
# Author:  Russell Coker <russell@coker.com.au>
Chris PeBenito 801b2a
# X-Debian-Packages: procmail
Chris PeBenito 801b2a
#
Chris PeBenito 801b2a
Chris PeBenito 801b2a
#################################
Chris PeBenito 801b2a
#
Chris PeBenito 801b2a
# Rules for the procmail_t domain.
Chris PeBenito 801b2a
#
Chris PeBenito 801b2a
# procmail_exec_t is the type of the procmail executable.
Chris PeBenito 801b2a
#
Chris PeBenito 801b2a
# privhome only works until we define a different type for maildir
Chris PeBenito 801b2a
type procmail_t, domain, privlog, privhome, nscd_client_domain;
Chris PeBenito 801b2a
type procmail_exec_t, file_type, sysadmfile, exec_type;
Chris PeBenito 801b2a
Chris PeBenito 801b2a
role system_r types procmail_t;
Chris PeBenito 801b2a
Chris PeBenito 801b2a
uses_shlib(procmail_t)
Chris PeBenito 801b2a
allow procmail_t device_t:dir search;
Chris PeBenito 801b2a
can_network_server(procmail_t)
Chris PeBenito 801b2a
nsswitch_domain(procmail_t)
Chris PeBenito 801b2a
Chris PeBenito 801b2a
allow procmail_t self:capability { sys_nice chown setuid setgid dac_override };
Chris PeBenito 801b2a
Chris PeBenito 801b2a
allow procmail_t etc_t:dir r_dir_perms;
Chris PeBenito 801b2a
allow procmail_t { etc_t etc_runtime_t }:file { getattr read };
Chris PeBenito 801b2a
allow procmail_t etc_t:lnk_file read;
Chris PeBenito 801b2a
read_locale(procmail_t)
Chris PeBenito 801b2a
read_sysctl(procmail_t)
Chris PeBenito 801b2a
Chris PeBenito 801b2a
allow procmail_t sysctl_t:dir search;
Chris PeBenito 801b2a
Chris PeBenito 801b2a
allow procmail_t self:process { setsched fork sigchld signal };
Chris PeBenito 801b2a
dontaudit procmail_t sbin_t:dir { getattr search };
Chris PeBenito 801b2a
can_exec(procmail_t, { bin_t shell_exec_t })
Chris PeBenito 801b2a
allow procmail_t bin_t:dir { getattr search };
Chris PeBenito 801b2a
allow procmail_t bin_t:lnk_file read;
Chris PeBenito 801b2a
allow procmail_t self:fifo_file rw_file_perms;
Chris PeBenito 801b2a
Chris PeBenito 801b2a
allow procmail_t self:unix_stream_socket create_socket_perms;
Chris PeBenito 801b2a
allow procmail_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 801b2a
Chris PeBenito 801b2a
# for /var/mail
Chris PeBenito 801b2a
rw_dir_create_file(procmail_t, mail_spool_t)
Chris PeBenito 801b2a
Chris PeBenito 801b2a
allow procmail_t var_t:dir { getattr search };
Chris PeBenito 801b2a
allow procmail_t var_spool_t:dir r_dir_perms;
Chris PeBenito 801b2a
Chris PeBenito 801b2a
allow procmail_t fs_t:filesystem getattr;
Chris PeBenito 801b2a
allow procmail_t { self proc_t }:dir search;
Chris PeBenito 801b2a
allow procmail_t proc_t:file { getattr read };
Chris PeBenito 801b2a
allow procmail_t { self proc_t }:lnk_file read;
Chris PeBenito 801b2a
Chris PeBenito 801b2a
# for if /var/mail is a symlink to /var/spool/mail
Chris PeBenito 801b2a
#allow procmail_t mail_spool_t:lnk_file r_file_perms;
Chris PeBenito 801b2a
Chris PeBenito 801b2a
# for spamassasin
Chris PeBenito 801b2a
allow procmail_t usr_t:file { getattr ioctl read };
Chris PeBenito 801b2a
ifdef(`spamassassin.te', `
Chris PeBenito 801b2a
can_exec(procmail_t, spamassassin_exec_t)
Chris PeBenito 801b2a
allow procmail_t port_t:udp_socket name_bind;
Chris PeBenito 801b2a
allow procmail_t tmp_t:dir getattr;
Chris PeBenito 801b2a
')
Chris PeBenito 801b2a
ifdef(`spamc.te', `
Chris PeBenito 801b2a
can_exec(procmail_t, spamc_exec_t)
Chris PeBenito 801b2a
')
Chris PeBenito 801b2a
Chris PeBenito 801b2a
ifdef(`targeted_policy', `
Chris PeBenito 801b2a
allow procmail_t port_t:udp_socket name_bind;
Chris PeBenito 801b2a
allow procmail_t tmp_t:dir getattr;
Chris PeBenito 801b2a
')
Chris PeBenito 801b2a
Chris PeBenito 801b2a
# Search /var/run.
Chris PeBenito 801b2a
allow procmail_t var_run_t:dir { getattr search };
Chris PeBenito 801b2a
Chris PeBenito 801b2a
# Do not audit attempts to access /root.
Chris PeBenito 801b2a
dontaudit procmail_t sysadm_home_dir_t:dir { getattr search };
Chris PeBenito 801b2a
Chris PeBenito 801b2a
allow procmail_t devtty_t:chr_file { read write };
Chris PeBenito 801b2a
Chris PeBenito 801b2a
allow procmail_t urandom_device_t:chr_file { getattr read };
Chris PeBenito 801b2a
Chris PeBenito 801b2a
ifdef(`sendmail.te', `
Chris PeBenito 801b2a
r_dir_file(procmail_t, etc_mail_t)
Chris PeBenito 801b2a
allow procmail_t sendmail_t:tcp_socket { read write };
Chris PeBenito 801b2a
')
Chris PeBenito 801b2a
Chris PeBenito 801b2a
ifdef(`hide_broken_symptoms', `
Chris PeBenito 801b2a
dontaudit procmail_t mqueue_spool_t:file { getattr read write };
Chris PeBenito 801b2a
')