TMAegisBeta
Más reglas para linux

Linux distributions

TMA-ROCKY8-6.3.3.20

Ensure the audit configuration is loaded regardless of errors

BajaNivel 2Automatizadalinux

Descripción

Set -c flag so that auditctl will continue loading rules in spite of an error. The exit code will not be success if any rule fails to load.

Cómo se verifica

Método de auditoría: Comando de shell

shell
alt0() { command -v grep >/dev/null 2>&1 || { echo "step1: grep not installed"; return 1; }; command -v tail >/dev/null 2>&1 || { echo "step1: tail not installed"; return 1; }; o=$(bash -c 'grep -Ph -- '"'"'^\h*-c\b'"'"' /etc/audit/rules.d/*.rules | tail -1' 2>&1); printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- -c || { echo step1: missing -c; return 1; }; }; if alt0; then echo compliant; fi
Salida esperada
compliant

Cómo se corrige

Método de corrección: Guía o parche de infraestructura

Edit or create the file /etc/audit/rules.d/01-initialize.rules and add the line - c at the end of the file: Example: # printf '%s\n' "" "-c" >> /etc/audit/rules.d/01-initialize.rules Load audit 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

Propiedades

Sistemas operativos
rocky-8
Etiquetas
cis-convertedlinux
Referencia
CIS Rocky Linux 8 Benchmark v3.0.0 - 6.3.3.20

Verificar este host

Ejecute esto en un equipo que tenga permiso para auditar. El escaneo es de solo lectura.

shell
tmaegis scan --target linux --level 2