Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Macros for sendmail domains.
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Authors:  Stephen Smalley <sds@epoch.ncsc.mil> and Timothy Fraser 
Chris PeBenito 31b7c0
#           Russell Coker <russell@coker.com.au>
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# sendmail_user_domain(domain_prefix)
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Define a derived domain for the sendmail program when executed by
Chris PeBenito 31b7c0
# a user domain to send outgoing mail.  These domains are separate and
Chris PeBenito 31b7c0
# independent of the domain used for the sendmail daemon process.
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
undefine(`sendmail_user_domain')
Chris PeBenito 31b7c0
define(`sendmail_user_domain', `
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Use capabilities
Chris PeBenito 31b7c0
allow $1_mail_t self:capability net_bind_service;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
tmp_domain($1_mail)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Write to /var/spool/mail and /var/spool/mqueue.
Chris PeBenito 31b7c0
allow $1_mail_t mail_spool_t:dir rw_dir_perms;
Chris PeBenito 31b7c0
allow $1_mail_t mail_spool_t:file create_file_perms;
Chris PeBenito 31b7c0
allow $1_mail_t mqueue_spool_t:dir rw_dir_perms;
Chris PeBenito 31b7c0
allow $1_mail_t mqueue_spool_t:file create_file_perms;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Write to /var/log/sendmail.st
Chris PeBenito 31b7c0
file_type_auto_trans($1_mail_t, var_log_t, sendmail_log_t)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow $1_mail_t etc_mail_t:dir { getattr search };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow $1_mail_t { var_t var_spool_t }:dir getattr;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow $1_mail_t etc_runtime_t:file { getattr read };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Check available space.
Chris PeBenito 31b7c0
allow $1_mail_t fs_t:filesystem getattr;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow $1_mail_t sysctl_kernel_t:dir search;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
ifelse(`$1', `sysadm', `
Chris PeBenito 31b7c0
allow $1_mail_t proc_t:dir { getattr search };
Chris PeBenito 31b7c0
allow $1_mail_t proc_t:{ lnk_file file } { getattr read };
Chris PeBenito 31b7c0
dontaudit $1_mail_t proc_net_t:dir search;
Chris PeBenito 31b7c0
allow $1_mail_t sysctl_kernel_t:file { getattr read };
Chris PeBenito 31b7c0
allow $1_mail_t etc_runtime_t:file { getattr read };
Chris PeBenito 31b7c0
', `
Chris PeBenito 31b7c0
dontaudit $1_mail_t proc_t:dir search;
Chris PeBenito 31b7c0
dontaudit $1_mail_t sysctl_kernel_t:file read;
Chris PeBenito 31b7c0
')dnl end if sysadm
Chris PeBenito 31b7c0
')
Chris PeBenito 31b7c0