4510-nginx-accesslog-Ensure NGINX Access Logging is Enabled
Rule ID
Category
Level
Compatible Versions
Description
- Every core site should have the access_log directive. It is enabled by default.
Scan Frequency
Rationale
- Access logging allows incident responders and auditors to investigate system access when an incident occurs.
Risk Item
Audit Method
- Execute the following command to verify:
grep -ir access_log /etc/nginx
# Output should be
access_log /var/log/nginx/host.access.log main;
# If the output is as follows, disable it and add a log path instead
access_log off;
- Edit the file /etc/nginx/nginx.conf. Example:
access_log /var/log/nginx/host.access.log main;
Impact
Default Value
- By default, access logging is enabled.
References
CIS Controls