@@ -51,13 +51,13 @@ LogLevel VERBOSE
5151# -- see: (http://net-ssh.github.com/net-ssh/classes/Net/SSH/Transport/CipherFactory.html)
5252#
5353{% if ssh_server_cbc_required -%}
54- {% if (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' ) or (ansible_distribution == 'Debian' and ansible_distribution_version >= '8' ) -%}
54+ {% if (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' ) or (ansible_distribution == 'Debian' and ansible_distribution_version >= '8' ) or ( ansible_os_family in [ 'Oracle Linux' , 'RedHat' ] and ansible_distribution_major_version >= '7' ) -%}
5555 Ciphers {{ ssh_ciphers_66_weak | join(',') }}
5656 {% else %}
5757 Ciphers {{ ssh_ciphers_53_weak | join(',') }}
5858 {% endif %}
5959{% else -%}
60- {% if (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' ) or (ansible_distribution == 'Debian' and ansible_distribution_version >= '8' ) -%}
60+ {% if (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' ) or (ansible_distribution == 'Debian' and ansible_distribution_version >= '8' ) or ( ansible_os_family in [ 'Oracle Linux' , 'RedHat' ] and ansible_distribution_major_version >= '7' ) -%}
6161 Ciphers {{ ssh_ciphers_66_default | join(',') }}
6262 {% else -%}
6363 Ciphers {{ ssh_ciphers_53_default | join(',') }}
@@ -70,15 +70,13 @@ LogLevel VERBOSE
7070#
7171
7272{% if ssh_server_weak_hmac -%}
73- {% if (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' ) or (ansible_distribution == 'Debian' and ansible_distribution_version >= '8' ) -%}
73+ {% if (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' ) or (ansible_distribution == 'Debian' and ansible_distribution_version >= '8' ) or ( ansible_os_family in [ 'Oracle Linux' , 'RedHat' ] and ansible_distribution_major_version >= '7' ) -%}
7474 MACs {{ ssh_macs_66_weak | join(',') }}
7575 {% elif ansible_os_family in ['Oracle Linux' , 'RedHat' ] and ansible_distribution_major_version <= '6' -%}
7676 MACs {{ ssh_macs_53_default | join(',') }}
77- {% else -%}
78- MACs {{ ssh_macs_59_weak | join(',') }}
7977 {% endif %}
8078{% else -%}
81- {% if (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' ) or (ansible_distribution == 'Debian' and ansible_distribution_version >= '8' ) -%}
79+ {% if (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' ) or (ansible_distribution == 'Debian' and ansible_distribution_version >= '8' ) or ( ansible_os_family in [ 'Oracle Linux' , 'RedHat' ] and ansible_distribution_major_version >= '7' ) -%}
8280 MACs {{ ssh_macs_66_default | join(',') }}
8381 {% elif ansible_os_family in ['Oracle Linux' , 'RedHat' ] and ansible_distribution_major_version <= '6' -%}
8482 MACs {{ ssh_macs_53_default | join(',') }}
@@ -94,14 +92,14 @@ LogLevel VERBOSE
9492# Weak kex is sometimes required if older package versions are used
9593# eg ruby's Net::SSH at around 2.2.* doesn't support sha2 for kex, so this will have to be set true in this case.
9694# based on: https://bettercrypto.org/static/applied-crypto-hardening.pdf
97- {% if (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' ) or (ansible_distribution == 'Debian' and ansible_distribution_version >= '8' ) -%}
95+ {% if (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' ) or (ansible_distribution == 'Debian' and ansible_distribution_version >= '8' ) or ( ansible_os_family in [ 'Oracle Linux' , 'RedHat' ] and ansible_distribution_major_version >= '7' ) -%}
9896 {% if ssh_server_weak_kex -%}
9997 KexAlgorithms {{ ssh_kex_66_weak | join(',') }}
10098 {% else -%}
10199 KexAlgorithms {{ ssh_kex_66_default | join(',') }}
102100 {% endif %}
103101{% else -%}
104- {% if ansible_os_family in ['Oracle Linux' , 'RedHat' ] -%}
102+ {% if ansible_os_family in ['Oracle Linux' , 'RedHat' ] and ansible_distribution_major_version <= '6' -%}
105103 #KexAlgorithms
106104 {% elif ssh_server_weak_kex -%}
107105 KexAlgorithms {{ sshd_kex_59_weak | join(',') }}
@@ -115,7 +113,7 @@ LogLevel VERBOSE
115113
116114# Secure Login directives.
117115UseLogin no
118- UsePrivilegeSeparation {% if (ansible_distribution == 'Debian' and ansible_distribution_major_version <= '6' ) or ansible_os_family in ['Oracle Linux' , 'RedHat' ] -%} {{ssh_ps53}}{% else %} {{ssh_ps59}}{% endif %}
116+ UsePrivilegeSeparation {% if (ansible_distribution == 'Debian' and ansible_distribution_major_version <= '6' ) or ( ansible_os_family in ['Oracle Linux' , 'RedHat' ] and ansible_distribution_major_version <= '6' ) -%} {{ssh_ps53}}{% else %} {{ssh_ps59}}{% endif %}
119117
120118PermitUserEnvironment no
121119LoginGraceTime 30s
0 commit comments