1.18 APPL-14-000053

Information

The macOS system must set Login Grace Time to 30.

GROUP ID: V-259437RULE ID: SV-259437r970703

If SSHD is enabled, then it must be configured to wait only 30 seconds before timing out logon attempts.

Note: /etc/ssh/sshd_config will be automatically modified to its original state following any update or major upgrade to the operating system.

Solution

Configure the macOS system to set Login Grace Time to 30 with the following command:

include_dir=$(/usr/bin/awk '/^Include/ {print $2}' /etc/ssh/sshd_config | /usr/bin/tr -d '*')

if [[ -z $include_dir ]]; then/usr/bin/sed -i.bk "1s/.*/Include /etc/ssh/sshd_config.d/*/" /etc/ssh/sshd_configfi

/usr/bin/grep -qxF 'logingracetime 30' "${include_dir}01-mscp-sshd.conf" 2>/dev/null || echo "logingracetime 30" >> "${include_dir}01-mscp-sshd.conf"

for file in $(ls ${include_dir}); doif [[ "$file" == "100-macos.conf" ]]; thencontinuefiif [[ "$file" == "01-mscp-sshd.conf" ]]; thenbreakfi/bin/mv ${include_dir}${file} ${include_dir}20-${file}done

See Also

https://workbench.cisecurity.org/benchmarks/24070

Item Details

Category: SYSTEM AND COMMUNICATIONS PROTECTION

References: 800-53|SC-10, CAT|II, CCI|CCI-001133, Rule-ID|SV-259437r970703_rule, STIG-ID|APPL-14-000053, Vuln-ID|V-259437

Plugin: Unix

Control ID: 1cba644f3545960fe94ea61ed6b3f96869efddd9975ad2bf0a2fcc51a7b9e8dd