Chris PeBenito 29ce00
Chris PeBenito 29ce00
policy_module(dovecot,1.0)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
########################################
Chris PeBenito 29ce00
#
Chris PeBenito 29ce00
# Declarations
Chris PeBenito 29ce00
#
Chris PeBenito 784a3b
type dovecot_t;
Chris PeBenito 29ce00
type dovecot_exec_t;
Chris PeBenito 29ce00
init_daemon_domain(dovecot_t,dovecot_exec_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
type dovecot_cert_t;
Chris PeBenito 29ce00
files_type(dovecot_cert_t)
Chris PeBenito 29ce00
Chris PeBenito 9bbc75
type dovecot_etc_t;
Chris PeBenito 9bbc75
files_config_file(dovecot_etc_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
type dovecot_passwd_t;
Chris PeBenito 29ce00
files_type(dovecot_passwd_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
type dovecot_spool_t;
Chris PeBenito 29ce00
files_type(dovecot_spool_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
type dovecot_var_run_t;
Chris PeBenito 29ce00
files_pid_file(dovecot_var_run_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
type dovecot_auth_t;
Chris PeBenito 29ce00
type dovecot_auth_exec_t;
Chris PeBenito 29ce00
domain_type(dovecot_auth_t)
Chris PeBenito 29ce00
domain_entry_file(dovecot_auth_t,dovecot_auth_exec_t)
Chris PeBenito 29ce00
role system_r types dovecot_auth_t;
Chris PeBenito 29ce00
Chris PeBenito 29ce00
########################################
Chris PeBenito 29ce00
#
Chris PeBenito 29ce00
# dovecot local policy
Chris PeBenito 29ce00
#
Chris PeBenito 29ce00
allow dovecot_t self:capability { dac_override dac_read_search chown net_bind_service setgid setuid sys_chroot };
Chris PeBenito 29ce00
dontaudit dovecot_t self:capability sys_tty_config;
Chris PeBenito 29ce00
allow dovecot_t self:process { setrlimit signal_perms };
Chris PeBenito 29ce00
allow dovecot_t self:fifo_file rw_file_perms;
Chris PeBenito 29ce00
allow dovecot_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 29ce00
allow dovecot_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 29ce00
allow dovecot_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 29ce00
Chris PeBenito 29ce00
domain_auto_trans(dovecot_t, dovecot_auth_exec_t, dovecot_auth_t)
Chris PeBenito 29ce00
allow dovecot_t dovecot_auth_t:fd use;
Chris PeBenito 29ce00
allow dovecot_auth_t dovecot_t:process sigchld;
Chris PeBenito 29ce00
allow dovecot_auth_t dovecot_t:fd use;
Chris PeBenito 29ce00
allow dovecot_auth_t dovecot_t:fifo_file { ioctl read write getattr lock append };
Chris PeBenito 29ce00
Chris PeBenito 29ce00
allow dovecot_t dovecot_cert_t:dir { getattr read search };
Chris PeBenito 29ce00
allow dovecot_t dovecot_cert_t:file { read getattr ioctl lock };
Chris PeBenito 29ce00
allow dovecot_t dovecot_cert_t:lnk_file { getattr read };
Chris PeBenito 29ce00
Chris PeBenito 29ce00
allow dovecot_t dovecot_etc_t:file { getattr read };
Chris PeBenito 29ce00
files_search_etc(dovecot_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
can_exec(dovecot_t, dovecot_exec_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
allow dovecot_t dovecot_spool_t:dir create_dir_perms;
Chris PeBenito 29ce00
allow dovecot_t dovecot_spool_t:file create_file_perms;
Chris PeBenito 29ce00
allow dovecot_t dovecot_spool_t:lnk_file create_lnk_perms;
Chris PeBenito 29ce00
Chris PeBenito 29ce00
allow dovecot_t dovecot_var_run_t:file create_file_perms;
Chris PeBenito 29ce00
allow dovecot_t dovecot_var_run_t:sock_file create_file_perms;
Chris PeBenito 29ce00
allow dovecot_t dovecot_var_run_t:dir rw_dir_perms;
Chris PeBenito 29ce00
files_create_pid(dovecot_t,dovecot_var_run_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
kernel_read_kernel_sysctl(dovecot_t)
Chris PeBenito 29ce00
kernel_read_system_state(dovecot_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
corenet_tcp_sendrecv_all_if(dovecot_t)
Chris PeBenito 29ce00
corenet_raw_sendrecv_all_if(dovecot_t)
Chris PeBenito 29ce00
corenet_tcp_sendrecv_all_nodes(dovecot_t)
Chris PeBenito 29ce00
corenet_raw_sendrecv_all_nodes(dovecot_t)
Chris PeBenito 29ce00
corenet_tcp_sendrecv_all_ports(dovecot_t)
Chris PeBenito 29ce00
corenet_tcp_bind_all_nodes(dovecot_t)
Chris PeBenito e6a2ea
corenet_tcp_bind_pop_port(dovecot_t)
Chris PeBenito da4fc9
corenet_tcp_connect_all_ports(dovecot_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
dev_read_sysfs(dovecot_t)
Chris PeBenito 29ce00
dev_read_urand(dovecot_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
fs_getattr_all_fs(dovecot_t)
Chris PeBenito 29ce00
fs_search_auto_mountpoints(dovecot_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
term_dontaudit_use_console(dovecot_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
corecmd_exec_bin(dovecot_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
domain_use_wide_inherit_fd(dovecot_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
files_read_etc_files(dovecot_t)
Chris PeBenito 29ce00
files_search_spool(dovecot_t)
Chris PeBenito 29ce00
files_search_tmp(dovecot_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
init_use_fd(dovecot_t)
Chris PeBenito 29ce00
init_use_script_pty(dovecot_t)
Chris PeBenito 29ce00
init_getattr_script_pids(dovecot_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
libs_use_ld_so(dovecot_t)
Chris PeBenito 29ce00
libs_use_shared_libs(dovecot_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
logging_send_syslog_msg(dovecot_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
miscfiles_read_certs(dovecot_t)
Chris PeBenito 29ce00
miscfiles_read_localization(dovecot_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
sysnet_read_config(dovecot_t)
Chris PeBenito 29ce00
sysnet_use_ldap(dovecot_auth_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
userdom_dontaudit_use_unpriv_user_fd(dovecot_t)
Chris PeBenito 29ce00
userdom_dontaudit_search_sysadm_home_dir(dovecot_t)
Chris PeBenito 784a3b
userdom_priveleged_home_dir_manager(dovecot_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
mta_append_spool(dovecot_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
ifdef(`targeted_policy',`
Chris PeBenito 29ce00
	term_dontaudit_use_unallocated_tty(dovecot_t)
Chris PeBenito 29ce00
	term_dontaudit_use_generic_pty(dovecot_t)
Chris PeBenito 29ce00
	files_dontaudit_read_root_file(dovecot_t)
Chris PeBenito 29ce00
')
Chris PeBenito 29ce00
Chris PeBenito 29ce00
optional_policy(`kerberos.te',`
Chris PeBenito 29ce00
	kerberos_use(dovecot_t)
Chris PeBenito 29ce00
')
Chris PeBenito 29ce00
Chris PeBenito 29ce00
optional_policy(`nis.te',`
Chris PeBenito 29ce00
	nis_use_ypbind(dovecot_t)
Chris PeBenito 29ce00
')
Chris PeBenito 29ce00
Chris PeBenito 29ce00
optional_policy(`selinuxutil.te',`
Chris PeBenito 29ce00
	seutil_sigchld_newrole(dovecot_t)
Chris PeBenito 29ce00
')
Chris PeBenito 29ce00
Chris PeBenito 29ce00
optional_policy(`udev.te',`
Chris PeBenito 29ce00
	udev_read_db(dovecot_t)
Chris PeBenito 29ce00
')
Chris PeBenito 29ce00
Chris PeBenito 29ce00
########################################
Chris PeBenito 29ce00
#
Chris PeBenito 29ce00
# dovecot auth local policy
Chris PeBenito 29ce00
#
Chris PeBenito 29ce00
allow dovecot_auth_t self:capability { setgid setuid };
Chris PeBenito 29ce00
allow dovecot_auth_t self:process signal_perms;
Chris PeBenito 29ce00
allow dovecot_auth_t self:fifo_file rw_file_perms;
Chris PeBenito 29ce00
allow dovecot_auth_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 29ce00
allow dovecot_auth_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 29ce00
Chris PeBenito 29ce00
allow dovecot_auth_t dovecot_t:unix_stream_socket { getattr accept read write ioctl };
Chris PeBenito 29ce00
Chris PeBenito 29ce00
allow dovecot_auth_t dovecot_passwd_t:file { getattr read };
Chris PeBenito 29ce00
Chris PeBenito 29ce00
kernel_read_all_sysctl(dovecot_auth_t)
Chris PeBenito 29ce00
kernel_read_system_state(dovecot_auth_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
dev_read_urand(dovecot_auth_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
auth_domtrans_chk_passwd(dovecot_auth_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
files_read_etc_files(dovecot_auth_t)
Chris PeBenito 29ce00
files_search_pids(dovecot_auth_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
libs_use_ld_so(dovecot_auth_t)
Chris PeBenito 29ce00
libs_use_shared_libs(dovecot_auth_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
miscfiles_read_localization(dovecot_auth_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
seutil_dontaudit_search_config(dovecot_auth_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
sysnet_dns_name_resolve(dovecot_auth_t)
Chris PeBenito 29ce00
Chris PeBenito 29ce00
optional_policy(`kerberos.te',`
Chris PeBenito 29ce00
	kerberos_use(dovecot_auth_t)
Chris PeBenito 29ce00
')
Chris PeBenito 29ce00
Chris PeBenito 29ce00
optional_policy(`logging.te',`
Chris PeBenito 29ce00
	logging_send_syslog_msg(dovecot_auth_t)
Chris PeBenito 29ce00
')
Chris PeBenito 29ce00
Chris PeBenito 29ce00
optional_policy(`nis.te',`
Chris PeBenito 29ce00
	nis_use_ypbind(dovecot_auth_t)
Chris PeBenito 29ce00
')
Chris PeBenito 29ce00
Chris PeBenito 29ce00
optional_policy(`nscd.te',`
Chris PeBenito 29ce00
	nscd_use_socket(dovecot_auth_t)
Chris PeBenito 29ce00
')
Chris PeBenito 29ce00
Chris PeBenito 29ce00
ifdef(`TODO',`
Chris PeBenito 29ce00
optional_policy(`rhgb.te',`
Chris PeBenito 29ce00
	rhgb_domain(dovecot_t)
Chris PeBenito 29ce00
')
Chris PeBenito 29ce00
')