From 0932d5fe8789d33265eb277d543a9c08e8c79089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mich=C3=A9e=20lengronne?= Date: Wed, 20 May 2020 18:03:06 +0200 Subject: [PATCH] ListenAddress should exist (#165) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ListenAddress should exist There can be multiple ListenAddress (for instance ipv6 and ipv4 failover). Signed-off-by: Michée Lengronne * ListenAddress should be set Signed-off-by: Michée Lengronne * test for more nil variants Signed-off-by: Michée Lengronne * fix Signed-off-by: Michée Lengronne --- controls/sshd_spec.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/controls/sshd_spec.rb b/controls/sshd_spec.rb index abd0ea8..15ecca0 100644 --- a/controls/sshd_spec.rb +++ b/controls/sshd_spec.rb @@ -140,7 +140,9 @@ title 'Server: Specify ListenAddress' desc "Limit the SSH server to listen to a specific address. Don't let it listen on all interfaces to avoid logins from unexpected sources." describe sshd_config(sshd_custom_path + '/sshd_config') do - its('ListenAddress') { should match(/.*/) } + its('ListenAddress') { should_not eq nil } + its('ListenAddress') { should_not match(/^\s*$/) } + its('ListenAddress') { should_not eq [] } end end