Chris PeBenito 29af4c
policy_module(exim, 1.5.0)
Chris PeBenito 6bf8bf
Chris PeBenito 6bf8bf
########################################
Chris PeBenito 6bf8bf
#
Chris PeBenito 6bf8bf
# Declarations
Chris PeBenito 6bf8bf
#
Chris PeBenito 6bf8bf
Chris PeBenito 6bf8bf
## <desc>
Chris PeBenito 6bf8bf
## 

Chris PeBenito 80348b
## Allow exim to connect to databases (postgres, mysql)
Chris PeBenito 80348b
## 

Chris PeBenito 80348b
## </desc>
Chris PeBenito 80348b
gen_tunable(exim_can_connect_db, false)
Chris PeBenito 80348b
Chris PeBenito 80348b
## <desc>
Chris PeBenito 80348b
## 

Chris PeBenito 6bf8bf
## Allow exim to read unprivileged user files.
Chris PeBenito 6bf8bf
## 

Chris PeBenito 6bf8bf
## </desc>
Chris PeBenito 0bfccd
gen_tunable(exim_read_user_files, false)
Chris PeBenito 6bf8bf
Chris PeBenito 6bf8bf
## <desc>
Chris PeBenito 6bf8bf
## 

Chris PeBenito 6bf8bf
## Allow exim to create, read, write, and delete
Chris PeBenito 6bf8bf
## unprivileged user files.
Chris PeBenito 6bf8bf
## 

