Check: NGNX-APP-000400
F5 NGINX STIG:
NGNX-APP-000400
(in version v1 r1)
Title
NGINX must protect audit information from unauthorized access. (Cat II impact)
Discussion
If audit data were to become compromised, then competent forensic analysis and discovery of the true source of potentially malicious system activity is difficult if not impossible to achieve. In addition, access to audit records provides information an attacker could potentially use to their advantage. To ensure the veracity of audit data, the information system and/or the application must protect audit information from any and all unauthorized access. This includes read, write, and copy access. This requirement can be achieved through multiple methods, which will depend upon system architecture and design. Commonly employed methods for protecting audit information include least privilege permissions as well as restricting the location and number of log file repositories. Additionally, applications with user interfaces to audit records must not allow for the unfettered manipulation of or access to those records via the application. If the application provides access to the audit data, the application becomes accountable for ensuring audit information is protected from unauthorized access. Audit information includes all information (e.g., audit records, audit settings, and audit reports) needed to successfully audit information system activity. Satisfies: SRG-APP-000118, SRG-APP-000119, SRG-APP-000120, SRG-APP-000121, SRG-APP-000122, SRG-APP-000123, SRG-APP-000267
Check Content
Determine the path to NGINX config file(s): nginx -qT | grep "# configuration" # configuration file /etc/nginx/nginx.conf: Note: The default NGINX configuration is "/etc/nginx/nginx.conf", though various files may also be included. Determine the location of the access and error logs: grep "_log" <path to config> Determine the permissions for the log files: ls -la <path to error.log> -rw-r--r-- 1 root root 0 May 23 15:04 /var/log/nginx/error.log ls -la <path to access.log> -rw-r--r-- 1 root root 0 May 23 15:04 /var/log/nginx/access.log If files have write permissions for anyone other than the owner, this is a finding.
Fix Text
Determine the path to NGINX config file(s): nginx -qT | grep "# configuration" # configuration file /etc/nginx/nginx.conf: Note: The default NGINX configuration is "/etc/nginx/nginx.conf", though various files may also be included. Determine the location of the access and error logs: grep "_log" <path to config> Set appropriate permissions for the log files: chmod 644 <path to error.log> chmod 644 <path to access.log>
Additional Identifiers
Rule ID: SV-278388r1171916_rule
Vulnerability ID: V-278388
Group Title: SRG-APP-000118
Expert Comments
CCIs
| Number | Definition |
|---|---|
| CCI-000162 |
Protect audit information from unauthorized access. |
| CCI-000163 |
Protect audit information from unauthorized modification. |
| CCI-000164 |
Protect audit information from unauthorized deletion. |
| CCI-001314 |
Reveal error messages only to organization-defined personnel or roles. |
| CCI-001493 |
Protect audit tools from unauthorized access. |
| CCI-001494 |
Protect audit tools from unauthorized modification. |
| CCI-001495 |
Protect audit tools from unauthorized deletion. |