Chris PeBenito 17de1b
Chris PeBenito 0251df
policy_module(courier,1.2.0)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
courier_domain_template(authdaemon)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type courier_etc_t;
Chris PeBenito 17de1b
files_type(courier_etc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
courier_domain_template(pcp)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
courier_domain_template(pop)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
courier_domain_template(tcpd)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type courier_var_lib_t;
Chris PeBenito 17de1b
files_type(courier_var_lib_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type courier_var_run_t;
Chris PeBenito 17de1b
files_pid_file(courier_var_run_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type courier_exec_t;
Chris PeBenito 17de1b
files_type(courier_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
courier_domain_template(sqwebmail)
Chris PeBenito 17de1b
typealias courier_sqwebmail_exec_t alias sqwebmail_cron_exec_t;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Authdaemon local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow courier_authdaemon_t self:capability { setuid setgid sys_tty_config };
Chris PeBenito 17de1b
allow courier_authdaemon_t self:unix_stream_socket connectto;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
can_exec(courier_authdaemon_t, courier_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow courier_authdaemon_t courier_tcpd_t:fd use;
Chris PeBenito 17de1b
allow courier_authdaemon_t courier_tcpd_t:tcp_socket rw_stream_socket_perms;
Chris PeBenito c0868a
allow courier_authdaemon_t courier_tcpd_t:fifo_file rw_fifo_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow courier_authdaemon_t courier_tcpd_t:tcp_socket rw_stream_socket_perms;
Chris PeBenito 17de1b
allow courier_authdaemon_t courier_tcpd_t:unix_stream_socket rw_stream_socket_perms;
Chris PeBenito 17de1b
allow courier_authdaemon_t courier_tcpd_t:process sigchld;
Chris PeBenito 17de1b
allow courier_authdaemon_t courier_tcpd_t:fd use;
Chris PeBenito 17de1b
allow courier_authdaemon_t courier_tcpd_t:tcp_socket rw_stream_socket_perms;
Chris PeBenito 17de1b
allow courier_authdaemon_t courier_tcpd_t:fifo_file rw_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 8021cb
corecmd_search_bin(courier_authdaemon_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# for SSP
Chris PeBenito 17de1b
dev_read_urand(courier_authdaemon_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_getattr_tmp_dirs(courier_authdaemon_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
auth_domtrans_chk_passwd(courier_authdaemon_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
libs_read_lib_files(courier_authdaemon_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(courier_authdaemon_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# should not be needed!
Chris PeBenito 17de1b
userdom_search_unpriv_users_home_dirs(courier_authdaemon_t)
Chris PeBenito 17de1b
userdom_dontaudit_search_sysadm_home_dirs(courier_authdaemon_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
courier_domtrans_pop(courier_authdaemon_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Calendar (PCP) local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow courier_pcp_t self:capability { setuid setgid };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_rand(courier_pcp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# POP3/IMAP local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow courier_pop_t courier_authdaemon_t:tcp_socket rw_stream_socket_perms;
Chris PeBenito 17de1b
allow courier_pop_t courier_authdaemon_t:process sigchld;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow courier_pop_t courier_tcpd_t:{ unix_stream_socket tcp_socket } rw_stream_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# inherits file handle - should it?
Chris PeBenito 17de1b
allow courier_pop_t courier_var_lib_t:file { read write };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(courier_pop_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
courier_domtrans_authdaemon(courier_pop_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# do the actual work (read the Maildir)
Chris PeBenito 17de1b
userdom_manage_unpriv_users_home_content_files(courier_pop_t)
Chris PeBenito 17de1b
# cjp: the fact that this is different for pop vs imap means that
Chris PeBenito 17de1b
# there should probably be a courier_pop_t and courier_imap_t
Chris PeBenito 17de1b
# this should also probably be a separate type too instead of
Chris PeBenito 17de1b
# the regular home dir
Chris PeBenito 17de1b
userdom_manage_unpriv_users_home_content_dirs(courier_pop_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# TCPd local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow courier_tcpd_t self:capability kill;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
can_exec(courier_tcpd_t, courier_exec_t)
Chris PeBenito 17de1b
Chris PeBenito c0868a
manage_files_pattern(courier_tcpd_t,courier_var_lib_t,courier_var_lib_t)
Chris PeBenito c0868a
manage_lnk_files_pattern(courier_tcpd_t,courier_var_lib_t,courier_var_lib_t)
Chris PeBenito 17de1b
files_search_var_lib(courier_tcpd_t)
Chris PeBenito 17de1b
Chris PeBenito 8021cb
corecmd_search_bin(courier_tcpd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
corenet_tcp_bind_all_nodes(courier_tcpd_t)
Chris PeBenito 17de1b
corenet_tcp_bind_pop_port(courier_tcpd_t)
Chris PeBenito 17de1b
corenet_sendrecv_pop_server_packets(courier_tcpd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# for TLS
Chris PeBenito 17de1b
dev_read_rand(courier_tcpd_t)
Chris PeBenito 17de1b
dev_read_urand(courier_tcpd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(courier_tcpd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
courier_domtrans_pop(courier_tcpd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Webmail local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(courier_sqwebmail_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	cron_system_entry(courier_sqwebmail_t,courier_sqwebmail_exec_t)
Chris PeBenito 17de1b
')