TMAegisBeta
linux için daha fazla kural

Linux distributions

TMA-UBUNTU2004-6.3.3.8

Ensure events that modify user/group information are collected

DüşükDüzey 2Otomatiklinux

Açıklama

Record events affecting the modification of user or group information, including that of passwords and old passwords if in use. • /etc/group - system groups • /etc/passwd - system users • /etc/gshadow - encrypted password for each group • /etc/shadow - system user passwords • /etc/security/opasswd - storage of old passwords if the relevant PAM module is in use • /etc/nsswitch.conf - file configures how the system uses various databases and name resolution mechanisms • /etc/pam.conf - file determines the authentication services to be used, and the order in which the services are used. • /etc/pa

Nasıl denetlenir

Denetim yöntemi: Kabuk komutu

shell
alt0() { o=$(bash -c 'awk '"'"'/^ *-w/ &&(/\/etc\/group/ ||/\/etc\/passwd/ ||/\/etc\/gshadow/ ||/\/etc\/shadow/ ||/\/etc\/security\/opasswd/ ||/\/etc\/nsswitch.conf/ ||/\/etc\/pam.conf/ ||/\/etc\/pam.d/) &&/ +-p *wa/ &&(/ key= *[!-~]* *$/||/ -k *[!-~]* *$/)'"'"' /etc/audit/rules.d/*.rules' 2>&1); printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- '-w /etc/group -p wa -k identity' || { echo step1: missing '-w /etc/group -p wa -k identity'; return 1; }; printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- '-w /etc/passwd -p wa -k identity' || { echo step1: missing '-w /etc/passwd -p wa -k identity'; return 1; }; printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- '-w /etc/gshadow -p wa -k identity' || { echo step1: missing '-w /etc/gshadow -p wa -k identity'; return 1; }; printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- '-w /etc/shadow -p wa -k identity' || { echo step1: missing '-w /etc/shadow -p wa -k identity'; return 1; }; printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- '-w /etc/security/opasswd -p wa -k identity' || { echo step1: missing '-w /etc/security/opasswd -p wa -k identity'; return 1; }; printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- '-w /etc/nsswitch.conf -p wa -k identity' || { echo step1: missing '-w /etc/nsswitch.conf -p wa -k identity'; return 1; }; printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- '-w /etc/pam.conf -p wa -k identity' || { echo step1: missing '-w /etc/pam.conf -p wa -k identity'; return 1; }; printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- '-w /etc/pam.d -p wa -k identity' || { echo step1: missing '-w /etc/pam.d -p wa -k identity'; return 1; }; o=$(bash -c 'auditctl -l | awk '"'"'/^ *-w/ &&(/\/etc\/group/ ||/\/etc\/passwd/ ||/\/etc\/gshadow/ ||/\/etc\/shadow/ ||/\/etc\/security\/opasswd/ ||/\/etc\/nsswitch.conf/ ||/\/etc\/pam.conf/ ||/\/etc\/pam.d/) &&/ +-p *wa/ &&(/ key= *[!-~]* *$/||/ -k *[!-~]* *$/)'"'"'' 2>&1); printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- '-w /etc/group -p wa -k identity' || { echo step2: missing '-w /etc/group -p wa -k identity'; return 1; }; printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- '-w /etc/passwd -p wa -k identity' || { echo step2: missing '-w /etc/passwd -p wa -k identity'; return 1; }; printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- '-w /etc/gshadow -p wa -k identity' || { echo step2: missing '-w /etc/gshadow -p wa -k identity'; return 1; }; printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- '-w /etc/shadow -p wa -k identity' || { echo step2: missing '-w /etc/shadow -p wa -k identity'; return 1; }; printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- '-w /etc/security/opasswd -p wa -k identity' || { echo step2: missing '-w /etc/security/opasswd -p wa -k identity'; return 1; }; printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- '-w /etc/nsswitch.conf -p wa -k identity' || { echo step2: missing '-w /etc/nsswitch.conf -p wa -k identity'; return 1; }; printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- '-w /etc/pam.conf -p wa -k identity' || { echo step2: missing '-w /etc/pam.conf -p wa -k identity'; return 1; }; printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- '-w /etc/pam.d -p wa -k identity' || { echo step2: missing '-w /etc/pam.d -p wa -k identity'; return 1; }; }; if alt0; then echo compliant; fi
Beklenen çıktı
compliant

Nasıl düzeltilir

Düzeltme yöntemi: Kılavuz veya altyapı yaması

Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify user/group information. Example: # printf " -w /etc/group -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/security/opasswd -p wa -k identity -w /etc/nsswitch.conf -p wa -k identity -w /etc/pam.conf -p wa -k identity -w /etc/pam.d -p wa -k identity " >> /etc/audit/rules.d/50-identity.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load r…

Özellikler

İşletim sistemleri
ubuntu-20.04
Etiketler
cis-convertedlinux
Referans
CIS Ubuntu Linux 20.04 LTS Benchmark v3.0.0 - 6.3.3.8

Bu ana makineyi denetle

Bunu denetleme izniniz olan bir makinede çalıştırın. Tarama salt okunurdur.

shell
tmaegis scan --target linux --level 2