Skip to content

Commit 18a6528

Browse files
Disable experimental client roaming
1 parent 87dea4f commit 18a6528

File tree

6 files changed

+20
-9
lines changed

6 files changed

+20
-9
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ This cookbook provides secure ssh-client and ssh-server configurations.
2828
* `['ssh'][{'client', 'server'}]['cbc_required']` - true if CBC for ciphers is required. This is usually only necessary, if older M2M mechanism need to communicate with SSH, that don't have any of the configured secure ciphers enabled. CBC is a weak alternative. Anything weaker should be avoided and is thus not available.
2929
* `['ssh'][{'client', 'server'}]['weak_hmac']` - true if weaker HMAC mechanisms are required. This is usually only necessary, if older M2M mechanism need to communicate with SSH, that don't have any of the configured secure HMACs enabled.
3030
* `['ssh'][{'client', 'server'}]['weak_kex']` - true if weaker Key-Exchange (KEX) mechanisms are required. This is usually only necessary, if older M2M mechanism need to communicate with SSH, that don't have any of the configured secure KEXs enabled.
31+
* `['ssh']['client']['roaming']` - enable experimental client roaming. This is known to cause potential issues with secrets being disclosed to malicious servers and defaults to being disabled.
3132
* `['ssh']['allow_root_with_key']` - `false` to disable root login altogether. Set to `true` to allow root to login via key-based mechanism.
3233
* `['ssh']['ports']` - ports to which ssh-server should listen to and ssh-client should connect to
3334
* `['ssh']['listen_to']` - one or more ip addresses, to which ssh-server should listen to. Default is empty, but should be configured for security reasons!

attributes/default.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,5 @@
7474
default['ssh']['max_sessions'] = 10 # sshd
7575
default['ssh']['client']['password_authentication'] = false # ssh
7676
default['ssh']['server']['password_authentication'] = false # sshd
77+
# http://undeadly.org/cgi?action=article&sid=20160114142733
78+
default['ssh']['client']['roaming'] = false

metadata.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,3 @@
2626
recipe 'ssh-hardening::default', 'installs and configures ssh client and server'
2727
recipe 'ssh-hardening::client', 'install and apply security hardening for ssh client'
2828
recipe 'ssh-hardening::server', 'install and apply security hardening for ssh server'
29-

recipes/client.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
variables(
6565
mac: SshMac.get_macs(node, node['ssh']['client']['weak_hmac']),
6666
kex: SshKex.get_kexs(node, node['ssh']['client']['weak_kex']),
67-
cipher: SshCipher.get_ciphers(node, node['ssh']['client']['cbc_required'])
67+
cipher: SshCipher.get_ciphers(node, node['ssh']['client']['cbc_required']),
68+
roaming: node['ssh']['client']['roaming']
6869
)
6970
end

spec/recipes/client_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@
6161
with_content(/Ciphers [^#]*-cbc\b/)
6262
end
6363

64+
it 'disables client roaming' do
65+
expect(chef_run).to render_file('/etc/ssh/ssh_config').
66+
with_content(/UseRoaming no/)
67+
end
68+
6469
it 'enables ctr ciphers' do
6570
expect(chef_run).to render_file('/etc/ssh/ssh_config').
6671
with_content(/Ciphers [^#]*\baes128-ctr\b/).

templates/default/openssh.conf.erb

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<% end %>
44
#---
55

6-
# This is the ssh client system-wide configuration file.
6+
# This is the ssh client system-wide configuration file.
77
# See ssh_config(5) for more information on any settings used. Comments will be added only to clarify why a configuration was chosen.
8-
#
8+
#
99
# Created for OpenSSH v5.9
1010

1111
# Basic configuration
@@ -49,15 +49,15 @@ StrictHostKeyChecking ask
4949
# CBC: is true if you want to connect with OpenSSL-base libraries
5050
# eg ruby Net::SSH::Transport::CipherFactory requires cbc-versions of the given openssh ciphers to work
5151
# -- see: (http://net-ssh.github.com/net-ssh/classes/Net/SSH/Transport/CipherFactory.html)
52-
#
52+
#
5353
<% if @cipher %>
5454
Ciphers <%= @cipher %>
5555
<% end %>
5656

5757
# **Hash algorithms** -- Make sure not to use SHA1 for hashing, unless it is really necessary.
58-
# Weak HMAC is sometimes required if older package versions are used
58+
# Weak HMAC is sometimes required if older package versions are used
5959
# eg Ruby's Net::SSH at around 2.2.* doesn't support sha2 for hmac, so this will have to be set true in this case.
60-
#
60+
#
6161
<% if @mac %>
6262
MACs <%= @mac %>
6363
<% end %>
@@ -68,7 +68,7 @@ MACs <%= @mac %>
6868
# **Key Exchange Algorithms** -- Make sure not to use SHA1 for kex, unless it is really necessary
6969
# Weak kex is sometimes required if older package versions are used
7070
# 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.
71-
#
71+
#
7272
<% if @kex %>
7373
KexAlgorithms <%= @kex %>
7474
<% end %>
@@ -108,4 +108,7 @@ PermitLocalCommand no
108108
Compression yes
109109

110110
#EscapeChar ~
111-
#VisualHostKey yes
111+
#VisualHostKey yes
112+
113+
# http://undeadly.org/cgi?action=article&sid=20160114142733
114+
UseRoaming <%= @roaming ? 'yes' : 'no' %>

0 commit comments

Comments
 (0)