TMAegisBeta
Thêm quy tắc cho linux

Linux distributions

TMA-ROCKY8-5.3.3.2.6

Ensure password dictionary check is enabled

Trung bìnhCấp 1Tự độnglinux

Mô tả

The pwquality dictcheck option sets whether to check for the words from the cracklib dictionary.

Cách kiểm tra

Phương pháp kiểm tra: Lệnh shell

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
Đầu ra mong đợi
compliant

Cách khắc phục

Phương pháp khắc phục: Hướng dẫn hoặc bản vá hạ tầng

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…

Thuộc tính

Hệ điều hành
rocky-8
Thẻ
cis-convertedlinux
Tham chiếu
CIS Rocky Linux 8 Benchmark v3.0.0 - 5.3.3.2.6

Kiểm tra máy này

Chạy lệnh này trên máy bạn được phép kiểm tra. Lần quét chỉ ở chế độ đọc.

shell
tmaegis scan --target linux