id: pwpolicy_account_lockout_enforce
title: Limit Consecutive Failed Login Attempts to $ODV
discussion: |
  The macOS _MUST_ be configured to limit the number of failed login attempts to a maximum of $ODV. When the maximum number of failed attempts is reached, the account _MUST_ be locked for a period of time after.

  This rule protects against malicious users attempting to gain access to the system via brute-force hacking methods.
check: |
  /usr/bin/pwpolicy -getaccountpolicies 2> /dev/null | /usr/bin/tail +2 | /usr/bin/xmllint --xpath '//dict/key[text()="policyAttributeMaximumFailedAuthentications"]/following-sibling::integer[1]/text()' - | /usr/bin/awk '{ if ($1 <= $ODV) {print "pass"} else {print "fail"}}' | /usr/bin/uniq
result:
  string: 'pass'
fix: |
  This is implemented by a Configuration Profile.
references:
  cce:
    - CCE-94331-6
  cci:
    - CCI-000044
    - CCI-002238
  800-53r5:
    - AC-7
  800-53r4:
    - AC-7
  srg:
    - SRG-OS-000329-GPOS-00128
    - SRG-OS-000021-GPOS-00005
  disa_stig:
    - APPL-15-000022
  800-171r3:
    - 03.01.08
  cis:
    benchmark:
      - 5.2.1 (level 1)
    controls v8:
      - 6.2
  cmmc:
    - AC.L2-3.1.8
macOS:
  - '15.0'
odv:
  hint: Number of failed attempts.
  recommended: 3
  cis_lvl1: 5
  cis_lvl2: 5
  stig: 3
tags:
  - 800-171
  - 800-53r4_low
  - 800-53r4_moderate
  - 800-53r4_high
  - 800-53r5_low
  - 800-53r5_moderate
  - 800-53r5_high
  - cis_lvl1
  - cis_lvl2
  - cisv8
  - cnssi-1253_low
  - cnssi-1253_high
  - cmmc_lvl2
  - stig
  - cnssi-1253_moderate
severity: medium
mobileconfig: true
mobileconfig_info:
  com.apple.mobiledevice.passwordpolicy:
    maxFailedAttempts: $ODV
ddm_info:
  declarationtype: com.apple.configuration.passcode.settings
  ddm_key: MaximumFailedAttempts
  ddm_value: $ODV