2005-10-21 15:38:22 +00:00
|
|
|
|
2005-11-29 21:51:24 +00:00
|
|
|
policy_module(dovecot,1.0.2)
|
2005-10-21 15:38:22 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
2005-10-25 17:50:00 +00:00
|
|
|
type dovecot_t;
|
2005-10-21 15:38:22 +00:00
|
|
|
type dovecot_exec_t;
|
|
|
|
init_daemon_domain(dovecot_t,dovecot_exec_t)
|
|
|
|
|
|
|
|
type dovecot_cert_t;
|
|
|
|
files_type(dovecot_cert_t)
|
|
|
|
|
2005-10-24 18:40:24 +00:00
|
|
|
type dovecot_etc_t;
|
|
|
|
files_config_file(dovecot_etc_t)
|
2005-10-21 15:38:22 +00:00
|
|
|
|
|
|
|
type dovecot_passwd_t;
|
|
|
|
files_type(dovecot_passwd_t)
|
|
|
|
|
|
|
|
type dovecot_spool_t;
|
|
|
|
files_type(dovecot_spool_t)
|
|
|
|
|
|
|
|
type dovecot_var_run_t;
|
|
|
|
files_pid_file(dovecot_var_run_t)
|
|
|
|
|
|
|
|
type dovecot_auth_t;
|
|
|
|
type dovecot_auth_exec_t;
|
|
|
|
domain_type(dovecot_auth_t)
|
|
|
|
domain_entry_file(dovecot_auth_t,dovecot_auth_exec_t)
|
|
|
|
role system_r types dovecot_auth_t;
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# dovecot local policy
|
|
|
|
#
|
2005-11-25 16:43:03 +00:00
|
|
|
|
2005-10-21 15:38:22 +00:00
|
|
|
allow dovecot_t self:capability { dac_override dac_read_search chown net_bind_service setgid setuid sys_chroot };
|
|
|
|
dontaudit dovecot_t self:capability sys_tty_config;
|
|
|
|
allow dovecot_t self:process { setrlimit signal_perms };
|
|
|
|
allow dovecot_t self:fifo_file rw_file_perms;
|
|
|
|
allow dovecot_t self:tcp_socket create_stream_socket_perms;
|
|
|
|
allow dovecot_t self:unix_dgram_socket create_socket_perms;
|
2005-11-10 21:37:54 +00:00
|
|
|
allow dovecot_t self:unix_stream_socket { create_stream_socket_perms connectto };
|
2005-10-21 15:38:22 +00:00
|
|
|
|
|
|
|
domain_auto_trans(dovecot_t, dovecot_auth_exec_t, dovecot_auth_t)
|
|
|
|
allow dovecot_t dovecot_auth_t:fd use;
|
|
|
|
allow dovecot_auth_t dovecot_t:process sigchld;
|
|
|
|
allow dovecot_auth_t dovecot_t:fd use;
|
|
|
|
allow dovecot_auth_t dovecot_t:fifo_file { ioctl read write getattr lock append };
|
|
|
|
|
2005-11-16 21:08:52 +00:00
|
|
|
allow dovecot_t dovecot_cert_t:dir r_dir_perms;
|
|
|
|
allow dovecot_t dovecot_cert_t:file r_file_perms;
|
2005-10-21 15:38:22 +00:00
|
|
|
allow dovecot_t dovecot_cert_t:lnk_file { getattr read };
|
|
|
|
|
2005-11-16 21:08:52 +00:00
|
|
|
allow dovecot_t dovecot_etc_t:file r_file_perms;
|
2005-10-21 15:38:22 +00:00
|
|
|
files_search_etc(dovecot_t)
|
|
|
|
|
|
|
|
can_exec(dovecot_t, dovecot_exec_t)
|
|
|
|
|
|
|
|
allow dovecot_t dovecot_spool_t:dir create_dir_perms;
|
|
|
|
allow dovecot_t dovecot_spool_t:file create_file_perms;
|
|
|
|
allow dovecot_t dovecot_spool_t:lnk_file create_lnk_perms;
|
|
|
|
|
|
|
|
allow dovecot_t dovecot_var_run_t:file create_file_perms;
|
|
|
|
allow dovecot_t dovecot_var_run_t:sock_file create_file_perms;
|
|
|
|
allow dovecot_t dovecot_var_run_t:dir rw_dir_perms;
|
|
|
|
files_create_pid(dovecot_t,dovecot_var_run_t)
|
|
|
|
|
|
|
|
kernel_read_kernel_sysctl(dovecot_t)
|
|
|
|
kernel_read_system_state(dovecot_t)
|
|
|
|
|
|
|
|
corenet_tcp_sendrecv_all_if(dovecot_t)
|
|
|
|
corenet_raw_sendrecv_all_if(dovecot_t)
|
|
|
|
corenet_tcp_sendrecv_all_nodes(dovecot_t)
|
|
|
|
corenet_raw_sendrecv_all_nodes(dovecot_t)
|
|
|
|
corenet_tcp_sendrecv_all_ports(dovecot_t)
|
|
|
|
corenet_tcp_bind_all_nodes(dovecot_t)
|
2005-10-21 21:35:25 +00:00
|
|
|
corenet_tcp_bind_pop_port(dovecot_t)
|
2005-10-21 19:36:49 +00:00
|
|
|
corenet_tcp_connect_all_ports(dovecot_t)
|
2005-10-21 15:38:22 +00:00
|
|
|
|
|
|
|
dev_read_sysfs(dovecot_t)
|
|
|
|
dev_read_urand(dovecot_t)
|
|
|
|
|
|
|
|
fs_getattr_all_fs(dovecot_t)
|
|
|
|
fs_search_auto_mountpoints(dovecot_t)
|
|
|
|
|
|
|
|
term_dontaudit_use_console(dovecot_t)
|
|
|
|
|
|
|
|
corecmd_exec_bin(dovecot_t)
|
|
|
|
|
|
|
|
domain_use_wide_inherit_fd(dovecot_t)
|
|
|
|
|
|
|
|
files_read_etc_files(dovecot_t)
|
|
|
|
files_search_spool(dovecot_t)
|
|
|
|
files_search_tmp(dovecot_t)
|
|
|
|
|
|
|
|
init_use_fd(dovecot_t)
|
|
|
|
init_use_script_pty(dovecot_t)
|
|
|
|
init_getattr_script_pids(dovecot_t)
|
|
|
|
|
|
|
|
libs_use_ld_so(dovecot_t)
|
|
|
|
libs_use_shared_libs(dovecot_t)
|
|
|
|
|
|
|
|
logging_send_syslog_msg(dovecot_t)
|
|
|
|
|
|
|
|
miscfiles_read_certs(dovecot_t)
|
|
|
|
miscfiles_read_localization(dovecot_t)
|
|
|
|
|
|
|
|
sysnet_read_config(dovecot_t)
|
|
|
|
sysnet_use_ldap(dovecot_auth_t)
|
|
|
|
|
|
|
|
userdom_dontaudit_use_unpriv_user_fd(dovecot_t)
|
|
|
|
userdom_dontaudit_search_sysadm_home_dir(dovecot_t)
|
2005-10-25 17:50:00 +00:00
|
|
|
userdom_priveleged_home_dir_manager(dovecot_t)
|
2005-10-21 15:38:22 +00:00
|
|
|
|
2005-11-16 21:08:52 +00:00
|
|
|
mta_manage_spool(dovecot_t)
|
2005-10-21 15:38:22 +00:00
|
|
|
|
|
|
|
ifdef(`targeted_policy',`
|
|
|
|
term_dontaudit_use_unallocated_tty(dovecot_t)
|
|
|
|
term_dontaudit_use_generic_pty(dovecot_t)
|
|
|
|
files_dontaudit_read_root_file(dovecot_t)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`kerberos',`
|
2005-10-21 15:38:22 +00:00
|
|
|
kerberos_use(dovecot_t)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`nis',`
|
2005-10-21 15:38:22 +00:00
|
|
|
nis_use_ypbind(dovecot_t)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`selinuxutil',`
|
2005-10-21 15:38:22 +00:00
|
|
|
seutil_sigchld_newrole(dovecot_t)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`udev',`
|
2005-10-21 15:38:22 +00:00
|
|
|
udev_read_db(dovecot_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# dovecot auth local policy
|
|
|
|
#
|
2005-11-25 16:43:03 +00:00
|
|
|
|
2005-10-21 15:38:22 +00:00
|
|
|
allow dovecot_auth_t self:capability { setgid setuid };
|
|
|
|
allow dovecot_auth_t self:process signal_perms;
|
|
|
|
allow dovecot_auth_t self:fifo_file rw_file_perms;
|
|
|
|
allow dovecot_auth_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow dovecot_auth_t self:unix_stream_socket create_stream_socket_perms;
|
|
|
|
|
|
|
|
allow dovecot_auth_t dovecot_t:unix_stream_socket { getattr accept read write ioctl };
|
|
|
|
|
|
|
|
allow dovecot_auth_t dovecot_passwd_t:file { getattr read };
|
|
|
|
|
|
|
|
kernel_read_all_sysctl(dovecot_auth_t)
|
|
|
|
kernel_read_system_state(dovecot_auth_t)
|
|
|
|
|
|
|
|
dev_read_urand(dovecot_auth_t)
|
|
|
|
|
|
|
|
auth_domtrans_chk_passwd(dovecot_auth_t)
|
2005-11-29 21:51:24 +00:00
|
|
|
auth_use_nsswitch(dovecot_auth_t)
|
2005-10-21 15:38:22 +00:00
|
|
|
|
|
|
|
files_read_etc_files(dovecot_auth_t)
|
2005-11-29 21:51:24 +00:00
|
|
|
files_read_etc_runtime_files(dovecot_auth_t)
|
2005-10-21 15:38:22 +00:00
|
|
|
files_search_pids(dovecot_auth_t)
|
|
|
|
|
|
|
|
libs_use_ld_so(dovecot_auth_t)
|
|
|
|
libs_use_shared_libs(dovecot_auth_t)
|
|
|
|
|
|
|
|
miscfiles_read_localization(dovecot_auth_t)
|
|
|
|
|
|
|
|
seutil_dontaudit_search_config(dovecot_auth_t)
|
|
|
|
|
|
|
|
sysnet_dns_name_resolve(dovecot_auth_t)
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`kerberos',`
|
2005-10-21 15:38:22 +00:00
|
|
|
kerberos_use(dovecot_auth_t)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`logging',`
|
2005-10-21 15:38:22 +00:00
|
|
|
logging_send_syslog_msg(dovecot_auth_t)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`nis',`
|
2005-10-21 15:38:22 +00:00
|
|
|
nis_use_ypbind(dovecot_auth_t)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`nscd',`
|
2005-10-21 15:38:22 +00:00
|
|
|
nscd_use_socket(dovecot_auth_t)
|
|
|
|
')
|