puppet: Restrict postfix incoming addresses to postmaster and zulip.

This removes the possibility of local user enumeration via RCPT TO.
This commit is contained in:
Alex Vandiver
2020-09-11 17:44:45 -07:00
committed by Alex Vandiver
parent ed8796f23f
commit 1c17583ad5
4 changed files with 24 additions and 3 deletions

View File

@@ -0,0 +1,9 @@
# This is the list of email addresses that are accepted via SMTP;
# these consist of only the addresses in `virtual`, as well as the
# RFC822-specified postmaster.
/\+.*@/ OK
/\..*@/ OK
/^mm/ OK
/^postmaster@/ OK

View File

@@ -1,3 +1,6 @@
/\+.*@/ zulip@localhost
/\..*@/ zulip@localhost
/^mm/ zulip@localhost
# Changes to this list require a corresponding change to `access` as
# well.
/\+.*@/ zulip@localhost
/\..*@/ zulip@localhost
/^mm/ zulip@localhost

View File

@@ -67,4 +67,12 @@ class zulip::postfix_localmail {
],
}
file {'/etc/postfix/access':
ensure => file,
mode => '0644',
owner => root,
group => root,
source => 'puppet:///modules/zulip/postfix/access',
require => Package[postfix],
}
}

View File

@@ -16,6 +16,7 @@ smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
smtpd_recipient_restrictions = check_recipient_access regexp:/etc/postfix/access, reject
myhostname = <%= @fqdn %>
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases