| name | cis-apache-4.3 |
| description | Ensure OverRide Is Disabled for the OS Root Directory |
| category | cis-apache |
| version | 3.6.0 |
| author | cyberstrike-official |
| tags | ["cis","apache","linux","access-control","directory"] |
| cis_id | 4.3 |
| cis_benchmark | CIS Apache HTTP Server 2.2 Benchmark v3.6.0 |
| tech_stack | ["linux","apache"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
Ensure OverRide Is Disabled for the OS Root Directory
Description
The Apache OverRide directive allows for .htaccess files to be used to override much of the configuration, including authentication, handling of document types, auto generated indexes, access control, and options. When the server finds an .htaccess file (as specified by AccessFileName), it needs to know which directives declared in that file can override earlier access information. When this directive is set to None, .htaccess files are completely ignored. When this directive is set to All, any directive which has the .htaccess Context is allowed in .htaccess files. Refer to the Apache 2.2 documentation for details http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride.
Rationale
While the functionality of htaccess files is sometimes convenient, usage decentralizes the access controls and increases the risk of configurations being changed or viewed inappropriately by an unintended or rogue .htaccess file. Consider also that some of the more common vulnerabilities in web servers and web applications allow the web files to be viewed or to be modified; this is why it is wise to keep the configuration of the web server from being placed in .htaccess files.
Impact
None documented
Audit Procedure
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 a root element.
- Ensure there is a single
AllowOverride directive with the value of None.
The following may be useful for extracting root directory elements from the Apache configuration for auditing:
$ perl -ne 'print if /^ *<Directory *\*\/\//i .. /<\/Directory/i'
$APACHE_PREFIX/conf/httpd.conf
Remediation
Perform the following to implement the recommended state:
- Search the Apache configuration files (
httpd.conf and any included configuration files) to find a root <Directory> element.
- Add a single
AllowOverride directive if there is none.
- Set the value for to None.