| name | cis-apache24-4.2 |
| description | Ensure Appropriate Access to Web Content Is Allowed |
| category | cis-apache |
| version | 2.3.0 |
| author | cyberstrike-official |
| tags | ["cis","apache","linux","access-control"] |
| cis_id | 4.2 |
| cis_benchmark | CIS Apache HTTP Server 2.4 Benchmark v2.3.0 |
| tech_stack | ["linux","apache"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
4.2 Ensure Appropriate Access to Web Content Is Allowed
Profile Applicability
Description
In order to serve Web content, either the Apache Allow directive or the Require directive will need to be used to allow for appropriate access to directories, locations and virtual hosts that contain web content.
Rationale
Either the Allow or Require directives may be used within a directory, a location or other context to allow appropriate access. Access may be allowed to all, or to specific networks, or hosts, or users as appropriate. The Allow/Deny/Order directives are deprecated and should be replaced by the Require directive. It is also recommended that either the Allow directive or the Require directive be used, but not both in the same context.
Audit
Perform the following to determine if the recommended state is implemented:
- Search the Apache configuration files (
httpd.conf and any included configuration files) to find all <Directory> and <Location> elements.
- Ensure that either one of the following two methods are configured:
Use the deprecated Order/Deny/Allow method:
- Ensure there is a single
Order directive with the value of Deny,Allow for each.
- Ensure the
Allow and Deny directives, have values that are appropriate for the purposes of the directory.
Use the Require method:
- Ensure that the
Order/Deny/Allow directives are NOT used for the directory.
- Ensure the Require directives have values that are appropriate for the purposes of the directory.
The following command may be useful to extract <Directory> and <Location> elements and Allow directives from the Apache configuration files.
$APACHE_PREFIX/conf/httpd.conf $APACHE_PREFIX/conf.d/*.conf
/conf/httpd.conf /conf.d/*.conf
/conf.d/*.conf