Chris PeBenito 04926d
Chris PeBenito 04926d
policy_module(postfix,1.0)
Chris PeBenito 04926d
Chris PeBenito 04926d
########################################
Chris PeBenito 04926d
#
Chris PeBenito 04926d
# Declarations
Chris PeBenito 04926d
#
Chris PeBenito 04926d
Chris PeBenito 04926d
postfix_public_domain_template(bounce)
Chris PeBenito 04926d
Chris PeBenito 04926d
type postfix_spool_bounce_t;
Chris PeBenito 04926d
files_type(postfix_spool_bounce_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
postfix_public_domain_template(cleanup)
Chris PeBenito 04926d
Chris PeBenito 04926d
type postfix_etc_t;
Chris PeBenito 04926d
files_type(postfix_etc_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
type postfix_exec_t;
Chris PeBenito 04926d
files_type(postfix_exec_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
postfix_server_domain_template(local)
Chris PeBenito 04926d
mta_mailserver_delivery(postfix_local_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
type postfix_local_tmp_t;
Chris PeBenito 04926d
files_tmp_file(postfix_local_tmp_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
# Program for creating database files
Chris PeBenito 04926d
type postfix_map_t;
Chris PeBenito 04926d
type postfix_map_exec_t;
Chris PeBenito 04926d
domain_type(postfix_map_t)
Chris PeBenito 04926d
domain_entry_file(postfix_map_t,postfix_map_exec_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
type postfix_map_tmp_t;
Chris PeBenito 04926d
files_tmp_file(postfix_map_tmp_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
postfix_domain_template(master)
Chris PeBenito 04926d
mta_mailserver(postfix_master_t,postfix_master_exec_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
postfix_public_domain_template(pickup)
Chris PeBenito 04926d
Chris PeBenito 04926d
postfix_public_domain_template(pipe)
Chris PeBenito 04926d
Chris PeBenito 04926d
postfix_user_domain_template(postdrop)
Chris PeBenito 04926d
mta_mailserver_user_agent(postfix_postdrop_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
postfix_user_domain_template(postqueue)
Chris PeBenito 04926d
Chris PeBenito 04926d
type postfix_private_t;
Chris PeBenito 04926d
files_type(postfix_private_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
type postfix_prng_t;
Chris PeBenito 04926d
files_type(postfix_prng_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
postfix_public_domain_template(qmgr)
Chris PeBenito 04926d
Chris PeBenito 04926d
postfix_user_domain_template(showq)
Chris PeBenito 04926d
Chris PeBenito 04926d
postfix_server_domain_template(smtp)
Chris PeBenito 04926d
mta_mailserver_sender(postfix_smtp_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
postfix_server_domain_template(smtpd)
Chris PeBenito 04926d
Chris PeBenito 04926d
type postfix_spool_t;
Chris PeBenito 04926d
files_type(postfix_spool_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
type postfix_spool_maildrop_t;
Chris PeBenito 04926d
files_type(postfix_spool_maildrop_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
type postfix_spool_flush_t;
Chris PeBenito 04926d
files_type(postfix_spool_flush_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
type postfix_public_t;
Chris PeBenito 04926d
files_type(postfix_public_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
type postfix_var_run_t;
Chris PeBenito 04926d
files_pid_file(postfix_var_run_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
########################################
Chris PeBenito 04926d
#
Chris PeBenito 04926d
# Postfix master process local policy
Chris PeBenito 04926d
#
Chris PeBenito 04926d
Chris PeBenito 04926d
# chown is to set the correct ownership of queue dirs
Chris PeBenito 04926d
allow postfix_master_t self:capability { chown dac_override kill setgid setuid net_bind_service sys_tty_config };
Chris PeBenito 04926d
allow postfix_master_t self:fifo_file rw_file_perms;
Chris PeBenito 04926d
allow postfix_master_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 04926d
allow postfix_master_t self:udp_socket create_socket_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
can_exec(postfix_master_t,postfix_exec_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_master_t postfix_map_exec_t:file rx_file_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_master_t postfix_postdrop_exec_t:file getattr;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_master_t postfix_postqueue_exec_t:file getattr;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_master_t postfix_private_t:dir rw_dir_perms;
Chris PeBenito 04926d
allow postfix_master_t postfix_private_t:sock_file create_file_perms;
Chris PeBenito 04926d
allow postfix_master_t postfix_private_t:fifo_file create_file_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_master_t postfix_prng_t:file rw_file_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_master_t postfix_public_t:fifo_file create_file_perms;
Chris PeBenito 04926d
allow postfix_master_t postfix_public_t:sock_file create_file_perms;
Chris PeBenito 04926d
allow postfix_master_t postfix_public_t:dir rw_dir_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
# allow access to deferred queue and allow removing bogus incoming entries
Chris PeBenito 04926d
allow postfix_master_t postfix_spool_t:dir create_dir_perms;
Chris PeBenito 04926d
allow postfix_master_t postfix_spool_t:file create_file_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_master_t postfix_spool_flush_t:dir create_dir_perms;
Chris PeBenito 04926d
allow postfix_master_t postfix_spool_flush_t:file create_file_perms;
Chris PeBenito 04926d
allow postfix_master_t postfix_spool_flush_t:lnk_file create_lnk_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_master_t postfix_spool_maildrop_t:dir rw_dir_perms;
Chris PeBenito 04926d
allow postfix_master_t postfix_spool_maildrop_t:file { unlink rename getattr };
Chris PeBenito 04926d
Chris PeBenito 04926d
kernel_read_all_sysctl(postfix_master_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
corenet_tcp_sendrecv_all_if(postfix_master_t)
Chris PeBenito 04926d
corenet_udp_sendrecv_all_if(postfix_master_t)
Chris PeBenito 04926d
corenet_raw_sendrecv_all_if(postfix_master_t)
Chris PeBenito 04926d
corenet_tcp_sendrecv_all_nodes(postfix_master_t)
Chris PeBenito 04926d
corenet_udp_sendrecv_all_nodes(postfix_master_t)
Chris PeBenito 04926d
corenet_raw_sendrecv_all_nodes(postfix_master_t)
Chris PeBenito 04926d
corenet_tcp_sendrecv_all_ports(postfix_master_t)
Chris PeBenito 04926d
corenet_udp_sendrecv_all_ports(postfix_master_t)
Chris PeBenito 04926d
corenet_tcp_bind_all_nodes(postfix_master_t)
Chris PeBenito 04926d
corenet_udp_bind_all_nodes(postfix_master_t)
Chris PeBenito 04926d
corenet_tcp_bind_amavisd_send_port(postfix_master_t)
Chris PeBenito 04926d
corenet_tcp_bind_smtp_port(postfix_master_t)
Chris PeBenito 04926d
corenet_tcp_connect_all_ports(postfix_master_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
# for a find command
Chris PeBenito 04926d
selinux_dontaudit_search_fs(postfix_master_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
corecmd_exec_ls(postfix_master_t)
Chris PeBenito 04926d
corecmd_exec_sbin(postfix_master_t)
Chris PeBenito 04926d
corecmd_exec_shell(postfix_master_t)
Chris PeBenito 04926d
corecmd_exec_bin(postfix_master_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
domain_use_wide_inherit_fd(postfix_master_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
files_read_usr_files(postfix_master_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
init_use_script_pty(postfix_master_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
miscfiles_dontaudit_search_man_pages(postfix_master_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
seutil_sigchld_newrole(postfix_master_t)
Chris PeBenito 04926d
# postfix does a "find" on startup for some reason - keep it quiet
Chris PeBenito 04926d
seutil_dontaudit_search_config(postfix_master_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
sysnet_read_config(postfix_master_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
mta_rw_aliases(postfix_master_t)
Chris PeBenito 04926d
mta_read_sendmail_bin(postfix_master_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
optional_policy(`mount.te',`
Chris PeBenito 04926d
	mount_send_nfs_client_request(postfix_master_t)
Chris PeBenito 04926d
')
Chris PeBenito 04926d
Chris PeBenito 04926d
optional_policy(`nis.te',`
Chris PeBenito 04926d
	nis_use_ypbind(postfix_master_t)
Chris PeBenito 04926d
')
Chris PeBenito 04926d
Chris PeBenito 04926d
###########################################################
Chris PeBenito 04926d
#
Chris PeBenito 04926d
# Partially converted rules.  THESE ARE ONLY TEMPORARY
Chris PeBenito 04926d
#
Chris PeBenito 04926d
Chris PeBenito 04926d
ifdef(`distro_redhat',`
Chris PeBenito 04926d
	# for newer main.cf that uses /etc/aliases
Chris PeBenito 04926d
	allow postfix_master_t etc_t:dir rw_dir_perms;
Chris PeBenito 04926d
	allow postfix_master_t etc_aliases_t:dir create_dir_perms;
Chris PeBenito 04926d
	allow postfix_master_t etc_aliases_t:file create_file_perms;
Chris PeBenito 04926d
	allow postfix_master_t etc_aliases_t:lnk_file create_lnk_perms;
Chris PeBenito 04926d
	allow postfix_master_t etc_aliases_t:sock_file create_file_perms;
Chris PeBenito 04926d
	allow postfix_master_t etc_aliases_t:fifo_file create_file_perms;
Chris PeBenito 04926d
	type_transition postfix_master_t etc_t:{ file lnk_file sock_file fifo_file } etc_aliases_t;
Chris PeBenito 04926d
Chris PeBenito 04926d
	allow postfix_master_t postfix_etc_t:dir rw_dir_perms;
Chris PeBenito 04926d
	allow postfix_master_t etc_aliases_t:dir create_dir_perms;
Chris PeBenito 04926d
	allow postfix_master_t etc_aliases_t:file create_file_perms;
Chris PeBenito 04926d
	allow postfix_master_t etc_aliases_t:lnk_file create_lnk_perms;
Chris PeBenito 04926d
	allow postfix_master_t etc_aliases_t:sock_file create_file_perms;
Chris PeBenito 04926d
	allow postfix_master_t etc_aliases_t:fifo_file create_file_perms;
Chris PeBenito 04926d
	type_transition postfix_master_t postfix_etc_t:{ file lnk_file sock_file fifo_file } etc_aliases_t;
Chris PeBenito 04926d
')
Chris PeBenito 04926d
Chris PeBenito 04926d
# postfix needs this for newaliases
Chris PeBenito 04926d
allow { system_mail_t sysadm_mail_t } tmp_t:dir getattr;
Chris PeBenito 04926d
Chris PeBenito 04926d
can_exec({ sysadm_mail_t system_mail_t }, postfix_master_exec_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
allow sysadm_mail_t etc_aliases_t:dir create_dir_perms;
Chris PeBenito 04926d
allow sysadm_mail_t etc_aliases_t:file create_file_perms;
Chris PeBenito 04926d
allow sysadm_mail_t etc_aliases_t:lnk_file create_lnk_perms;
Chris PeBenito 04926d
allow sysadm_mail_t etc_aliases_t:sock_file create_file_perms;
Chris PeBenito 04926d
allow sysadm_mail_t etc_aliases_t:fifo_file create_file_perms;
Chris PeBenito 04926d
files_create_etc_config(system_mail_t,etc_aliases_t,{ file lnk_file sock_file fifo_file })
Chris PeBenito 04926d
Chris PeBenito 04926d
Chris PeBenito 04926d
ifdef(`distro_redhat',`
Chris PeBenito 04926d
	# compatability for old default main.cf
Chris PeBenito 04926d
	allow { sysadm_mail_t system_mail_t } etc_aliases_t:dir create_dir_perms;
Chris PeBenito 04926d
	allow { sysadm_mail_t system_mail_t } etc_aliases_t:file create_file_perms;
Chris PeBenito 04926d
	allow { sysadm_mail_t system_mail_t } etc_aliases_t:lnk_file create_lnk_perms;
Chris PeBenito 04926d
	allow { sysadm_mail_t system_mail_t } etc_aliases_t:sock_file create_file_perms;
Chris PeBenito 04926d
	allow { sysadm_mail_t system_mail_t } etc_aliases_t:fifo_file create_file_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
	allow { sysadm_mail_t system_mail_t } postfix_etc_t:dir rw_dir_perms;
Chris PeBenito 04926d
	type_transition { sysadm_mail_t system_mail_t } postfix_etc_t:{ file lnk_file sock_file fifo_file } etc_aliases_t;
Chris PeBenito 04926d
Chris PeBenito 04926d
	allow { sysadm_mail_t system_mail_t } etc_aliases_t:dir create_dir_perms;
Chris PeBenito 04926d
	allow { sysadm_mail_t system_mail_t } etc_aliases_t:file create_file_perms;
Chris PeBenito 04926d
	allow { sysadm_mail_t system_mail_t } etc_aliases_t:lnk_file create_lnk_perms;
Chris PeBenito 04926d
	allow { sysadm_mail_t system_mail_t } etc_aliases_t:sock_file create_file_perms;
Chris PeBenito 04926d
	allow { sysadm_mail_t system_mail_t } etc_aliases_t:fifo_file create_file_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
	allow { sysadm_mail_t system_mail_t } postfix_etc_t:dir rw_dir_perms;
Chris PeBenito 04926d
	type_transition { sysadm_mail_t system_mail_t } postfix_etc_t:{ file lnk_file sock_file fifo_file } etc_aliases_t;
Chris PeBenito 04926d
')
Chris PeBenito 04926d
Chris PeBenito 04926d
# end partially converted rules
Chris PeBenito 04926d
Chris PeBenito 04926d
########################################
Chris PeBenito 04926d
#
Chris PeBenito 04926d
# Postfix bounce local policy
Chris PeBenito 04926d
#
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_bounce_t self:capability dac_read_search;
Chris PeBenito 04926d
allow postfix_bounce_t self:tcp_socket create_socket_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_bounce_t postfix_public_t:sock_file write;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_bounce_t postfix_spool_t:dir create_dir_perms;
Chris PeBenito 04926d
allow postfix_bounce_t postfix_spool_t:file create_file_perms;
Chris PeBenito 04926d
allow postfix_bounce_t postfix_spool_t:lnk_file create_lnk_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_bounce_t postfix_spool_bounce_t:dir create_dir_perms;
Chris PeBenito 04926d
allow postfix_bounce_t postfix_spool_bounce_t:file create_file_perms;
Chris PeBenito 04926d
allow postfix_bounce_t postfix_spool_bounce_t:lnk_file create_lnk_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
########################################
Chris PeBenito 04926d
#
Chris PeBenito 04926d
# Postfix cleanup local policy
Chris PeBenito 04926d
#
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_cleanup_t self:process setrlimit;
Chris PeBenito 04926d
Chris PeBenito 04926d
# connect to master process
Chris PeBenito 04926d
allow postfix_cleanup_t postfix_master_t:unix_stream_socket connectto;
Chris PeBenito 04926d
allow postfix_cleanup_t postfix_private_t:dir search;
Chris PeBenito 04926d
allow postfix_cleanup_t postfix_private_t:sock_file rw_file_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_cleanup_t postfix_public_t:fifo_file rw_file_perms;
Chris PeBenito 04926d
allow postfix_cleanup_t postfix_public_t:sock_file { getattr write };
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_cleanup_t postfix_spool_t:dir create_dir_perms;
Chris PeBenito 04926d
allow postfix_cleanup_t postfix_spool_t:file create_file_perms;
Chris PeBenito 04926d
allow postfix_cleanup_t postfix_spool_t:lnk_file create_lnk_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_cleanup_t postfix_spool_bounce_t:dir r_dir_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
########################################
Chris PeBenito 04926d
#
Chris PeBenito 04926d
# Postfix local local policy
Chris PeBenito 04926d
#
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_local_t self:fifo_file rw_file_perms;
Chris PeBenito 04926d
allow postfix_local_t self:process { setsched setrlimit };
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_local_t postfix_local_tmp_t:dir create_dir_perms;
Chris PeBenito 04926d
allow postfix_local_t postfix_local_tmp_t:file create_file_perms;
Chris PeBenito 04926d
files_create_tmp_files(postfix_local_t, postfix_local_tmp_t, { file dir })
Chris PeBenito 04926d
Chris PeBenito 04926d
# connect to master process
Chris PeBenito 04926d
allow postfix_local_t postfix_master_t:unix_stream_socket connectto;
Chris PeBenito 04926d
allow postfix_local_t postfix_public_t:dir search;
Chris PeBenito 04926d
allow postfix_local_t postfix_public_t:sock_file write;
Chris PeBenito 04926d
Chris PeBenito 04926d
# for .forward - maybe we need a new type for it?
Chris PeBenito 04926d
allow postfix_local_t postfix_private_t:dir search;
Chris PeBenito 04926d
allow postfix_local_t postfix_private_t:sock_file rw_file_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_local_t postfix_spool_t:file rw_file_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
corecmd_exec_shell(postfix_local_t)
Chris PeBenito 04926d
corecmd_exec_bin(postfix_local_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
mta_read_aliases(postfix_local_t)
Chris PeBenito 04926d
mta_delete_spool(postfix_local_t)
Chris PeBenito 04926d
# For reading spamassasin
Chris PeBenito 04926d
mta_read_config(postfix_local_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
ifdef(`TODO',`
Chris PeBenito 04926d
optional_policy(`procmail.te', `
Chris PeBenito 04926d
	domain_auto_trans(postfix_local_t, procmail_exec_t, procmail_t)
Chris PeBenito 04926d
	# for a bug in the postfix local program
Chris PeBenito 04926d
	dontaudit procmail_t postfix_local_t:tcp_socket { read write };
Chris PeBenito 04926d
	dontaudit procmail_t postfix_master_t:fd use;
Chris PeBenito 04926d
')
Chris PeBenito 04926d
') dnl end TODO
Chris PeBenito 04926d
Chris PeBenito 04926d
########################################
Chris PeBenito 04926d
#
Chris PeBenito 04926d
# Postfix map local policy
Chris PeBenito 04926d
#
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_map_t self:capability setgid;
Chris PeBenito 04926d
allow postfix_map_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 04926d
allow postfix_map_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 04926d
allow postfix_map_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 04926d
allow postfix_map_t self:udp_socket create_socket_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_map_t postfix_etc_t:dir create_dir_perms;
Chris PeBenito 04926d
allow postfix_map_t postfix_etc_t:file create_file_perms;
Chris PeBenito 04926d
allow postfix_map_t postfix_etc_t:lnk_file create_lnk_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_map_t postfix_map_tmp_t:dir create_dir_perms;
Chris PeBenito 04926d
allow postfix_map_t postfix_map_tmp_t:file create_file_perms;
Chris PeBenito 04926d
files_create_tmp_files(postfix_map_t, postfix_map_tmp_t, { file dir })
Chris PeBenito 04926d
Chris PeBenito 04926d
kernel_read_kernel_sysctl(postfix_map_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
corenet_tcp_sendrecv_all_if(postfix_map_t)
Chris PeBenito 04926d
corenet_udp_sendrecv_all_if(postfix_map_t)
Chris PeBenito 04926d
corenet_raw_sendrecv_all_if(postfix_map_t)
Chris PeBenito 04926d
corenet_tcp_sendrecv_all_nodes(postfix_map_t)
Chris PeBenito 04926d
corenet_udp_sendrecv_all_nodes(postfix_map_t)
Chris PeBenito 04926d
corenet_raw_sendrecv_all_nodes(postfix_map_t)
Chris PeBenito 04926d
corenet_tcp_bind_all_nodes(postfix_map_t)
Chris PeBenito 04926d
corenet_udp_bind_all_nodes(postfix_map_t)
Chris PeBenito 04926d
corenet_tcp_sendrecv_all_ports(postfix_map_t)
Chris PeBenito 04926d
corenet_udp_sendrecv_all_ports(postfix_map_t)
Chris PeBenito 04926d
corenet_tcp_connect_all_ports(postfix_map_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
corecmd_list_bin(postfix_map_t)
Chris PeBenito 04926d
corecmd_read_bin_symlink(postfix_map_t)
Chris PeBenito 04926d
corecmd_read_bin_file(postfix_map_t)
Chris PeBenito 04926d
corecmd_read_bin_pipe(postfix_map_t)
Chris PeBenito 04926d
corecmd_read_bin_socket(postfix_map_t)
Chris PeBenito 04926d
corecmd_list_sbin(postfix_map_t)
Chris PeBenito 04926d
corecmd_read_sbin_symlink(postfix_map_t)
Chris PeBenito 04926d
corecmd_read_sbin_file(postfix_map_t)
Chris PeBenito 04926d
corecmd_read_sbin_pipe(postfix_map_t)
Chris PeBenito 04926d
corecmd_read_sbin_socket(postfix_map_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
files_list_home(postfix_map_t)
Chris PeBenito 04926d
files_read_usr_files(postfix_map_t)
Chris PeBenito 04926d
files_read_etc_files(postfix_map_t)
Chris PeBenito 04926d
files_read_etc_runtime_files(postfix_map_t)
Chris PeBenito 04926d
files_dontaudit_search_var(postfix_map_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
libs_use_ld_so(postfix_map_t)
Chris PeBenito 04926d
libs_use_shared_libs(postfix_map_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
miscfiles_read_localization(postfix_map_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
seutil_read_config(postfix_map_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
sysnet_read_config(postfix_map_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
tunable_policy(`read_default_t',`
Chris PeBenito 04926d
	files_list_default(postfix_map_t)
Chris PeBenito 04926d
	files_read_default_files(postfix_map_t)
Chris PeBenito 04926d
	files_read_default_symlinks(postfix_map_t)
Chris PeBenito 04926d
	files_read_default_sockets(postfix_map_t)
Chris PeBenito 04926d
	files_read_default_pipes(postfix_map_t)
Chris PeBenito 04926d
')
Chris PeBenito 04926d
Chris PeBenito 04926d
optional_policy(`locallogin.te',`
Chris PeBenito 04926d
	locallogin_dontaudit_use_fd(postfix_map_t)
Chris PeBenito 04926d
')
Chris PeBenito 04926d
Chris PeBenito 04926d
# a "run" interface needs to be
Chris PeBenito 04926d
# added, and have sysadm_t use it
Chris PeBenito 04926d
# in a optional_policy block.
Chris PeBenito 04926d
Chris PeBenito 04926d
########################################
Chris PeBenito 04926d
#
Chris PeBenito 04926d
# Postfix pickup local policy
Chris PeBenito 04926d
#
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_pickup_t self:tcp_socket create_socket_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_pickup_t postfix_master_t:unix_stream_socket connectto;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_pickup_t postfix_private_t:dir search;
Chris PeBenito 04926d
allow postfix_pickup_t postfix_private_t:sock_file write;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_pickup_t postfix_public_t:fifo_file rw_file_perms;
Chris PeBenito 04926d
allow postfix_pickup_t postfix_public_t:sock_file rw_file_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_pickup_t postfix_spool_maildrop_t:dir rw_dir_perms;
Chris PeBenito 04926d
allow postfix_pickup_t postfix_spool_maildrop_t:file r_file_perms;
Chris PeBenito 04926d
allow postfix_pickup_t postfix_spool_maildrop_t:file unlink;
Chris PeBenito 04926d
Chris PeBenito 04926d
########################################
Chris PeBenito 04926d
#
Chris PeBenito 04926d
# Postfix pipe local policy
Chris PeBenito 04926d
#
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_pipe_t self:fifo_file { read write };
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_pipe_t postfix_private_t:dir search;
Chris PeBenito 04926d
allow postfix_pipe_t postfix_private_t:sock_file write;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_pipe_t postfix_spool_t:dir search;
Chris PeBenito 04926d
allow postfix_pipe_t postfix_spool_t:file rw_file_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
ifdef(`TODO',`
Chris PeBenito 04926d
optional_policy(`procmail.te', `
Chris PeBenito 04926d
domain_auto_trans(postfix_pipe_t, procmail_exec_t, procmail_t)
Chris PeBenito 04926d
')
Chris PeBenito 04926d
') dnl end TODO
Chris PeBenito 04926d
Chris PeBenito 04926d
########################################
Chris PeBenito 04926d
#
Chris PeBenito 04926d
# Postfix postdrop local policy
Chris PeBenito 04926d
#
Chris PeBenito 04926d
Chris PeBenito 04926d
# usually it does not need a UDP socket
Chris PeBenito 04926d
allow postfix_postdrop_t self:capability sys_resource;
Chris PeBenito 04926d
allow postfix_postdrop_t self:tcp_socket create;
Chris PeBenito 04926d
allow postfix_postdrop_t self:udp_socket create_socket_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_postdrop_t postfix_public_t:dir search;
Chris PeBenito 04926d
allow postfix_postdrop_t postfix_public_t:fifo_file rw_file_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_postdrop_t postfix_spool_maildrop_t:dir rw_dir_perms;
Chris PeBenito 04926d
allow postfix_postdrop_t postfix_spool_maildrop_t:file create_file_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
term_dontaudit_use_all_user_ptys(postfix_postdrop_t)
Chris PeBenito 04926d
term_dontaudit_use_all_user_ttys(postfix_postdrop_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
sysnet_dontaudit_read_config(postfix_postdrop_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
mta_rw_user_mail_stream_socket(postfix_postdrop_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
optional_policy(`crond.te',`
Chris PeBenito 04926d
	cron_use_fd(postfix_postdrop_t)
Chris PeBenito 04926d
	cron_rw_pipe(postfix_postdrop_t)
Chris PeBenito 04926d
	cron_use_system_job_fd(postfix_postdrop_t)
Chris PeBenito 04926d
	cron_rw_system_job_pipe(postfix_postdrop_t)
Chris PeBenito 04926d
')
Chris PeBenito 04926d
Chris PeBenito 04926d
#######################################
Chris PeBenito 04926d
#
Chris PeBenito 04926d
# Postfix postqueue local policy
Chris PeBenito 04926d
#
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_postqueue_t self:tcp_socket create;
Chris PeBenito 04926d
allow postfix_postqueue_t self:udp_socket { create ioctl };
Chris PeBenito 04926d
Chris PeBenito 04926d
# wants to write to /var/spool/postfix/public/showq
Chris PeBenito 04926d
allow postfix_postqueue_t postfix_public_t:sock_file rw_file_perms;
Chris PeBenito 04926d
allow postfix_postqueue_t postfix_master_t:unix_stream_socket connectto;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_postqueue_t postfix_public_t:dir search;
Chris PeBenito 04926d
# write to /var/spool/postfix/public/qmgr
Chris PeBenito 04926d
allow postfix_postqueue_t postfix_public_t:fifo_file { getattr write };
Chris PeBenito 04926d
Chris PeBenito 04926d
domain_auto_trans(postfix_master_t, postfix_postqueue_exec_t, postfix_postqueue_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
# to write the mailq output, it really should not need read access!
Chris PeBenito 04926d
term_use_all_user_ptys(postfix_showq_t)
Chris PeBenito 04926d
term_use_all_user_ttys(postfix_showq_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
init_sigchld_script(postfix_postqueue_t)
Chris PeBenito 04926d
init_use_script_fd(postfix_postqueue_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
sysnet_dontaudit_read_config(postfix_postqueue_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
ifdef(`TODO',`
Chris PeBenito 04926d
optional_policy(`gnome-pty-helper.te', `allow postfix_postqueue_t user_gph_t:fd use;')
Chris PeBenito 04926d
')
Chris PeBenito 04926d
Chris PeBenito 04926d
########################################
Chris PeBenito 04926d
#
Chris PeBenito 04926d
# Postfix qmgr local policy
Chris PeBenito 04926d
#
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_qmgr_t postfix_master_t:unix_stream_socket connectto;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_qmgr_t postfix_private_t:dir search;
Chris PeBenito 04926d
allow postfix_qmgr_t postfix_private_t:sock_file rw_file_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_qmgr_t postfix_public_t:fifo_file rw_file_perms;
Chris PeBenito 04926d
allow postfix_qmgr_t postfix_public_t:sock_file write;
Chris PeBenito 04926d
Chris PeBenito 04926d
# for /var/spool/postfix/active
Chris PeBenito 04926d
allow postfix_qmgr_t postfix_spool_t:dir create_dir_perms;
Chris PeBenito 04926d
allow postfix_qmgr_t postfix_spool_t:file create_file_perms;
Chris PeBenito 04926d
allow postfix_qmgr_t postfix_spool_t:lnk_file create_lnk_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_qmgr_t postfix_spool_bounce_t:dir { getattr read search };
Chris PeBenito 04926d
allow postfix_qmgr_t postfix_spool_bounce_t:file { read getattr };
Chris PeBenito 04926d
allow postfix_qmgr_t postfix_spool_bounce_t:lnk_file { getattr read };
Chris PeBenito 04926d
Chris PeBenito 04926d
########################################
Chris PeBenito 04926d
#
Chris PeBenito 04926d
# Postfix showq local policy
Chris PeBenito 04926d
#
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_showq_t self:capability { setuid setgid };
Chris PeBenito 04926d
allow postfix_showq_t self:tcp_socket create_socket_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
domain_auto_trans(postfix_postqueue_t, postfix_showq_exec_t, postfix_showq_t)
Chris PeBenito 04926d
# the following auto_trans is usually in postfix server domain
Chris PeBenito 04926d
domain_auto_trans(postfix_master_t, postfix_showq_exec_t, postfix_showq_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_showq_t postfix_master_t:unix_stream_socket { accept rw_socket_perms };
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_showq_t postfix_spool_t:file r_file_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_showq_t postfix_spool_maildrop_t:dir { getattr read search };
Chris PeBenito 04926d
allow postfix_showq_t postfix_spool_maildrop_t:file { read getattr };
Chris PeBenito 04926d
allow postfix_showq_t postfix_spool_maildrop_t:lnk_file { getattr read };
Chris PeBenito 04926d
Chris PeBenito 04926d
term_use_all_user_ptys(postfix_showq_t)
Chris PeBenito 04926d
term_use_all_user_ttys(postfix_showq_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
sysnet_dns_name_resolve(postfix_showq_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
########################################
Chris PeBenito 04926d
#
Chris PeBenito 04926d
# Postfix smtp delivery local policy
Chris PeBenito 04926d
#
Chris PeBenito 04926d
Chris PeBenito 04926d
# connect to master process
Chris PeBenito 04926d
allow postfix_smtp_t postfix_master_t:unix_stream_socket connectto;
Chris PeBenito 04926d
allow postfix_smtp_t { postfix_private_t postfix_public_t }:dir search;
Chris PeBenito 04926d
allow postfix_smtp_t { postfix_private_t postfix_public_t }:sock_file write;
Chris PeBenito 04926d
Chris PeBenito 04926d
allow postfix_smtp_t postfix_spool_t:file rw_file_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
kernel_tcp_recvfrom(postfix_smtp_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
# if you have two different mail servers on the same host let them talk via
Chris PeBenito 04926d
# SMTP, also if one mail server wants to talk to itself then allow it and let
Chris PeBenito 04926d
# the SMTP protocol sort it out (SE Linux is not to prevent mail server
Chris PeBenito 04926d
# misconfiguration)
Chris PeBenito 04926d
mta_tcp_connect_all_mailservers(postfix_smtp_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
########################################
Chris PeBenito 04926d
#
Chris PeBenito 04926d
# Postfix smtpd local policy
Chris PeBenito 04926d
#
Chris PeBenito 04926d
allow postfix_smtpd_t postfix_master_t:tcp_socket rw_stream_socket_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
# connect to master process
Chris PeBenito 04926d
allow postfix_smtpd_t postfix_master_t:unix_stream_socket connectto;
Chris PeBenito 04926d
allow postfix_smtpd_t { postfix_private_t postfix_public_t }:dir search;
Chris PeBenito 04926d
allow postfix_smtpd_t { postfix_private_t postfix_public_t }:sock_file rw_file_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
# for prng_exch
Chris PeBenito 04926d
allow postfix_smtpd_t postfix_spool_t:file rw_file_perms;
Chris PeBenito 04926d
allow { postfix_smtp_t postfix_smtpd_t } postfix_prng_t:file rw_file_perms;
Chris PeBenito 04926d
Chris PeBenito 04926d
# for OpenSSL certificates
Chris PeBenito 04926d
files_read_usr_files(postfix_smtpd_t)
Chris PeBenito 04926d
mta_read_aliases(postfix_smtpd_t)
Chris PeBenito 04926d
Chris PeBenito 04926d
optional_policy(`sasl.te',`
Chris PeBenito 04926d
	sasl_connect(postfix_smtpd_t)
Chris PeBenito 04926d
')