Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debian 9's nginx doesn't support tls1.3 #526

Merged
merged 1 commit into from Feb 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion roles/nginx_hardening/defaults/main.yml
Expand Up @@ -23,7 +23,6 @@ nginx_add_header:

nginx_set_cookie_flag: "* HttpOnly secure"
nginx_ssl_prefer_server_ciphers: "on"
nginx_ssl_protocols: "TLSv1.2 TLSv1.3"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, we should reverse this split, when we drop Debian 9 support. Add a Issue for future reference?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nginx_ssl_ciphers: "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256"
nginx_ssl_session_tickets: "off"
nginx_dh_size: "4096"
23 changes: 23 additions & 0 deletions roles/nginx_hardening/tasks/main.yml
@@ -1,4 +1,27 @@
---
- name: Fetch OS dependent variables
include_vars:
file: '{{ item }}'
name: 'os_vars'
with_first_found:
- files:
- '{{ ansible_facts.distribution }}_{{ ansible_facts.distribution_major_version }}.yml'
- '{{ ansible_facts.distribution }}.yml'
- '{{ ansible_facts.os_family }}_{{ ansible_facts.distribution_major_version }}.yml'
- '{{ ansible_facts.os_family }}.yml'
skip: true
tags: always

# we only override variables with our default, if they have not been specified already
# by default the lookup functions finds all varnames containing the string, therefore
# we add ^ and $ to denote start and end of string, so this returns only exact matches
- name: Set OS dependent variables, if not already defined by user # noqa var-naming
set_fact:
'{{ item.key }}': '{{ item.value }}'
when: "not lookup('varnames', '^' + item.key + '$')"
with_dict: '{{ os_vars }}'
tags: always

- name: Create additional configuration
template:
src: "hardening.conf.j2"
Expand Down
2 changes: 2 additions & 0 deletions roles/nginx_hardening/vars/Amazon.yml
@@ -0,0 +1,2 @@
---
nginx_ssl_protocols: "TLSv1.2 TLSv1.3"
2 changes: 2 additions & 0 deletions roles/nginx_hardening/vars/Archlinux.yml
@@ -0,0 +1,2 @@
---
nginx_ssl_protocols: "TLSv1.2 TLSv1.3"
2 changes: 2 additions & 0 deletions roles/nginx_hardening/vars/Debian.yml
@@ -0,0 +1,2 @@
---
nginx_ssl_protocols: "TLSv1.2 TLSv1.3"
2 changes: 2 additions & 0 deletions roles/nginx_hardening/vars/Debian_9.yml
@@ -0,0 +1,2 @@
---
nginx_ssl_protocols: "TLSv1.2"
2 changes: 2 additions & 0 deletions roles/nginx_hardening/vars/Fedora.yml
@@ -0,0 +1,2 @@
---
nginx_ssl_protocols: "TLSv1.2 TLSv1.3"
2 changes: 2 additions & 0 deletions roles/nginx_hardening/vars/RedHat.yml
@@ -0,0 +1,2 @@
---
nginx_ssl_protocols: "TLSv1.2 TLSv1.3"
2 changes: 2 additions & 0 deletions roles/nginx_hardening/vars/Suse.yml
@@ -0,0 +1,2 @@
---
nginx_ssl_protocols: "TLSv1.2 TLSv1.3"
1 change: 0 additions & 1 deletion roles/nginx_hardening/vars/main.yml

This file was deleted.