Skip to content
Snippets Groups Projects
Commit 7c3b8ad9 authored by Lars Beckers's avatar Lars Beckers
Browse files

postfix: preset-based tls config, new presets

parent 6857d1f6
Branches
No related tags found
1 merge request!3Buster Compat and Improved TLS Settings
......@@ -6,8 +6,10 @@ postfix_virtual_domains: []
postfix_tls_cert: /etc/ssl/private/fullchain.pem
postfix_tls_key: /etc/ssl/private/privkey.pem
postfix_tls_ciphers: "{{ tls_ciphers }}"
postfix_tls_protocols: '!SSLv2 !SSLv3'
# possible values: modern, intermediate, old, previous
# see also: https://ssl-config.mozilla.org/
postfix_tls_configuration: 'previous'
postfix_prefer_lmtp: false
postfix_enable_memcached: false
......
---
- name: "include tls config vars (preset: {{ postfix_tls_configuration }})"
include_vars:
file: "tls-{{ postfix_tls_configuration }}.yml"
tags:
- postfix
- mail
- name: ensure all required postfix packages are installed
apt:
name:
......@@ -35,6 +42,20 @@
- postfix
- mail
- name: ensure dh params are available
copy:
src: "{{ postfix_tls_dh_file }}"
dest: /etc/postfix/dh.pem
owner: root
group: root
mode: '0644'
when: postfix_tls_dh_file is string
notify:
- restart postfix
tags:
- postfix
- mail
- name: ensure memcached config is present
template:
src: memcached.conf.j2
......
......@@ -38,16 +38,32 @@ smtpd_relay_restrictions =
defer_unauth_destination
smtpd_use_tls = yes
smtpd_tls_security_level = may
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = {{ postfix_tls_cert }}
smtpd_tls_key_file = {{ postfix_tls_key }}
smtpd_tls_eecdh_grade = ultra
smtpd_tls_mandatory_ciphers = high
smtpd_tls_mandatory_protocols = {{ postfix_tls_protocols }}
smtpd_tls_protocols = {{ postfix_tls_protocols }}
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
tls_high_cipherlist = {{ postfix_tls_ciphers }}
smtpd_tls_protocols = {{ postfix_tls_protocols }}
smtpd_tls_mandatory_protocols = {{ postfix_tls_protocols }}
{% if postfix_tls_mandatory_ciphers %}
smtpd_tls_mandatory_ciphers = {{ postfix_tls_mandatory_ciphers }}
{% endif %}
{% if postfix_tls_preempt_cipherlist %}
tls_preempt_cipherlist = {{ 'yes' if postfix_tls_preempt_cipherlist else 'no' }}
{% endif %}
{% if postfix_tls_eecdh_grade %}
smtpd_tls_eecdh_grade = {{ postfix_tls_eecdh_grade }}
{% endif %}
{% if postfix_tls_high_cipherlist %}
tls_high_cipherlist = {{ postfix_tls_high_cipherlist }}
{% endif %}
{% if postfix_tls_medium_cipherlist %}
tls_medium_cipherlist = {{ postfix_tls_medium_cipherlist }}
{% endif %}
{% if postfix_tls_dh_file %}
smtpd_tls_dh1024_param_file = /etc/postfix/dh.pem
{% endif %}
alias_maps = cdb:/etc/aliases
alias_database = cdb:/etc/aliases
......
---
postfix_tls_protocols: '!SSLv2, !SSLv3, !TLSv1, !TLSv1.1'
postfix_tls_mandatory_ciphers: medium
postfix_tls_preempt_cipherlist: false
postfix_tls_eecdh_grade: null
postfix_tls_high_cipherlist: null
postfix_tls_dh_file: ffdhe2048.txt # ffdhe4096.txt
postfix_tls_medium_cipherlist: 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384'
---
postfix_tls_protocols: '!SSLv2, !SSLv3, !TLSv1, !TLSv1.1, !TLSv1.2'
postfix_tls_mandatory_ciphers: null
postfix_tls_preempt_cipherlist: false
postfix_tls_eecdh_grade: null
postfix_tls_high_cipherlist: null
postfix_tls_medium_cipherlist: null
postfix_tls_dh_file: null
---
postfix_tls_protocols: '!SSLv2, !SSLv3'
postfix_tls_mandatory_ciphers: medium
postfix_tls_preempt_cipherlist: true
postfix_tls_eecdh_grade: null
postfix_tls_high_cipherlist: null
postfix_tls_dh_file: ffdhe2048.txt # ffdhe4096.txt
postfix_tls_medium_cipherlist: 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA256:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA'
---
postfix_tls_protocols: '!SSLv2 !SSLv3'
postfix_tls_mandatory_ciphers: high
postfix_tls_preempt_cipherlist: null
postfix_tls_eecdh_grade: ultra
postfix_tls_high_cipherlist: "{{ tls_ciphers }}"
postfix_tls_medium_cipherlist: null
postfix_tls_dh_file: null
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment