2.5.3 Ensure hidden file serving is disabled

Warning! Audit Deprecated

This audit has been deprecated and will be removed in a future update.

View Next Audit Version

Information

Disabling hidden files is a defense-in-depth mechanism to help prevent accidentally exposing sensitive information.

Rationale:

Disabling hidden files prevents an attacker from being able to reference a hidden file that may be put in your location and have sensitive information, like .git files.

Solution

Edit the 'nginx.conf' file and add the following line:

location ~ /. { deny all; return 404; }

See Also

https://workbench.cisecurity.org/files/2275