Linux distributions
TMA-RHEL10-6.3.3.35
Ensure the audit configuration is loaded regardless of errors
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
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
- rhel-10
- Etiquetas
- cis-convertedlinux
- Referencia
- CIS Red Hat Enterprise Linux 10 Benchmark v1.0.1 - 6.3.3.35
Verificar este host
Ejecute esto en un equipo que tenga permiso para auditar. El escaneo es de solo lectura.
tmaegis scan --target linux --level 2