Ensure the IP Addresses for Listening for Requests Are Specified (Automated)
Profile Applicability
Level 2
Description
The Apache Listen directive specifies the IP addresses and port numbers the Apache web server will listen for requests. Rather than be unrestricted to listen on all IP addresses available to the system, the specific IP address or addresses intended should be explicitly specified. Specifically, a Listen directive with no IP address specified, or with an IP address of zeros should not be used.
Rationale
Having multiple interfaces on web servers is fairly common, and without explicit Listen directives, the web server is likely to be listening on an inappropriate IP address / interface that was not intended for the web server. Single homed system with a single IP addressed are also required to have an explicit IP address in the Listen directive, in case additional interfaces are added to the system at a later date.
Audit Procedure
Perform the following steps to determine if the recommended state is implemented:
Verify that no Listen directives are in the Apache configuration file with no IP address specified, or with an IP address of all zeros.
Remediation
Perform the following to implement the recommended state:
Find any Listen directives in the Apache configuration file with no IP address specified, or with an IP addresses of all zeros similar to the examples below. Keep in mind there may be both IPv4 and IPv6 addresses on the system.
Listen 80
Listen 0.0.0.0:80
Listen [::ffff:0.0.0.0]:80
Modify the Listen directives in the Apache configuration file to have explicit IP addresses according to the intended usage. Multiple Listen directives may be specified for each IP address & Port.
Listen 10.1.2.3:80
Listen 192.168.4.5:80
Listen [2001:db8::a00:20ff:fea7:ccea]:80
Default Value
Listen 80
References
- https://httpd.apache.org/docs/2.4/mod/mpm_common.html#listen
CIS Controls
v8:
- 2.7 Allowlist Authorized Scripts
- Use technical controls, such as digital signatures and version control, to ensure that only authorized scripts, such as specific .ps1, .py, etc., files, are allowed to execute. Block unauthorized scripts from executing. Reassess bi-annually, or more frequently.
v7:
- 9.2 Ensure Only Approved Ports, Protocols and Services Are Running
- Ensure that only network ports, protocols, and services listening on a system with validated business needs, are running on each system.
1---2name: cis-apache24-5-153description: Ensure the IP Addresses for Listening for Requests Are Specified4---56# Ensure the IP Addresses for Listening for Requests Are Specified (Automated)78## Profile Applicability910Level 21112## Description1314The Apache `Listen` directive specifies the IP addresses and port numbers the Apache web server will listen for requests. Rather than be unrestricted to listen on all IP addresses available to the system, the specific IP address or addresses intended should be explicitly specified. Specifically, a `Listen` directive with no IP address specified, or with an IP address of zeros should not be used.1516## Rationale1718Having multiple interfaces on web servers is fairly common, and without explicit `Listen` directives, the web server is likely to be listening on an inappropriate IP address / interface that was not intended for the web server. Single homed system with a single IP addressed are also required to have an explicit IP address in the `Listen` directive, in case additional interfaces are added to the system at a later date.1920## Audit Procedure2122Perform the following steps to determine if the recommended state is implemented:2324Verify that no `Listen` directives are in the Apache configuration file with no IP address specified, or with an IP address of all zeros.2526## Remediation2728Perform the following to implement the recommended state:29301. Find any `Listen` directives in the Apache configuration file with no IP address specified, or with an IP addresses of all zeros similar to the examples below. Keep in mind there may be both IPv4 and IPv6 addresses on the system.3132 ```33 Listen 8034 Listen 0.0.0.0:8035 Listen [::ffff:0.0.0.0]:8036 ```37382. Modify the `Listen` directives in the Apache configuration file to have explicit IP addresses according to the intended usage. Multiple `Listen` directives may be specified for each IP address & Port.39 ```40 Listen 10.1.2.3:8041 Listen 192.168.4.5:8042 Listen [2001:db8::a00:20ff:fea7:ccea]:8043 ```4445## Default Value4647`Listen 80`4849## References50511. https://httpd.apache.org/docs/2.4/mod/mpm_common.html#listen5253## CIS Controls5455**v8:**5657- 2.7 Allowlist Authorized Scripts58 - Use technical controls, such as digital signatures and version control, to ensure that only authorized scripts, such as specific .ps1, .py, etc., files, are allowed to execute. Block unauthorized scripts from executing. Reassess bi-annually, or more frequently.5960**v7:**6162- 9.2 Ensure Only Approved Ports, Protocols and Services Are Running63 - Ensure that only network ports, protocols, and services listening on a system with validated business needs, are running on each system.