diff --git a/scanners/access-and-control/1.47-ensure-ssh-maxauthtries-is-set-to-between-3-and-5.sh b/scanners/access-and-control/1.47-ensure-ssh-maxauthtries-is-set-to-between-3-and-5.sh index 4434380dc51d73f9d7d627510b57fa714ebcfb0d..8ca715d7e56d9efd1a27246fae7176bcd0245494 100644 --- a/scanners/access-and-control/1.47-ensure-ssh-maxauthtries-is-set-to-between-3-and-5.sh +++ b/scanners/access-and-control/1.47-ensure-ssh-maxauthtries-is-set-to-between-3-and-5.sh @@ -1,10 +1,9 @@ -result=true +result=false -grep -Eiq '^\s*maxauthtries\s+([6-9]|[1-9][0-9]+)' /etc/ssh/sshd_config && result=false -[ "$result" = true ] && grep -Eiq '^\s*maxauthtries\s+([0-2])' /etc/ssh/sshd_config && result=false +sshd -T -C user=root -C host="$(hostname)" -C addr="$(grep $(hostname) /etc/hosts | awk '{print $1}')" | grep -Eiq ^maxauthtries\\s+[3-5] && grep -Eiq '^\s*maxauthtries\s+[3-5]' /etc/ssh/sshd_config && result=true if [ "$result" = true ]; then echo "pass" else echo "fail" -fi \ No newline at end of file +fi