TMAegisBeta
Više pravila za linux

Linux distributions

TMA-UBUNTU2004-6.3.3.12

Ensure login and logout events are collected

NiskaNivo 2Automatskalinux

Opis

Monitor login and logout events. The parameters below track changes to files associated with login/logout events. • /var/log/lastlog - maintain records of the last time a user successfully logged in. • /var/run/faillock - directory maintains records of login failures via the pam_faillock module.

Kako se proverava

Metod provere: Komanda ljuske

shell
alt0() { o=$(bash -c 'awk '"'"'/^ *-w/ &&(/\/var\/log\/lastlog/ ||/\/var\/run\/faillock/) &&/ +-p *wa/ &&(/ key= *[!-~]* *$/||/ -k *[!-~]* *$/)'"'"' /etc/audit/rules.d/*.rules' 2>&1); printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- '-w /var/log/lastlog -p wa -k logins' || { echo step1: missing '-w /var/log/lastlog -p wa -k logins'; return 1; }; printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- '-w /var/run/faillock -p wa -k logins' || { echo step1: missing '-w /var/run/faillock -p wa -k logins'; return 1; }; o=$(bash -c 'auditctl -l | awk '"'"'/^ *-w/ &&(/\/var\/log\/lastlog/ ||/\/var\/run\/faillock/) &&/ +-p *wa/ &&(/ key= *[!-~]* *$/||/ -k *[!-~]* *$/)'"'"'' 2>&1); printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- '-w /var/log/lastlog -p wa -k logins' || { echo step2: missing '-w /var/log/lastlog -p wa -k logins'; return 1; }; printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- '-w /var/run/faillock -p wa -k logins' || { echo step2: missing '-w /var/run/faillock -p wa -k logins'; return 1; }; }; if alt0; then echo compliant; fi
Očekivani izlaz
compliant

Kako se ispravlja

Metod ispravke: Smernica ili zakrpa infrastrukture

Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor login and logout events. Example: # printf " -w /var/log/lastlog -p wa -k logins -w /var/run/faillock -p wa -k logins " >> /etc/audit/rules.d/50-login.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 rules\n"; fi

Svojstva

Operativni sistemi
ubuntu-20.04
Oznake
cis-convertedlinux
Referenca
CIS Ubuntu Linux 20.04 LTS Benchmark v3.0.0 - 6.3.3.12

Proverite ovaj računar

Pokrenite ovo na računaru za koji imate dozvolu za proveru. Skeniranje radi u režimu samo za čitanje.

shell
tmaegis scan --target linux --level 2