Skip to content

Commit 992faad

Browse files
monobailachris-rock
authored andcommitted
Issue 137 - MaxAuthTries Parameter. (#138)
Add reference and more detailed description of this configuration option (taken from CIS benchmark document). Allow ability to override the default of 2, in some instances this can be too aggressive causing lockouts to users with multiple keys loaded in the ssh agent. Signed-off-by: monobaila <monobaila@users.noreply.github.com>
1 parent 00efe48 commit 992faad

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

controls/sshd_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,11 @@
218218
control 'sshd-19' do
219219
impact 1.0
220220
title 'Server: Specify Limit for maximum authentication retries'
221-
desc 'MaxAuthTries limits the user to three wrong attempts before the login attempt is denied. This avoid resource starvation attacks.'
221+
desc 'The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure. Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. The default is 2 but should be configured based on site policy.'
222+
tag 'CIS Red Hat Enterprise Linux 7 Benchmark version 01-31-2017': '2.1.1'
223+
ref 'Center for Internet Security', url: 'https://www.cisecurity.org/'
222224
describe sshd_config do
223-
its('MaxAuthTries') { should eq('2') }
225+
its('MaxAuthTries') { should be == attribute('max_auth_tries') }
224226
end
225227
end
226228

inspec.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@ summary: Test-suite for best-practice SSH hardening
88
version: 2.4.1
99
supports:
1010
- os-family: unix
11+
attributes:
12+
- name: max_auth_tries
13+
required: false
14+
description: 'define MaxAuthTries'
15+
value: 2
16+
type: numeric

0 commit comments

Comments
 (0)