sendmail policy
The sendmail design is difficult for us because the same program is used as an application (for queuing mail) and as a daemon (for receiving mail from the network). Attached is a patch to create a new domain for launching sendmail which alleviates this problem.
When /etc/init.d/sendmail is executed from initrc_t or sysadm_t it transitions to sendmail_launch_t, which then transitions to sendmail_t when executing sendmail_exec_t.
Also one of the implications of this change is that the sendmail stop script can only signal processes in the sendmail_t domain. Because of this and other factors such as daemon start scripts that re-write config files I will probably end up making a macro for this. But I'm not planning to write new macros or other really significant changes before the transition to the reference policy.
The main reason for this change is to make things easier for the transition to the reference policy (apparently the current policy makes things difficult). I'd planned this for a while.
Signature · 4 lines
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page
program/mta.te renamed from program/mta.te.orig +2 -3
@@ -38,9 +38,8 @@ ', ` ifdef(`sendmail.te', ` # sendmail has an ugly design, the one process parses input from the user and -# then does system things with it. -domain_auto_trans(initrc_t, sendmail_exec_t, sendmail_t) -', ` +# then does system things with it. But the sendmail_launch_t domain works +# around this. domain_auto_trans(initrc_t, sendmail_exec_t, system_mail_t) ') allow initrc_t sendmail_exec_t:lnk_file { getattr read };
program/sendmail.fc renamed from program/sendmail.fc.orig +7 -0
@@ -4,3 +4,10 @@ /var/log/mail(/.*)? system_u:object_r:sendmail_log_t:s0 /var/run/sendmail\.pid -- system_u:object_r:sendmail_var_run_t:s0 /var/run/sm-client\.pid -- system_u:object_r:sendmail_var_run_t:s0 +ifdef(`distro_redhat', ` +/etc/rc.d/init.d/sendmail -- system_u:object_r:sendmail_launch_exec_t:s0 +/var/lock/subsys/sm-client -- system_u:object_r:sendmail_launch_lock_t:s0 +/var/lock/subsys/sendmail -- system_u:object_r:sendmail_launch_lock_t:s0 +', ` +/etc/init.d/sendmail -- system_u:object_r:sendmail_launch_exec_t:s0 +')
program/sendmail.te renamed from program/sendmail.te.orig +43 -7
68 lines not on this page · raw message