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