1. Home
  2. Security Hardening
  3. CIS Apache HTTP Server 2.2 L1 V3 6.0 Middleware
  4. Ensure Access to OS Root Directory Is Denied By Default – ‘httpd.conf Require all denied

Ensure Access to OS Root Directory Is Denied By Default – ‘httpd.conf Require all denied

Details

The Apache ‘Directory’ directive allows for directory-specific configuration of access controls and many other features and options. One important usage is to create a default deny policy that does not allow access to OS directories and files, except for those specifically allowed. This is done by denying access to the OS root directory.

Rationale:

One aspect of Apache that is occasionally misunderstood is the feature of default access. That is, unless you take steps to change it, if the server can find its way to a file through normal URL mapping rules, it can and will serve it to clients. Having a default deny helps prevent unintended access. The Order directive is important as it provides for other Allow directives to override the default deny.

Solution

Perform the following to implement the recommended state:

1. Search the Apache configuration files (‘httpd.conf’ and any included configuration files) to find a root ‘‘ element.
2. Have a single ‘Order’ directive and set its value to ‘deny, allow’.
3. Have a ‘Deny’ directive and set its value to ‘from all’.
4. Remove all ‘Allow’ directives from the root ‘‘ element.

. . .
Order deny,allow
Deny from all
. . .

Supportive Information

The following resource is also helpful.

This security hardening control applies to the following category of controls within NIST 800-53: Access Control.This control applies to the following type of system Unix.

References

Source

Updated on July 16, 2022
Was this article helpful?

Related Articles