TMAegis
Више правила за macos

macOS

TMA-MACOS-5.2.2

Ensure Password Minimum Length Is Configured

ВисокаНиво 1Аутоматскаmacos

Опис

A minimum password length is the fewest number of characters a password can contain to meet a system's requirements. Ensure that a minimum of a 15-character password is part of the password policy on the computer. Audit: Reads the length from the policyAttributePassword matches .{N,} policy (or a minimumLength/minChars value); N must be >= 15.

Како се проверава

Метод провере: Команда љуске

shell
out=$(/usr/bin/pwpolicy -getaccountpolicies 2>/dev/null) || exit 1
n=$(printf '%s\n' "$out" | /usr/bin/grep -e "policyAttributePassword matches" | /usr/bin/grep -oE '\{[0-9]+,' | /usr/bin/tr -d '{,' | /usr/bin/sort -n | /usr/bin/tail -1)
m=$(printf '%s\n' "$out" | /usr/bin/grep -A1 -E 'minimumLength|minChars' | /usr/bin/grep -oE '<integer>[0-9]+' | /usr/bin/tr -dc '0-9\n' | /usr/bin/sort -n | /usr/bin/tail -1)
[ -n "$m" ] && { [ -z "$n" ] || [ "$m" -gt "$n" ]; } && n=$m
if [ -n "$n" ] && [ "$n" -ge 15 ]; then echo compliant; else echo "minimum length=${n:-unset}"; fi
Очекивани излаз
compliant

Како се исправља

Метод исправке: Смерница или закрпа инфраструктуре

Profile (preferred): com.apple.mobiledevice.passwordpolicy minLength = <integer><value≥15></integer>. Terminal: sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "minChars=<value≥15>" ; sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "minChars=15".

Својства

Оперативни системи
macos-26
Ознаке
macossystem-access
Референца
CIS Apple macOS 26 Tahoe Benchmark v1.1.0 - 5.2.2 Ensure Password Minimum Length Is Configured

Проверите овај рачунар

Покрените ово на рачунару за који имате дозволу за проверу. Скенирање ради у режиму само за читање.

shell
tmaegis scan --target macos