Check: NGNX-APP-000730
F5 NGINX STIG:
NGNX-APP-000730
(in version v1 r1)
Title
NGINX, when using PKI-based authentication, must enforce authorized access to the corresponding private key. (Cat II impact)
Discussion
If the private key is discovered, an attacker can use the key to authenticate as an authorized user and gain access to the network infrastructure. The cornerstone of the PKI is the private key used to encrypt or digitally sign information. If the private key is stolen, this will lead to the compromise of the authentication and nonrepudiation gained through PKI because the attacker can use the private key to digitally sign documents and pretend to be the authorized user. Both the holders of a digital certificate and the issuing authority must protect the computers, storage devices, or whatever they use to store private keys.
Check Content
Determine the path to NGINX config file: 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. cat <path to config> Verify that private key(s) are only readable by the owner. Example: root@e4a935153ece:/etc/ssl/nginx# nginx -qT | grep certificate_key ssl_certificate_key /etc/ssl/nginx/server.key; root@e4a935153ece:/etc/ssl/nginx# ls -la /etc/ssl/nginx/server.key -rw------- 1 root root 1704 Dec 4 18:31 /etc/ssl/nginx/server.key If the private key(s) are readable anyone other than owner, this is a finding.
Fix Text
Change permissions on any TLS keys used in NGINX configuration: nginx -qT | grep certificate_key chmod 600 <path to TLS key> Example: root@e4a935153ece:/etc/ssl/nginx# nginx -qT | grep certificate_key ssl_certificate_key /etc/ssl/nginx/server.key; root@e4a935153ece:/etc/ssl/nginx# chmod 600 /etc/ssl/nginx/server.key Restart NGINX: nginx -s reload
Additional Identifiers
Rule ID: SV-278392r1171928_rule
Vulnerability ID: V-278392
Group Title: SRG-APP-000176
Expert Comments
CCIs
| Number | Definition |
|---|---|
| CCI-000186 |
For public key-based authentication, enforce authorized access to the corresponding private key. |
Controls
| Number | Title |
|---|---|
| IA-5(2) |
Public Key-based Authentication |