| name | cis-ubuntu1604-v200-2-1-15 |
| description | Ensure mail transfer agent is configured for local-only mode |
| category | cis-networking |
| version | 2.0.0 |
| author | cyberstrike-official |
| tags | ["cis","ubuntu","linux","ubuntu-16.04","services"] |
| cis_id | 2.1.15 |
| cis_benchmark | CIS Ubuntu Linux 16.04 LTS Benchmark v2.0.0 |
| tech_stack | ["ubuntu","linux"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
2.1.15 Ensure mail transfer agent is configured for local-only mode (Automated)
Description
Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail.
Note: This recommendation is designed around the exim4 mail server, depending on your environment you may have an alternative MTA installed such as sendmail. If this is the case consult the documentation for your installed MTA to configure the recommended state.
Rationale
The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems.
Audit Procedure
Command Line
Run the following command to verify that the MTA is not listening on any non-loopback address (127.0.0.1 or ::1). Nothing should be returned:
ss -lntu | grep -E ':25\s' | grep -E -v '\s(127.0.0.1|::1):25\s'
Expected Result
Nothing should be returned. If output is produced, the MTA is listening on a non-loopback address.
Remediation
Command Line
Edit /etc/exim4/update-exim4.conf.conf and add and or modify following lines to look like the lines below:
dc_eximconfig_configtype='local'
dc_local_interfaces='127.0.0.1 ; ::1'
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost=''
dc_use_split_config='false'
dc_hide_mailname=''
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'
Restart exim4:
systemctl restart exim4
Default Value
The MTA is configured for local-only mode on default installations.
References
- CIS Controls v7 - 9.2 Ensure Only Approved Ports, Protocols and Services Are Running
Profile
- Level 1 - Server
- Level 1 - Workstation