Skip to content

Commit 34be301

Browse files
Add debian 7, fedora and opensuse-13.2 with ssh versions
for old chef versions where autodetection does not work
1 parent 4d17292 commit 34be301

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

libraries/devsec_ssh.rb

+10-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def get_ssh_version(package)
191191
end
192192

193193
# Guess the version of ssh via OS matrix
194-
def guess_ssh_version
194+
def guess_ssh_version # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
195195
family = node['platform_family']
196196
platform = node['platform']
197197
version = node['platform_version'].to_f
@@ -203,11 +203,20 @@ def guess_ssh_version
203203
return 6.6 if version >= 14.04
204204
when 'debian'
205205
return 6.6 if version >= 8
206+
return 6.0 if version >= 7
206207
return 5.3 if version <= 6
207208
end
208209
when 'rhel'
209210
return 6.6 if version >= 7
210211
return 5.3 if version >= 6
212+
when 'fedora'
213+
return 7.3 if version >= 25
214+
return 7.2 if version >= 24
215+
when 'suse'
216+
case platform
217+
when 'opensuse'
218+
return 6.6 if version >= 13.2
219+
end
211220
end
212221
Chef::Log.info("Unknown platform #{node['platform']} with version #{node['platform_version']} and family #{node['platform_family']}. Assuming ssh version #{FALLBACK_SSH_VERSION}")
213222
FALLBACK_SSH_VERSION

0 commit comments

Comments
 (0)