1. Home
  2. Security Hardening
  3. CIS Nginx Benchmark V1.0.0 L1 Webserver
  4. Ensure custom Diffie-Hellman parameters are used

Ensure custom Diffie-Hellman parameters are used

Details

Custom Diffie-Hellman (DH) key exchange parameters should be used. DH Ephemeral (DHE) parameters with at least 2048 bits should be generated.

Rationale:

Backward-compatible Perfect Forward Secrecy (PFS) ciphers (e.g. DHE-RSA-AES128-SHA256) should use strong and unique parameters. By default, NGINX will generate 1024-bit RSA keys for PFS ciphers; stronger alternatives should be used instead to provide better protection for data protected by encryption.

Solution

Generate strong DHE (Ephemeral Diffie-Hellman) parameters using the following commands:

mkdir /etc/nginx/ssl
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
chmod 400 /etc/nginx/ssl/dhparam.pem

Alter the server configuration to use the new parameters:

http {
server {
ssl_dhparam /etc/nginx/ssl/dhparam.pem;
}
}

Supportive Information

The following resource is also helpful.

This security hardening control applies to the following category of controls within NIST 800-53: System and Communications Protection.This control applies to the following type of system Unix.

References

Source

Updated on July 16, 2022
Was this article helpful?

Related Articles