TMAegisBeta
Más reglas para linux

Linux distributions

TMA-RHEL10-6.2.3.4

Ensure rsyslog log file creation mode is configured

MediaNivel 1Automatizadalinux

Descripción

rsyslog will create logfiles that do not already exist on the system. The $FileCreateMode parameter allows you to specify the creation mode with which rsyslog creates new files. If not specified, the value 0644 is used (which retains backward-compatibility with earlier releases). The value given must always be a 4-digit octal number, with the initial digit being zero. Please note that the actual permission depend on rsyslogd’s process umask. $FileCreateMode may be specified multiple times. If so, it specifies the creation mode for all selector lines that follow until the next $FileCreateMode p

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; }; o=$(bash -c 'grep -Ps '"'"'^\h*\$FileCreateMode\h+0[0,2,4,6][0,2,4]0\b'"'"' /etc/rsyslog.conf /etc/rsyslog.d/*.conf' 2>&1); printf '%s\n' "$o" | tr -s ' \t' '  ' | sed 's/^ //;s/ $//' | grep -Fxq -- '$FileCreateMode 0640' || { echo step1: missing '$FileCreateMode 0640'; 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 either /etc/rsyslog.conf or a dedicated .conf file in /etc/rsyslog.d/ and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640 Restart the service: # systemctl restart rsyslog

Propiedades

Sistemas operativos
rhel-10
Etiquetas
cis-convertedlinux
Referencia
CIS Red Hat Enterprise Linux 10 Benchmark v1.0.1 - 6.2.3.4

Verificar este host

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

shell
tmaegis scan --target linux