2.2.2 Ensure the NGINX service account is locked

Information

The NGINX service account must not have a usable password and should be explicitly locked in the system's shadow file to prevent direct login or password-based privilege escalation.

As a defense-in-depth measure, the NGINX service account should be explicitly locked. This prevents password-based logins and blocks adversaries from using the account for lateral movement, even if they manage to change the account's shell configuration.

In a properly hardened environment, there is no operational need for any user to log in as nginx . Administrative tasks requiring the NGINX identity should be performed using sudo (e.g., sudo -u nginx ), which utilizes the administrator's credentials rather than the service account's password.

Solution

Lock the account using the passwd command:

passwd -l nginx

(Replace nginx with the actual service user found in step 1)

Impact:

Locking the service account has minimal operational impact. The account is not intended for human interaction, and all administrative tasks requiring the NGINX user context should already be performed using sudo -u nginx rather than password-based authentication.

See Also

https://workbench.cisecurity.org/benchmarks/18528

Item Details

Category: ACCESS CONTROL, MEDIA PROTECTION

References: 800-53|AC-3, 800-53|AC-5, 800-53|AC-6, 800-53|MP-2, CSCv7|14.6

Plugin: Unix

Control ID: 9124f818f1b2b10de3f6bffe43f3e67215e032d87cb36dd8a48f157d3bcb8292