Disable Postfix Network Listening
An XCCDF Rule
Description
Edit the file /etc/postfix/main.cf
to ensure that only the following
inet_interfaces
line appears:
inet_interfaces =
Rationale
This ensures postfix
accepts mail messages
(such as cron job reports) from the local system only,
and not from the network, which protects it from network attack.
- ID
- xccdf_org.ssgproject.content_rule_postfix_network_listening_disabled
- Severity
- Medium
- References
- Updated
Remediation - Shell Script
# Remediation is applicable only in certain platforms
if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ] && { dpkg-query --show --showformat='${db:Status-Status}\n' 'postfix' 2>/dev/null | grep -q installed; }; then
var_postfix_inet_interfaces='<xccdf-1.2:sub xmlns:xccdf-1.2="http://checklists.nist.gov/xccdf/1.2" idref="xccdf_org.ssgproject.content_value_var_postfix_inet_interfaces" use="legacy"/>'