Commit 420f2d54 by Kevin Falcone Committed by GitHub

Merge pull request #3794 from appsembler/morgan/robustify-nginx

Robustify TLS nginx settings
parents 18815cc8 298423fc
......@@ -33,6 +33,10 @@ NGINX_HTTPS_REDIRECT_STRATEGY: "scheme"
NGINX_SSL_CERTIFICATE: 'ssl-cert-snakeoil.pem'
NGINX_SSL_KEY: 'ssl-cert-snakeoil.key'
NGINX_SSL_CIPHERS: "'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA'"
NGINX_SSL_PROTOCOLS: "TLSv1 TLSv1.1 TLSv1.2"
NGINX_DH_PARAMS_PATH: "/etc/ssl/private/dhparams.pem"
NGINX_DH_KEYSIZE: 2048
NGINX_LOG_FORMAT_NAME: 'p_combined'
# When set to False, nginx will pass X-Forwarded-For, X-Forwarded-Port,
......
# requires:
# - common/tasks/main.yml
---
- name: Create Diffie-Hellman parameters to prevent weak key exchange
command: openssl dhparam -out "{{ NGINX_DH_PARAMS_PATH | basename }}" {{ NGINX_DH_KEYSIZE }}
args:
chdir: "{{ NGINX_DH_PARAMS_PATH | dirname }}"
creates: "{{ NGINX_DH_PARAMS_PATH }}"
tags:
- install
- install:configuration
- name: Restrict permissions of DH parameters file
file:
path: "{{ NGINX_DH_PARAMS_PATH }}"
owner: "root"
group: "root"
mode: 0600
tags:
- install
- install:configuration
- name: Create nginx app and data dirs
file:
path: "{{ item.path }}"
......
......@@ -45,6 +45,16 @@ http {
error_log {{ nginx_log_dir }}/error.log;
##
# SSL/TLS settings
##
ssl_protocols {{ NGINX_SSL_PROTOCOLS }};
ssl_ciphers {{ NGINX_SSL_CIPHERS }};
ssl_prefer_server_ciphers on;
ssl_dhparam {{ NGINX_DH_PARAMS_PATH }};
##
# Gzip Settings
##
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment