id: pwpolicy_special_character_enforce
title: Require Passwords Contain a Minimum of One Special Character
discussion: |
  The macOS _MUST_ be configured to require at least one special character be used when a password is created.

  Special characters are those characters that are not alphanumeric. Examples include: ~ ! @ # $ % ^ *.

  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 | /usr/bin/tail -n +2 | /usr/bin/xmllint --xpath "//string[contains(text(), \"policyAttributePassword matches '(.*[^a-zA-Z0-9].*){\")]" - 2>/dev/null | /usr/bin/awk -F"{|}" '{if ($2 >= $ODV) {print "pass"} else {print "fail"}}'
result:
  string: 'pass'
fix: |
  This is implemented by a Configuration Profile.
references:
  cce:
    - CCE-94344-9
  cci:
    - CCI-001619
    - CCI-004066
  800-53r5:
    - IA-5(1)
  800-53r4:
    - IA-5
    - IA-5(1)
  srg:
    - SRG-OS-000266-GPOS-00101
  disa_stig:
    - APPL-15-003011
  800-171r3:
    - 03.05.07
  cis:
    benchmark:
      - 5.2.5 (level 2)
    controls v8:
      - 5.2
  cmmc:
    - IA.L2-3.5.7
    - IA.L2-3.5.8
    - IA.L2-3.5.9
macOS:
  - '15.0'
odv:
  hint: Number of special characters.
  recommended: 1
  cis_lvl2: 1
  stig: 1
tags:
  - 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:
    minComplexChars: $ODV
ddm_info:
  declarationtype: com.apple.configuration.passcode.settings
  ddm_key: MinimumComplexCharacters
  ddm_value: $ODV