2010-09-15 14:42:34 +00:00
|
|
|
policy_module(courier, 1.9.1)
|
2006-04-11 15:28:37 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
|
|
|
courier_domain_template(authdaemon)
|
|
|
|
|
|
|
|
type courier_etc_t;
|
2008-08-14 14:19:50 +00:00
|
|
|
files_config_file(courier_etc_t)
|
2006-04-11 15:28:37 +00:00
|
|
|
|
|
|
|
courier_domain_template(pcp)
|
|
|
|
|
|
|
|
courier_domain_template(pop)
|
|
|
|
|
2008-08-14 14:19:50 +00:00
|
|
|
type courier_spool_t;
|
|
|
|
files_type(courier_spool_t)
|
|
|
|
|
2006-04-11 15:28:37 +00:00
|
|
|
courier_domain_template(tcpd)
|
|
|
|
|
|
|
|
type courier_var_lib_t;
|
|
|
|
files_type(courier_var_lib_t)
|
|
|
|
|
|
|
|
type courier_var_run_t;
|
|
|
|
files_pid_file(courier_var_run_t)
|
|
|
|
|
|
|
|
type courier_exec_t;
|
2008-09-12 14:18:20 +00:00
|
|
|
mta_agent_executable(courier_exec_t)
|
2006-04-11 15:28:37 +00:00
|
|
|
|
|
|
|
courier_domain_template(sqwebmail)
|
|
|
|
typealias courier_sqwebmail_exec_t alias sqwebmail_cron_exec_t;
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Authdaemon local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
allow courier_authdaemon_t self:capability { setuid setgid sys_tty_config };
|
|
|
|
allow courier_authdaemon_t self:unix_stream_socket connectto;
|
|
|
|
|
|
|
|
can_exec(courier_authdaemon_t, courier_exec_t)
|
|
|
|
|
|
|
|
allow courier_authdaemon_t courier_tcpd_t:fd use;
|
|
|
|
allow courier_authdaemon_t courier_tcpd_t:tcp_socket rw_stream_socket_perms;
|
2006-12-12 20:08:08 +00:00
|
|
|
allow courier_authdaemon_t courier_tcpd_t:fifo_file rw_fifo_file_perms;
|
2006-04-11 15:28:37 +00:00
|
|
|
|
|
|
|
allow courier_authdaemon_t courier_tcpd_t:tcp_socket rw_stream_socket_perms;
|
|
|
|
allow courier_authdaemon_t courier_tcpd_t:unix_stream_socket rw_stream_socket_perms;
|
|
|
|
allow courier_authdaemon_t courier_tcpd_t:process sigchld;
|
2010-08-30 14:45:10 +00:00
|
|
|
allow courier_authdaemon_t courier_tcpd_t:fd use;
|
2006-04-11 15:28:37 +00:00
|
|
|
allow courier_authdaemon_t courier_tcpd_t:tcp_socket rw_stream_socket_perms;
|
|
|
|
allow courier_authdaemon_t courier_tcpd_t:fifo_file rw_file_perms;
|
|
|
|
|
2008-11-17 15:48:12 +00:00
|
|
|
manage_sock_files_pattern(courier_authdaemon_t, courier_spool_t, courier_spool_t)
|
|
|
|
files_search_spool(courier_authdaemon_t)
|
|
|
|
|
2007-03-23 23:24:59 +00:00
|
|
|
corecmd_search_bin(courier_authdaemon_t)
|
2006-04-11 15:28:37 +00:00
|
|
|
|
|
|
|
# for SSP
|
|
|
|
dev_read_urand(courier_authdaemon_t)
|
|
|
|
|
|
|
|
files_getattr_tmp_dirs(courier_authdaemon_t)
|
|
|
|
|
|
|
|
auth_domtrans_chk_passwd(courier_authdaemon_t)
|
|
|
|
|
|
|
|
libs_read_lib_files(courier_authdaemon_t)
|
|
|
|
|
|
|
|
miscfiles_read_localization(courier_authdaemon_t)
|
|
|
|
|
|
|
|
# should not be needed!
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_search_user_home_dirs(courier_authdaemon_t)
|
2006-04-11 15:28:37 +00:00
|
|
|
|
|
|
|
courier_domtrans_pop(courier_authdaemon_t)
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Calendar (PCP) local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
allow courier_pcp_t self:capability { setuid setgid };
|
|
|
|
|
|
|
|
dev_read_rand(courier_pcp_t)
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# POP3/IMAP local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
allow courier_pop_t courier_authdaemon_t:tcp_socket rw_stream_socket_perms;
|
|
|
|
allow courier_pop_t courier_authdaemon_t:process sigchld;
|
|
|
|
|
|
|
|
allow courier_pop_t courier_tcpd_t:{ unix_stream_socket tcp_socket } rw_stream_socket_perms;
|
|
|
|
|
|
|
|
# inherits file handle - should it?
|
|
|
|
allow courier_pop_t courier_var_lib_t:file { read write };
|
|
|
|
|
|
|
|
miscfiles_read_localization(courier_pop_t)
|
|
|
|
|
|
|
|
courier_domtrans_authdaemon(courier_pop_t)
|
|
|
|
|
|
|
|
# do the actual work (read the Maildir)
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_manage_user_home_content_files(courier_pop_t)
|
2006-04-11 15:28:37 +00:00
|
|
|
# cjp: the fact that this is different for pop vs imap means that
|
|
|
|
# there should probably be a courier_pop_t and courier_imap_t
|
|
|
|
# this should also probably be a separate type too instead of
|
|
|
|
# the regular home dir
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_manage_user_home_content_dirs(courier_pop_t)
|
2006-04-11 15:28:37 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# TCPd local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
allow courier_tcpd_t self:capability kill;
|
|
|
|
|
|
|
|
can_exec(courier_tcpd_t, courier_exec_t)
|
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_files_pattern(courier_tcpd_t, courier_var_lib_t, courier_var_lib_t)
|
|
|
|
manage_lnk_files_pattern(courier_tcpd_t, courier_var_lib_t, courier_var_lib_t)
|
2006-04-11 15:28:37 +00:00
|
|
|
files_search_var_lib(courier_tcpd_t)
|
|
|
|
|
2007-03-23 23:24:59 +00:00
|
|
|
corecmd_search_bin(courier_tcpd_t)
|
2006-04-11 15:28:37 +00:00
|
|
|
|
2009-01-09 19:48:02 +00:00
|
|
|
corenet_tcp_bind_generic_node(courier_tcpd_t)
|
2006-04-11 15:28:37 +00:00
|
|
|
corenet_tcp_bind_pop_port(courier_tcpd_t)
|
2006-05-30 19:46:34 +00:00
|
|
|
corenet_sendrecv_pop_server_packets(courier_tcpd_t)
|
2006-04-11 15:28:37 +00:00
|
|
|
|
|
|
|
# for TLS
|
|
|
|
dev_read_rand(courier_tcpd_t)
|
|
|
|
dev_read_urand(courier_tcpd_t)
|
|
|
|
|
|
|
|
miscfiles_read_localization(courier_tcpd_t)
|
|
|
|
|
|
|
|
courier_domtrans_pop(courier_tcpd_t)
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Webmail local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
kernel_read_kernel_sysctls(courier_sqwebmail_t)
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-07-23 21:38:39 +00:00
|
|
|
cron_system_entry(courier_sqwebmail_t, courier_sqwebmail_exec_t)
|
2006-04-11 15:28:37 +00:00
|
|
|
')
|