Chris PeBenito 0fbfa5
#DESC uw-imapd-ssl server
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# Author:  Ed Street <edstreet@street-tek.com>
Chris PeBenito 0fbfa5
# X-Debian-Packages: uw-imapd (was uw-imapd-ssl)
Chris PeBenito 0fbfa5
# Depends: inetd.te
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
daemon_domain(imapd, `, auth_chkpwd, privhome')
Chris PeBenito 0fbfa5
tmp_domain(imapd)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
can_network_server_tcp(imapd_t)
Chris PeBenito 2705f9
allow imapd_t port_type:tcp_socket name_connect;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
#declare our own services
Chris PeBenito 0fbfa5
allow imapd_t self:capability { dac_override net_bind_service setgid setuid sys_resource };
Chris PeBenito 0fbfa5
allow imapd_t pop_port_t:tcp_socket name_bind;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
#declare this a socket from inetd
Chris PeBenito 0fbfa5
allow imapd_t self:unix_dgram_socket { sendto create_socket_perms };
Chris PeBenito 0fbfa5
allow imapd_t self:unix_stream_socket create_socket_perms;
Chris PeBenito 0fbfa5
domain_auto_trans(inetd_t, imapd_exec_t, imapd_t)
Chris PeBenito 0fbfa5
ifdef(`tcpd.te', `domain_auto_trans(tcpd_t, imapd_exec_t, imapd_t)')
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
#friendly stuff we dont want to see :)
Chris PeBenito 0fbfa5
dontaudit imapd_t bin_t:dir search;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
#read /etc/ for hostname nsswitch.conf
Chris PeBenito 0fbfa5
allow imapd_t etc_t:file { getattr read };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
#socket i/o stuff
Chris PeBenito 0fbfa5
allow imapd_t inetd_t:tcp_socket { read write ioctl getattr };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
#read resolv.conf
Chris PeBenito 0fbfa5
allow imapd_t net_conf_t:file { getattr read };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
#urandom, for ssl
Chris PeBenito 0fbfa5
allow imapd_t random_device_t:chr_file read;
Chris PeBenito 0fbfa5
allow imapd_t urandom_device_t:chr_file { read getattr };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow imapd_t self:fifo_file rw_file_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
#mail directory
Chris PeBenito 0fbfa5
rw_dir_file(imapd_t, mail_spool_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
#home directory
Chris PeBenito 0fbfa5
allow imapd_t home_root_t:dir search;
Chris PeBenito 0fbfa5
allow imapd_t self:file { read getattr };