TMAegis
Mais regras para aix

TMA-AIX-4.1.2.2

Ensure HOME directories are owned by root or the UID specified in /etc/passwd

AltaNível 1Automatizadaaix

Descrição

All user home directories must have a suitable owner UID. The recommendation is to lock accounts when the HOME directory is not owned by the user or by root. This recommendation may be overruled by a site-specific policy statement. When the account is the owner - the security policy must specify that (some) accounts may have DAC authorization to modify HOME directory contents. Audit: automated read-only check derived from the CIS audit procedure; it prints "compliant" when the control is met.

Como é verificado

Método de auditoria: Comando shell

shell
command -v lsuser >/dev/null 2>&1 || exit 1; out=$( { lsuser -R files -a id home account_locked ALL | while read name ids homes locks rest; do uid=${ids#id=}; home=${homes#home=}; locked=${locks#account_locked=}; [ "$uid" -ge 200 ] 2>/dev/null || continue; [ "$home" = /dev/null ] && continue; [ "$locked" = true ] && continue; if [ ! -d "$home" ]; then echo "$home does not exist ($name)"; continue; fi; o=$(ls -ld "$home/" | awk '{print $3}'); [ "$o" = "$name" ] || [ "$o" = root ] || echo "$name does not own $home ($o)"; done ; } 2>/dev/null ); [ -z "$out" ] && echo compliant || printf '%s\n' "$out" | head -n 20
Saída esperada
compliant

Como é corrigido

Método de correção: Orientação ou patch de infraestrutura

Review the file(s) returned by the audit procedure and perform one of the following: Change the ownership of the <HOME_DIRECTORY> to the appropriate user. e.g. chown <USER> <HOME_DIRECTORY>. Lock the account incorrectly associated with the <HOME_DIRECTORY>. Delete the <HOME_DIRECTORY>. WARNING This will remove the directory and all files contained in the directory from the system. The following script may be used to lock the account referring to the <HOME_DIRECTORY>: For all local accounts with UID >= 200: #!/usr/bin/ksh -e # Provided to CIS by AIXTools # Copyright AIXTools, 2022 lsuser -R files -a id home account_locked ALL | while read name ids homes locks rest; do uid=$(echo ${ids} | cut -f2 -d =) if [[ ${uid} -ge 200 ]]; then home=$(echo ${homes} | cut -f2 -d =) locked=$(echo ${locks} | cut -f2 -d =) if [[ ${home} == "/dev/null" || ${locked} == "true" ]]; then continue elif [[ ! -d ${home} ]]; then /usr/bin/printf "%-32s does not exist; Run appropriate CIS remediation\n" ${home} ${name} continue else /usr/bin/perl -e ' $user=$ARGV[0]; $hd=$ARGV[1]; $uid=$ARGV[2]; $huid=((stat $hd)[4]); if ($huid != $uid && $huid != 0) { printf("Locked Account: %s ... (see CIS section 4.1.2.2)

Propriedades

Sistemas operacionais
Qualquer
Tags
aixaccounts
Referência
CIS IBM AIX 7 Benchmark v1.2.0 - 4.1.2.2 Ensure HOME directories are owned by root or the UID specified in /etc/passwd

Verificar este host

Execute isto em uma máquina que você tenha permissão para auditar. A varredura é somente leitura.

shell
tmaegis scan --target aix