2.5.1 Ensure server_tokens directive is set to `off`

Information

The server_tokens directive is responsible for displaying the NGINX version number and operating system version on error pages and in the Server HTTP response header field. This information should not be displayed.

Attackers can conduct reconnaissance on a website using these response headers, then target attacks for specific known vulnerabilities associated with the underlying technologies. Hiding the version will slow down and deter some potential attackers.

Solution

Disable version disclosure globally by adding the directive to the http block in /etc/nginx/nginx.conf :

http {
...
server_tokens off;
...
}

Impact:

None. Disabling server tokens does not affect functionality. It merely removes the version string from error pages and headers. Note that determined attackers can still fingerprint NGINX via other methods, but removing the banner raises the bar for opportunistic scanners.

See Also

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

Item Details

Category: SYSTEM AND SERVICES ACQUISITION

References: 800-53|SA-3, CSCv7|18.1

Plugin: Unix

Control ID: 56cc2ecc6d83dbaf34a0b8d771a7fb0b2a834b3c7bd2c83eddef5ec2ebc87179