Linux distributions
TMA-ROCKY8-5.3.3.2.6
Ensure password dictionary check is enabled
Descrição
The pwquality dictcheck option sets whether to check for the words from the cracklib dictionary.
Como é verificado
Método de auditoria: Comando shell
alt0() { command -v grep >/dev/null 2>&1 || { echo "step1: grep not installed"; return 1; }; o=$(bash -c 'grep -Psi -- '"'"'^\h*dictcheck\h*=\h*0\b'"'"' /etc/security/pwquality.conf /etc/security/pwquality.conf.d/*.conf' 2>/dev/null); [ -z "$o" ] || { echo "step1: $o" | head -c 300; return 1; }; o=$(bash -c 'grep -Psi -- '"'"'^\h*password\h+(requisite|required|sufficient)\h+pam_pwquality\.so\h+([^#\n r]+\h+)?dictcheck\h*=\h*0\b'"'"' /etc/pam.d/system-auth /etc/pam.d/password-auth' 2>/dev/null); [ -z "$o" ] || { echo "step2: $o" | head -c 300; return 1; }; }; if alt0; then echo compliant; fi- Saída esperada
compliant
Como é corrigido
Método de correção: Orientação ou patch de infraestrutura
Edit any file ending in .conf in the /etc/security/pwquality.conf.d/ directory and/or the file /etc/security/pwquality.conf and comment out or remove any instance of dictcheck = 0: Example: # sed -ri 's/^\s*dictcheck\s*=/# &/' /etc/security/pwquality.conf /etc/security/pwquality.conf.d/*.conf Run the following script to remove setting dictcheck on the pam_pwquality.so module in the PAM files: #!/usr/bin/env bash { for l_pam_file in system-auth password-auth; do l_authselect_file="/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/$l_pam_file" sed -ri 's/(^\s*password\s+(requisite|required|sufficient)\s+pam_pwquality\.so.*)(\s+ dictcheck\s*=\s*\S+)(.*$)/\1\4/' "$l_aut…
Propriedades
- Sistemas operacionais
- rocky-8
- Tags
- cis-convertedlinux
- Referência
- CIS Rocky Linux 8 Benchmark v3.0.0 - 5.3.3.2.6
Verificar este host
Execute isto em uma máquina que você tenha permissão para auditar. A varredura é somente leitura.
tmaegis scan --target linux