Chris PeBenito 6bf8bf
## </desc>
Chris PeBenito 0bfccd
gen_tunable(exim_manage_user_files, false)
Chris PeBenito 6bf8bf
Chris PeBenito 6bf8bf
type exim_t;
Chris PeBenito 6bf8bf
type exim_exec_t;
Chris PeBenito 6bf8bf
init_daemon_domain(exim_t, exim_exec_t)
Chris PeBenito 80348b
mta_mailserver(exim_t, exim_exec_t)
Chris PeBenito 80348b
mta_mailserver_user_agent(exim_t)
Chris PeBenito 80348b
application_executable_file(exim_exec_t)
Chris PeBenito 80348b
mta_agent_executable(exim_exec_t)
Chris PeBenito 6bf8bf
Chris PeBenito 6bf8bf
type exim_log_t;
Chris PeBenito 6bf8bf
logging_log_file(exim_log_t)
Chris PeBenito 6bf8bf
Chris PeBenito 6bf8bf
type exim_spool_t;
Chris PeBenito 6bf8bf
files_type(exim_spool_t)
Chris PeBenito 6bf8bf
Chris PeBenito 6bf8bf
type exim_tmp_t;
Chris PeBenito 6bf8bf
files_tmp_file(exim_tmp_t)
Chris PeBenito 6bf8bf
Chris PeBenito 6bf8bf
type exim_var_run_t;
Chris PeBenito 6bf8bf
files_pid_file(exim_var_run_t)
Chris PeBenito 6bf8bf
Chris PeBenito 6bf8bf
########################################
Chris PeBenito 6bf8bf
#
Chris PeBenito 6bf8bf
# exim local policy
Chris PeBenito 6bf8bf
#
Chris PeBenito 6bf8bf
Chris PeBenito 3f67f7
allow exim_t self:capability { chown dac_override dac_read_search fowner setuid setgid sys_resource };
Chris PeBenito 80348b
allow exim_t self:process { setrlimit setpgid };
Chris PeBenito 6bf8bf
allow exim_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 6bf8bf
allow exim_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 6bf8bf
allow exim_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 80348b
allow exim_t self:udp_socket create_socket_perms;
Chris PeBenito 6bf8bf
Chris PeBenito 3f67f7
can_exec(exim_t, exim_exec_t)
Chris PeBenito 6bf8bf
Chris PeBenito 6bf8bf
manage_files_pattern(exim_t, exim_log_t, exim_log_t)
Chris PeBenito 6bf8bf
logging_log_filetrans(exim_t, exim_log_t, { file dir })
Chris PeBenito 6bf8bf
Chris PeBenito 6bf8bf
manage_dirs_pattern(exim_t, exim_spool_t, exim_spool_t)
Chris PeBenito 6bf8bf
manage_files_pattern(exim_t, exim_spool_t, exim_spool_t)
Chris PeBenito 6bf8bf
manage_sock_files_pattern(exim_t, exim_spool_t, exim_spool_t)
Chris PeBenito 0bfccd
files_spool_filetrans(exim_t, exim_spool_t, { file dir sock_file })
Chris PeBenito 6bf8bf
Chris PeBenito 6bf8bf
manage_dirs_pattern(exim_t, exim_tmp_t, exim_tmp_t)
Chris PeBenito 6bf8bf
manage_files_pattern(exim_t, exim_tmp_t, exim_tmp_t)
Chris PeBenito 6bf8bf
files_tmp_filetrans(exim_t, exim_tmp_t, { file dir })
Chris PeBenito 6bf8bf
Chris PeBenito 6bf8bf
manage_dirs_pattern(exim_t, exim_var_run_t, exim_var_run_t)
Chris PeBenito 6bf8bf
manage_files_pattern(exim_t, exim_var_run_t, exim_var_run_t)
Chris PeBenito 6bf8bf
files_pid_filetrans(exim_t, exim_var_run_t, { file dir })
Chris PeBenito 6bf8bf
Chris PeBenito 6bf8bf
kernel_read_kernel_sysctls(exim_t)
Chris PeBenito 80348b
kernel_read_network_state(exim_t)
Chris PeBenito d57a09
kernel_dontaudit_read_system_state(exim_t)
Chris PeBenito d57a09
Chris PeBenito 6bf8bf
corecmd_search_bin(exim_t)
Chris PeBenito 6bf8bf
Chris PeBenito 6bf8bf
corenet_all_recvfrom_unlabeled(exim_t)
Chris PeBenito 80348b
corenet_all_recvfrom_netlabel(exim_t)
Chris PeBenito 668b30
corenet_tcp_sendrecv_generic_if(exim_t)
Chris PeBenito 80348b
corenet_udp_sendrecv_generic_if(exim_t)
Chris PeBenito c12621
corenet_tcp_sendrecv_generic_node(exim_t)
Chris PeBenito 80348b
corenet_udp_sendrecv_generic_node(exim_t)
Chris PeBenito 6bf8bf
corenet_tcp_sendrecv_all_ports(exim_t)
Chris PeBenito c12621
corenet_tcp_bind_generic_node(exim_t)
Chris PeBenito 6bf8bf
corenet_tcp_bind_smtp_port(exim_t)
Chris PeBenito 6bf8bf
corenet_tcp_bind_amavisd_send_port(exim_t)
Chris PeBenito 6bf8bf
corenet_tcp_connect_auth_port(exim_t)
Chris PeBenito d57a09
corenet_tcp_connect_smtp_port(exim_t)
Chris PeBenito d57a09
corenet_tcp_connect_ldap_port(exim_t)
Chris PeBenito 6bf8bf
corenet_tcp_connect_inetd_child_port(exim_t)
Chris PeBenito 80348b
# connect to spamassassin
Chris PeBenito 80348b
corenet_tcp_connect_spamd_port(exim_t)
Chris PeBenito 6bf8bf
Chris PeBenito d57a09
dev_read_rand(exim_t)
Chris PeBenito d57a09
dev_read_urand(exim_t)
Chris PeBenito d57a09
Chris PeBenito 6bf8bf
# Init script handling
Chris PeBenito 6bf8bf
domain_use_interactive_fds(exim_t)
Chris PeBenito 6bf8bf
Chris PeBenito 80348b
files_search_usr(exim_t)
Chris PeBenito 80348b
files_search_var(exim_t)
Chris PeBenito 6bf8bf
files_read_etc_files(exim_t)
Chris PeBenito 80348b
files_read_etc_runtime_files(exim_t)
Chris PeBenito 84a45c
files_getattr_all_mountpoints(exim_t)
Chris PeBenito 80348b
Chris PeBenito 80348b
fs_getattr_xattr_fs(exim_t)
Chris PeBenito 80348b
fs_list_inotifyfs(exim_t)
Chris PeBenito 6bf8bf
Chris PeBenito 6bf8bf
auth_use_nsswitch(exim_t)
Chris PeBenito 6bf8bf
Chris PeBenito 6bf8bf
logging_send_syslog_msg(exim_t)
Chris PeBenito 6bf8bf
Chris PeBenito 6bf8bf
miscfiles_read_localization(exim_t)
Chris PeBenito 80348b
miscfiles_read_certs(exim_t)
Chris PeBenito 6bf8bf
Chris PeBenito 296273
userdom_dontaudit_search_user_home_dirs(exim_t)
Chris PeBenito 6bf8bf
Chris PeBenito 6bf8bf
mta_read_aliases(exim_t)
Chris PeBenito 80348b
mta_read_config(exim_t)
Chris PeBenito 80348b
mta_manage_spool(exim_t)
Chris PeBenito 80348b
mta_mailserver_delivery(exim_t)
Chris PeBenito 80348b
Chris PeBenito 80348b
tunable_policy(`exim_can_connect_db',`
Chris PeBenito 80348b
	corenet_tcp_connect_mysqld_port(exim_t)
Chris PeBenito 80348b
	corenet_sendrecv_mysqld_client_packets(exim_t)
Chris PeBenito 3f67f7
	corenet_tcp_connect_postgresql_port(exim_t)
Chris PeBenito 3f67f7
	corenet_sendrecv_postgresql_client_packets(exim_t)
Chris PeBenito 80348b
')
Chris PeBenito 6bf8bf
Chris PeBenito 6bf8bf
tunable_policy(`exim_read_user_files',`
Chris PeBenito 296273
	userdom_read_user_home_content_files(exim_t)
Chris PeBenito 296273
	userdom_read_user_tmp_files(exim_t)
Chris PeBenito 6bf8bf
')
Chris PeBenito 6bf8bf
Chris PeBenito 6bf8bf
tunable_policy(`exim_manage_user_files',`
Chris PeBenito 296273
	userdom_manage_user_home_content_dirs(exim_t)
Chris PeBenito 296273
	userdom_read_user_tmp_files(exim_t)
Chris PeBenito 296273
	userdom_write_user_tmp_files(exim_t)
Chris PeBenito 6bf8bf
')
Chris PeBenito 80348b
Chris PeBenito 80348b
optional_policy(`
Chris PeBenito 80348b
	clamav_domtrans_clamscan(exim_t)
Chris PeBenito 80348b
	clamav_stream_connect(exim_t)
Chris PeBenito 80348b
')
Chris PeBenito 80348b
Chris PeBenito 80348b
optional_policy(`
Chris PeBenito 80348b
	cron_read_pipes(exim_t)
Chris PeBenito 80348b
	cron_rw_system_job_pipes(exim_t)
Chris PeBenito 80348b
')
Chris PeBenito 80348b
Chris PeBenito 80348b
optional_policy(`
Chris PeBenito 80348b
	cyrus_stream_connect(exim_t)
Chris PeBenito 80348b
')
Chris PeBenito 80348b
Chris PeBenito 80348b
optional_policy(`
Chris PeBenito 80348b
	kerberos_keytab_template(exim, exim_t)
Chris PeBenito 80348b
')
Chris PeBenito 80348b
Chris PeBenito 80348b
optional_policy(`
Chris PeBenito 80348b
	mailman_read_data_files(exim_t)
Chris PeBenito 80348b
	mailman_domtrans(exim_t)
Chris PeBenito 80348b
')
Chris PeBenito 80348b
Chris PeBenito 80348b
optional_policy(`
Chris PeBenito 80348b
	tunable_policy(`exim_can_connect_db',`
Chris PeBenito 80348b
		mysql_stream_connect(exim_t)
Chris PeBenito 80348b
	')
Chris PeBenito 80348b
')
Chris PeBenito 80348b
Chris PeBenito 80348b
optional_policy(`
Chris PeBenito 80348b
	tunable_policy(`exim_can_connect_db',`
Chris PeBenito 80348b
		postgresql_stream_connect(exim_t)
Chris PeBenito 80348b
	')
Chris PeBenito 80348b
')
Chris PeBenito 80348b
Chris PeBenito 80348b
optional_policy(`
Chris PeBenito 80348b
	procmail_domtrans(exim_t)
Chris PeBenito 80348b
')
Chris PeBenito 80348b
Chris PeBenito 80348b
optional_policy(`
Chris PeBenito 80348b
	sasl_connect(exim_t)
Chris PeBenito 80348b
')
Chris PeBenito 80348b
Chris PeBenito 80348b
optional_policy(`
Chris PeBenito 4931c5
	# https://bugzilla.redhat.com/show_bug.cgi?id=512710
Chris PeBenito 4931c5
	# uses sendmail for outgoing mail and exim
Chris PeBenito 4931c5
	# for incoming mail
Jeremy Solt 9a1f0d
	sendmail_manage_tmp_files(exim_t)
Jeremy Solt 9a1f0d
')
Jeremy Solt 9a1f0d
Jeremy Solt 9a1f0d
optional_policy(`
Chris PeBenito 80348b
	spamassassin_exec(exim_t)
Chris PeBenito 80348b
	spamassassin_exec_client(exim_t)
Chris PeBenito 80348b
')