Chris PeBenito 0fbfa5
#DESC Postfix - Mail server
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# Author:  Russell Coker <russell@coker.com.au>
Chris PeBenito 0fbfa5
# X-Debian-Packages: postfix
Chris PeBenito 0fbfa5
# Depends: mta.te
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Type for files created during execution of postfix.
Chris PeBenito 0fbfa5
type postfix_var_run_t, file_type, sysadmfile, pidfile;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
type postfix_etc_t, file_type, sysadmfile;
Chris PeBenito 0fbfa5
typealias postfix_etc_t alias etc_postfix_t;
Chris PeBenito 0fbfa5
type postfix_exec_t, file_type, sysadmfile, exec_type;
Chris PeBenito 0fbfa5
type postfix_public_t, file_type, sysadmfile;
Chris PeBenito 0fbfa5
type postfix_private_t, file_type, sysadmfile;
Chris PeBenito 0fbfa5
type postfix_spool_t, file_type, sysadmfile;
Chris PeBenito 0fbfa5
type postfix_spool_maildrop_t, file_type, sysadmfile;
Chris PeBenito 0fbfa5
type postfix_spool_flush_t, file_type, sysadmfile;
Chris PeBenito 0fbfa5
type postfix_prng_t, file_type, sysadmfile;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# postfix needs this for newaliases
Chris PeBenito 0fbfa5
allow { system_mail_t sysadm_mail_t } tmp_t:dir getattr;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
#################################
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# Rules for the postfix_$1_t domain.
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# postfix_$1_exec_t is the type of the postfix_$1 executables.
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
define(`postfix_domain', `
Chris PeBenito 0fbfa5
daemon_core_rules(postfix_$1, `$2')
Chris PeBenito 0fbfa5
allow postfix_$1_t self:process setpgid;
Chris PeBenito 0fbfa5
allow postfix_$1_t postfix_master_t:process sigchld;
Chris PeBenito 0fbfa5
allow postfix_master_t postfix_$1_t:process signal;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow postfix_$1_t { etc_t postfix_etc_t postfix_spool_t }:dir r_dir_perms;
Chris PeBenito 0fbfa5
allow postfix_$1_t postfix_etc_t:file r_file_perms;
Chris PeBenito 0fbfa5
read_locale(postfix_$1_t)
Chris PeBenito 0fbfa5
allow postfix_$1_t etc_t:file { getattr read };
Chris PeBenito 0fbfa5
allow postfix_$1_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 0fbfa5
allow postfix_$1_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 0fbfa5
allow postfix_$1_t self:unix_stream_socket connectto;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow postfix_$1_t { sbin_t bin_t }:dir r_dir_perms;
Chris PeBenito 0fbfa5
allow postfix_$1_t { bin_t usr_t }:lnk_file { getattr read };
Chris PeBenito 0fbfa5
allow postfix_$1_t shell_exec_t:file rx_file_perms;
Chris PeBenito 0fbfa5
allow postfix_$1_t { var_t var_spool_t }:dir { search getattr };
Chris PeBenito 0fbfa5
allow postfix_$1_t postfix_exec_t:file rx_file_perms;
Chris PeBenito 0fbfa5
allow postfix_$1_t devtty_t:chr_file rw_file_perms;
Chris PeBenito 0fbfa5
allow postfix_$1_t etc_runtime_t:file r_file_perms;
Chris PeBenito 0fbfa5
allow postfix_$1_t proc_t:dir r_dir_perms;
Chris PeBenito 0fbfa5
allow postfix_$1_t proc_t:file r_file_perms;
Chris PeBenito 0fbfa5
allow postfix_$1_t postfix_exec_t:dir r_dir_perms;
Chris PeBenito 0fbfa5
allow postfix_$1_t fs_t:filesystem getattr;
Chris PeBenito 0fbfa5
allow postfix_$1_t proc_net_t:dir search;
Chris PeBenito 0fbfa5
allow postfix_$1_t proc_net_t:file { getattr read };
Chris PeBenito 0fbfa5
can_exec(postfix_$1_t, postfix_$1_exec_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow postfix_$1_t tmp_t:dir getattr;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
file_type_auto_trans(postfix_$1_t, var_run_t, postfix_var_run_t, file)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
read_sysctl(postfix_$1_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
')dnl end postfix_domain
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
ifdef(`crond.te',
Chris PeBenito 0fbfa5
`allow system_mail_t crond_t:tcp_socket { read write create };')
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
postfix_domain(master, `, mail_server_domain')
Chris PeBenito 0fbfa5
rhgb_domain(postfix_master_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
read_sysctl(postfix_master_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
domain_auto_trans(initrc_t, postfix_master_exec_t, postfix_master_t)
Chris PeBenito 0fbfa5
allow initrc_t postfix_master_t:process { noatsecure siginh rlimitinh };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
ifdef(`direct_sysadm_daemon', `
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
domain_auto_trans(sysadm_t, postfix_master_exec_t, postfix_master_t)
Chris PeBenito 0fbfa5
allow sysadm_t postfix_master_t:process { noatsecure siginh rlimitinh };
Chris PeBenito 0fbfa5
role_transition sysadm_r postfix_master_exec_t system_r;
Chris PeBenito 0fbfa5
allow postfix_master_t postfix_etc_t:file rw_file_perms;
Chris PeBenito 0fbfa5
dontaudit postfix_master_t admin_tty_type:chr_file { read write };
Chris PeBenito 0fbfa5
allow postfix_master_t devpts_t:dir search;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
domain_auto_trans(sysadm_mail_t, postfix_master_exec_t, system_mail_t)
Chris PeBenito 0fbfa5
allow system_mail_t sysadm_t:process sigchld;
Chris PeBenito 0fbfa5
allow system_mail_t privfd:fd use;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
')dnl end direct_sysadm_daemon
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow postfix_master_t privfd:fd use;
Chris PeBenito 0fbfa5
ifdef(`newrole.te', `allow postfix_master_t newrole_t:process sigchld;')
Chris PeBenito 0fbfa5
allow postfix_master_t initrc_devpts_t:chr_file rw_file_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# postfix does a "find" on startup for some reason - keep it quiet
Chris PeBenito 0fbfa5
dontaudit postfix_master_t selinux_config_t:dir search;
Chris PeBenito 0fbfa5
can_exec({ sysadm_mail_t system_mail_t }, postfix_master_exec_t)
Chris PeBenito 0fbfa5
ifdef(`distro_redhat', `
Chris PeBenito 0fbfa5
file_type_auto_trans({ sysadm_mail_t system_mail_t postfix_master_t }, postfix_etc_t, etc_aliases_t)
Chris PeBenito 0fbfa5
', `
Chris PeBenito 0fbfa5
file_type_auto_trans({ sysadm_mail_t system_mail_t }, etc_t, etc_aliases_t)
Chris PeBenito 0fbfa5
')
Chris PeBenito 0fbfa5
allow postfix_master_t sendmail_exec_t:file r_file_perms;
Chris PeBenito 0fbfa5
allow postfix_master_t sbin_t:lnk_file { getattr read };
Chris PeBenito 0fbfa5
ifdef(`pppd.te', `
Chris PeBenito 0fbfa5
domain_auto_trans(pppd_t, postfix_master_exec_t, postfix_master_t)
Chris PeBenito 0fbfa5
')
Chris PeBenito 0fbfa5
can_exec(postfix_master_t, { ls_exec_t sbin_t })
Chris PeBenito 0fbfa5
allow postfix_master_t self:fifo_file rw_file_perms;
Chris PeBenito 0fbfa5
allow postfix_master_t usr_t:file r_file_perms;
Chris PeBenito 0fbfa5
can_exec(postfix_master_t, { shell_exec_t bin_t postfix_exec_t })
Chris PeBenito 0fbfa5
# chown is to set the correct ownership of queue dirs
Chris PeBenito 0fbfa5
allow postfix_master_t self:capability { chown dac_override kill setgid setuid net_bind_service sys_tty_config };
Chris PeBenito 0fbfa5
allow postfix_master_t postfix_public_t:fifo_file create_file_perms;
Chris PeBenito 0fbfa5
allow postfix_master_t postfix_public_t:sock_file create_file_perms;
Chris PeBenito 0fbfa5
allow postfix_master_t postfix_public_t:dir rw_dir_perms;
Chris PeBenito 0fbfa5
allow postfix_master_t postfix_private_t:dir rw_dir_perms;
Chris PeBenito 0fbfa5
allow postfix_master_t postfix_private_t:sock_file create_file_perms;
Chris PeBenito 0fbfa5
allow postfix_master_t postfix_private_t:fifo_file create_file_perms;
Chris PeBenito 0fbfa5
can_network(postfix_master_t)
Chris PeBenito 0fbfa5
can_ypbind(postfix_master_t)
Chris PeBenito 0fbfa5
allow postfix_master_t smtp_port_t:tcp_socket name_bind;
Chris PeBenito 0fbfa5
allow postfix_master_t postfix_spool_maildrop_t:dir rw_dir_perms;
Chris PeBenito 0fbfa5
allow postfix_master_t postfix_spool_maildrop_t:file { unlink rename getattr };
Chris PeBenito 0fbfa5
allow postfix_master_t postfix_prng_t:file getattr;
Chris PeBenito 0fbfa5
allow postfix_master_t privfd:fd use;
Chris PeBenito 0fbfa5
allow postfix_master_t etc_aliases_t:file rw_file_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
ifdef(`saslauthd.te',`
Chris PeBenito 0fbfa5
allow postfix_smtpd_t saslauthd_var_run_t:dir { search getattr };
Chris PeBenito 0fbfa5
allow postfix_smtpd_t saslauthd_var_run_t:sock_file { read write };
Chris PeBenito 0fbfa5
can_unix_connect(postfix_smtpd_t,saslauthd_t)
Chris PeBenito 0fbfa5
')
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
create_dir_file(postfix_master_t, postfix_spool_flush_t)
Chris PeBenito 0fbfa5
allow postfix_master_t random_device_t:chr_file { read getattr };
Chris PeBenito 0fbfa5
allow postfix_master_t postfix_prng_t:file rw_file_perms;
Chris PeBenito 0fbfa5
# for ls to get the current context
Chris PeBenito 0fbfa5
allow postfix_master_t self:file { getattr read };
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# for SSP
Chris PeBenito 0fbfa5
allow postfix_master_t urandom_device_t:chr_file read;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# allow access to deferred queue and allow removing bogus incoming entries
Chris PeBenito 0fbfa5
allow postfix_master_t postfix_spool_t:dir create_dir_perms;
Chris PeBenito 0fbfa5
allow postfix_master_t postfix_spool_t:file create_file_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
dontaudit postfix_master_t man_t:dir search;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
define(`postfix_server_domain', `
Chris PeBenito 0fbfa5
postfix_domain($1, `$2')
Chris PeBenito 0fbfa5
domain_auto_trans(postfix_master_t, postfix_$1_exec_t, postfix_$1_t)
Chris PeBenito 0fbfa5
allow postfix_$1_t postfix_master_t:unix_stream_socket { connectto rw_stream_socket_perms };
Chris PeBenito 0fbfa5
allow postfix_$1_t self:capability { setuid setgid dac_override };
Chris PeBenito 0fbfa5
can_network_client(postfix_$1_t)
Chris PeBenito 0fbfa5
can_ypbind(postfix_$1_t)
Chris PeBenito 0fbfa5
')
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
postfix_server_domain(smtp, `, mail_server_sender')
Chris PeBenito 0fbfa5
allow postfix_smtp_t postfix_spool_t:file rw_file_perms;
Chris PeBenito 0fbfa5
allow postfix_smtp_t { postfix_private_t postfix_public_t }:dir search;
Chris PeBenito 0fbfa5
allow postfix_smtp_t { postfix_private_t postfix_public_t }:sock_file write;
Chris PeBenito 0fbfa5
allow postfix_smtp_t urandom_device_t:chr_file { getattr read };
Chris PeBenito 0fbfa5
allow postfix_smtp_t postfix_master_t:unix_stream_socket connectto;
Chris PeBenito 0fbfa5
# if you have two different mail servers on the same host let them talk via
Chris PeBenito 0fbfa5
# SMTP, also if one mail server wants to talk to itself then allow it and let
Chris PeBenito 0fbfa5
# the SMTP protocol sort it out (SE Linux is not to prevent mail server
Chris PeBenito 0fbfa5
# misconfiguration)
Chris PeBenito 0fbfa5
can_tcp_connect(postfix_smtp_t, mail_server_domain)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
postfix_server_domain(smtpd)
Chris PeBenito 0fbfa5
allow postfix_smtpd_t urandom_device_t:chr_file { getattr read };
Chris PeBenito 0fbfa5
allow postfix_smtpd_t postfix_master_t:tcp_socket rw_stream_socket_perms;
Chris PeBenito 0fbfa5
allow postfix_smtpd_t { postfix_private_t postfix_public_t }:dir search;
Chris PeBenito 0fbfa5
allow postfix_smtpd_t { postfix_private_t postfix_public_t }:sock_file rw_file_perms;
Chris PeBenito 0fbfa5
allow postfix_smtpd_t postfix_master_t:unix_stream_socket connectto;
Chris PeBenito 0fbfa5
# for OpenSSL certificates
Chris PeBenito 0fbfa5
r_dir_file(postfix_smtpd_t,usr_t)
Chris PeBenito 0fbfa5
allow postfix_smtpd_t etc_aliases_t:file r_file_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# for prng_exch
Chris PeBenito 0fbfa5
allow postfix_smtpd_t postfix_spool_t:file rw_file_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow { postfix_smtp_t postfix_smtpd_t } postfix_prng_t:file rw_file_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
postfix_server_domain(local, `, mta_delivery_agent')
Chris PeBenito 0fbfa5
ifdef(`procmail.te', `
Chris PeBenito 0fbfa5
domain_auto_trans(postfix_local_t, procmail_exec_t, procmail_t)
Chris PeBenito 0fbfa5
# for a bug in the postfix local program
Chris PeBenito 0fbfa5
dontaudit procmail_t postfix_local_t:tcp_socket { read write };
Chris PeBenito 0fbfa5
dontaudit procmail_t postfix_master_t:fd use;
Chris PeBenito 0fbfa5
')
Chris PeBenito 0fbfa5
allow postfix_local_t etc_aliases_t:file r_file_perms;
Chris PeBenito 0fbfa5
allow postfix_local_t self:fifo_file rw_file_perms;
Chris PeBenito 0fbfa5
allow postfix_local_t self:process setrlimit;
Chris PeBenito 0fbfa5
allow postfix_local_t postfix_spool_t:file rw_file_perms;
Chris PeBenito 0fbfa5
# for .forward - maybe we need a new type for it?
Chris PeBenito 0fbfa5
allow postfix_local_t postfix_private_t:dir search;
Chris PeBenito 0fbfa5
allow postfix_local_t postfix_private_t:sock_file rw_file_perms;
Chris PeBenito 0fbfa5
allow postfix_local_t postfix_master_t:unix_stream_socket connectto;
Chris PeBenito 0fbfa5
allow postfix_local_t postfix_public_t:dir search;
Chris PeBenito 0fbfa5
allow postfix_local_t postfix_public_t:sock_file write;
Chris PeBenito 0fbfa5
can_exec(postfix_local_t, shell_exec_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
define(`postfix_public_domain',`
Chris PeBenito 0fbfa5
postfix_server_domain($1)
Chris PeBenito 0fbfa5
allow postfix_$1_t postfix_public_t:dir search;
Chris PeBenito 0fbfa5
')
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
postfix_public_domain(cleanup)
Chris PeBenito 0fbfa5
create_dir_file(postfix_cleanup_t, postfix_spool_t)
Chris PeBenito 0fbfa5
allow postfix_cleanup_t postfix_public_t:fifo_file rw_file_perms;
Chris PeBenito 0fbfa5
allow postfix_cleanup_t postfix_public_t:sock_file { getattr write };
Chris PeBenito 0fbfa5
allow postfix_cleanup_t postfix_private_t:dir search;
Chris PeBenito 0fbfa5
allow postfix_cleanup_t postfix_private_t:sock_file rw_file_perms;
Chris PeBenito 0fbfa5
allow postfix_cleanup_t postfix_master_t:unix_stream_socket connectto;
Chris PeBenito 0fbfa5
allow postfix_cleanup_t postfix_spool_bounce_t:dir r_dir_perms;
Chris PeBenito 0fbfa5
allow postfix_cleanup_t self:process setrlimit;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
allow user_mail_domain postfix_spool_t:dir r_dir_perms;
Chris PeBenito 0fbfa5
allow user_mail_domain postfix_etc_t:dir r_dir_perms;
Chris PeBenito 0fbfa5
allow { user_mail_domain initrc_t } postfix_etc_t:file r_file_perms;
Chris PeBenito 0fbfa5
allow user_mail_domain self:capability dac_override;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
define(`postfix_user_domain', `
Chris PeBenito 0fbfa5
postfix_domain($1, `$2')
Chris PeBenito 0fbfa5
domain_auto_trans(user_mail_domain, postfix_$1_exec_t, postfix_$1_t)
Chris PeBenito 0fbfa5
in_user_role(postfix_$1_t)
Chris PeBenito 0fbfa5
role sysadm_r types postfix_$1_t;
Chris PeBenito 0fbfa5
allow postfix_$1_t userdomain:process sigchld;
Chris PeBenito 0fbfa5
allow postfix_$1_t userdomain:fifo_file { write getattr };
Chris PeBenito 0fbfa5
allow postfix_$1_t { userdomain privfd }:fd use;
Chris PeBenito 0fbfa5
allow postfix_$1_t self:capability dac_override;
Chris PeBenito 0fbfa5
')
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
postfix_user_domain(postqueue)
Chris PeBenito 0fbfa5
allow postfix_postqueue_t postfix_public_t:dir search;
Chris PeBenito 0fbfa5
allow postfix_postqueue_t postfix_public_t:fifo_file getattr;
Chris PeBenito 0fbfa5
allow postfix_postqueue_t self:udp_socket { create ioctl };
Chris PeBenito 0fbfa5
allow postfix_master_t postfix_postqueue_exec_t:file getattr;
Chris PeBenito 0fbfa5
domain_auto_trans(postfix_master_t, postfix_postqueue_exec_t, postfix_postqueue_t)
Chris PeBenito 0fbfa5
allow postfix_postqueue_t initrc_t:process sigchld;
Chris PeBenito 0fbfa5
allow postfix_postqueue_t initrc_t:fd use;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# to write the mailq output, it really should not need read access!
Chris PeBenito 0fbfa5
allow postfix_postqueue_t { ptyfile ttyfile }:chr_file { read write getattr };
Chris PeBenito 0fbfa5
ifdef(`gnome-pty-helper.te', `allow postfix_postqueue_t user_gph_t:fd use;')
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# wants to write to /var/spool/postfix/public/showq
Chris PeBenito 0fbfa5
allow postfix_postqueue_t postfix_public_t:sock_file rw_file_perms;
Chris PeBenito 0fbfa5
allow postfix_postqueue_t postfix_master_t:unix_stream_socket connectto;
Chris PeBenito 0fbfa5
# write to /var/spool/postfix/public/qmgr
Chris PeBenito 0fbfa5
allow postfix_postqueue_t postfix_public_t:fifo_file write;
Chris PeBenito 0fbfa5
dontaudit postfix_postqueue_t net_conf_t:file r_file_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
postfix_user_domain(showq)
Chris PeBenito 0fbfa5
# the following auto_trans is usually in postfix server domain
Chris PeBenito 0fbfa5
domain_auto_trans(postfix_master_t, postfix_showq_exec_t, postfix_showq_t)
Chris PeBenito 0fbfa5
allow postfix_showq_t self:udp_socket { create ioctl };
Chris PeBenito 0fbfa5
r_dir_file(postfix_showq_t, postfix_spool_maildrop_t)
Chris PeBenito 0fbfa5
domain_auto_trans(postfix_postqueue_t, postfix_showq_exec_t, postfix_showq_t)
Chris PeBenito 0fbfa5
allow postfix_showq_t self:capability { setuid setgid };
Chris PeBenito 0fbfa5
allow postfix_showq_t postfix_master_t:unix_stream_socket { accept rw_socket_perms };
Chris PeBenito 0fbfa5
allow postfix_showq_t postfix_spool_t:file r_file_perms;
Chris PeBenito 0fbfa5
allow postfix_showq_t self:tcp_socket create_socket_perms;
Chris PeBenito 0fbfa5
allow postfix_showq_t { ttyfile ptyfile }:chr_file { read write };
Chris PeBenito 0fbfa5
dontaudit postfix_showq_t net_conf_t:file r_file_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
postfix_user_domain(postdrop, `, mta_user_agent')
Chris PeBenito 0fbfa5
allow postfix_postdrop_t postfix_spool_maildrop_t:dir rw_dir_perms;
Chris PeBenito 0fbfa5
allow postfix_postdrop_t postfix_spool_maildrop_t:file create_file_perms;
Chris PeBenito 0fbfa5
allow postfix_postdrop_t user_mail_domain:unix_stream_socket rw_socket_perms;
Chris PeBenito 0fbfa5
allow postfix_postdrop_t postfix_public_t:dir search;
Chris PeBenito 0fbfa5
allow postfix_postdrop_t postfix_public_t:fifo_file rw_file_perms;
Chris PeBenito 0fbfa5
dontaudit postfix_postdrop_t { ptyfile ttyfile }:chr_file { read write };
Chris PeBenito 0fbfa5
dontaudit postfix_postdrop_t net_conf_t:file r_file_perms;
Chris PeBenito 0fbfa5
allow postfix_master_t postfix_postdrop_exec_t:file getattr;
Chris PeBenito 0fbfa5
ifdef(`crond.te',
Chris PeBenito 0fbfa5
`allow postfix_postdrop_t { crond_t system_crond_t }:fd use;
Chris PeBenito 0fbfa5
allow postfix_postdrop_t { crond_t system_crond_t }:fifo_file rw_file_perms;')
Chris PeBenito 0fbfa5
# usually it does not need a UDP socket
Chris PeBenito 0fbfa5
allow postfix_postdrop_t self:udp_socket create_socket_perms;
Chris PeBenito 0fbfa5
allow postfix_postdrop_t self:capability sys_resource;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
postfix_public_domain(pickup)
Chris PeBenito 0fbfa5
allow postfix_pickup_t postfix_public_t:fifo_file rw_file_perms;
Chris PeBenito 0fbfa5
allow postfix_pickup_t postfix_public_t:sock_file rw_file_perms;
Chris PeBenito 0fbfa5
allow postfix_pickup_t postfix_private_t:dir search;
Chris PeBenito 0fbfa5
allow postfix_pickup_t postfix_private_t:sock_file write;
Chris PeBenito 0fbfa5
allow postfix_pickup_t postfix_master_t:unix_stream_socket connectto;
Chris PeBenito 0fbfa5
allow postfix_pickup_t postfix_spool_maildrop_t:dir rw_dir_perms;
Chris PeBenito 0fbfa5
allow postfix_pickup_t postfix_spool_maildrop_t:file r_file_perms;
Chris PeBenito 0fbfa5
allow postfix_pickup_t postfix_spool_maildrop_t:file unlink;
Chris PeBenito 0fbfa5
allow postfix_pickup_t self:tcp_socket create_socket_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
postfix_public_domain(qmgr)
Chris PeBenito 0fbfa5
allow postfix_qmgr_t postfix_public_t:fifo_file rw_file_perms;
Chris PeBenito 0fbfa5
allow postfix_qmgr_t postfix_public_t:sock_file write;
Chris PeBenito 0fbfa5
allow postfix_qmgr_t postfix_private_t:dir search;
Chris PeBenito 0fbfa5
allow postfix_qmgr_t postfix_private_t:sock_file rw_file_perms;
Chris PeBenito 0fbfa5
allow postfix_qmgr_t postfix_master_t:unix_stream_socket connectto;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# for /var/spool/postfix/active
Chris PeBenito 0fbfa5
create_dir_file(postfix_qmgr_t, postfix_spool_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
postfix_public_domain(bounce)
Chris PeBenito 0fbfa5
type postfix_spool_bounce_t, file_type, sysadmfile;
Chris PeBenito 0fbfa5
create_dir_file(postfix_bounce_t, postfix_spool_bounce_t)
Chris PeBenito 0fbfa5
create_dir_file(postfix_bounce_t, postfix_spool_t)
Chris PeBenito 0fbfa5
allow postfix_master_t postfix_spool_bounce_t:dir create_dir_perms;
Chris PeBenito 0fbfa5
allow postfix_master_t postfix_spool_bounce_t:file getattr;
Chris PeBenito 0fbfa5
allow postfix_bounce_t self:capability dac_read_search;
Chris PeBenito 0fbfa5
allow postfix_bounce_t postfix_public_t:sock_file write;
Chris PeBenito 0fbfa5
allow postfix_bounce_t self:tcp_socket create_socket_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
r_dir_file(postfix_qmgr_t, postfix_spool_bounce_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
postfix_public_domain(pipe)
Chris PeBenito 0fbfa5
allow postfix_pipe_t postfix_spool_t:dir search;
Chris PeBenito 0fbfa5
allow postfix_pipe_t postfix_spool_t:file rw_file_perms;
Chris PeBenito 0fbfa5
allow postfix_pipe_t self:fifo_file { read write };
Chris PeBenito 0fbfa5
allow postfix_pipe_t postfix_private_t:dir search;
Chris PeBenito 0fbfa5
allow postfix_pipe_t postfix_private_t:sock_file write;
Chris PeBenito 0fbfa5
ifdef(`procmail.te', `
Chris PeBenito 0fbfa5
domain_auto_trans(postfix_pipe_t, procmail_exec_t, procmail_t)
Chris PeBenito 0fbfa5
')
Chris PeBenito 0fbfa5
ifdef(`sendmail.te', `
Chris PeBenito 0fbfa5
allow sendmail_t postfix_etc_t:dir search;
Chris PeBenito 0fbfa5
')
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Program for creating database files
Chris PeBenito 0fbfa5
application_domain(postfix_map)
Chris PeBenito 0fbfa5
base_file_read_access(postfix_map_t)
Chris PeBenito 0fbfa5
allow postfix_map_t { etc_t etc_runtime_t }:{ file lnk_file } { getattr read };
Chris PeBenito 0fbfa5
tmp_domain(postfix_map)
Chris PeBenito 0fbfa5
create_dir_file(postfix_map_t, postfix_etc_t)
Chris PeBenito 0fbfa5
allow postfix_map_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 0fbfa5
dontaudit postfix_map_t proc_t:dir { getattr read search };
Chris PeBenito 0fbfa5
dontaudit postfix_map_t local_login_t:fd use;
Chris PeBenito 0fbfa5
allow postfix_master_t postfix_map_exec_t:file rx_file_perms;
Chris PeBenito 0fbfa5
read_locale(postfix_map_t)
Chris PeBenito 0fbfa5
allow postfix_map_t self:capability setgid;
Chris PeBenito 0fbfa5
allow postfix_map_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 0fbfa5
dontaudit postfix_map_t var_t:dir search;
Chris PeBenito 0fbfa5
can_network_server(postfix_map_t)
Chris PeBenito 0fbfa5
allow postfix_local_t mail_spool_t:dir { remove_name };
Chris PeBenito 0fbfa5
allow postfix_local_t mail_spool_t:file { unlink };