id: pwpolicy_minimum_length_enforce
title: Require a Minimum Password Length of $ODV Characters
discussion: |
  The macOS _MUST_ be configured to require a minimum of $ODV characters be used when a password is created.

  This rule enforces password complexity by requiring users to set passwords that are less vulnerable to malicious users.

  NOTE: To comply with Executive Order 14028, “Improving the Nation's Cybersecurity”, OMB M-22-09, “Moving the U.S. Government Toward Zero Trust Cybersecurity Principles”, and NIST SP-800-63b, “Digital Identity Guidelines: Authentication and Lifecycle Management” federal, military, and intelligence communities must adopt the following configuration settings. Password policies must not require the use of complexity policies such as upper characters, lower characters, or special characters. Password policies must also not require the use of regular rotation. Password policies should define a minimum length. Multifactor authentication should be used where ever possible.
check: |
  /usr/bin/pwpolicy -getaccountpolicies 2>/dev/null | tail +2 | grep -oE "policyAttributePassword matches '.\{[0-9]+," | awk -F'[{,]' -v ODV=$ODV '{if ($2 > max) max=$2} END {print (max >= ODV) ? "pass" : "fail"}'
result:
  string: 'pass'
fix: |
  This is implemented by a Configuration Profile.
references:
  cce:
    - CCE-95346-3
  cci:
    - CCI-000205
    - CCI-004066
  800-53r5:
    - IA-5(1)
  800-53r4:
    - IA-5
    - IA-5(1)
  srg:
    - SRG-OS-000078-GPOS-00046
  disa_stig:
    - APPL-26-003010
  800-171r3:
    - 03.05.07
  cis:
    benchmark:
      - 5.2.2 (level 1)
    controls v8:
      - 5.2
  cmmc:
    - IA.L2-3.5.7
    - IA.L2-3.5.8
    - IA.L2-3.5.9
  bio:
    - 5.17.03
macOS:
  - '26.0'
odv:
  hint: Minimum password length.
  recommended: 15
  cis_lvl1: 15
  cis_lvl2: 15
  stig: 14
  nlmapgov_base: 15
  nlmapgov_plus: 15
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
  - nlmapgov_base
  - nlmapgov_plus
severity: medium
mobileconfig: true
mobileconfig_info:
  com.apple.mobiledevice.passwordpolicy:
    minLength: $ODV
ddm_info:
  declarationtype: com.apple.configuration.passcode.settings
  ddm_key: MinimumLength
  ddm_value: $ODV