@@ -51,13 +51,13 @@ LogLevel VERBOSE
51
51
# -- see: (http://net-ssh.github.com/net-ssh/classes/Net/SSH/Transport/CipherFactory.html)
52
52
#
53
53
{% 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' ) -%}
55
55
Ciphers {{ ssh_ciphers_66_weak | join(',') }}
56
56
{% else %}
57
57
Ciphers {{ ssh_ciphers_53_weak | join(',') }}
58
58
{% endif %}
59
59
{% 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' ) -%}
61
61
Ciphers {{ ssh_ciphers_66_default | join(',') }}
62
62
{% else -%}
63
63
Ciphers {{ ssh_ciphers_53_default | join(',') }}
@@ -70,15 +70,13 @@ LogLevel VERBOSE
70
70
#
71
71
72
72
{% 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' ) -%}
74
74
MACs {{ ssh_macs_66_weak | join(',') }}
75
75
{% elif ansible_os_family in ['Oracle Linux' , 'RedHat' ] and ansible_distribution_major_version <= '6' -%}
76
76
MACs {{ ssh_macs_53_default | join(',') }}
77
- {% else -%}
78
- MACs {{ ssh_macs_59_weak | join(',') }}
79
77
{% endif %}
80
78
{% 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' ) -%}
82
80
MACs {{ ssh_macs_66_default | join(',') }}
83
81
{% elif ansible_os_family in ['Oracle Linux' , 'RedHat' ] and ansible_distribution_major_version <= '6' -%}
84
82
MACs {{ ssh_macs_53_default | join(',') }}
@@ -94,14 +92,14 @@ LogLevel VERBOSE
94
92
# Weak kex is sometimes required if older package versions are used
95
93
# 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.
96
94
# 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' ) -%}
98
96
{% if ssh_server_weak_kex -%}
99
97
KexAlgorithms {{ ssh_kex_66_weak | join(',') }}
100
98
{% else -%}
101
99
KexAlgorithms {{ ssh_kex_66_default | join(',') }}
102
100
{% endif %}
103
101
{% 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' -%}
105
103
#KexAlgorithms
106
104
{% elif ssh_server_weak_kex -%}
107
105
KexAlgorithms {{ sshd_kex_59_weak | join(',') }}
@@ -115,7 +113,7 @@ LogLevel VERBOSE
115
113
116
114
# Secure Login directives.
117
115
UseLogin 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 %}
119
117
120
118
PermitUserEnvironment no
121
119
LoginGraceTime 30s
0 commit comments