Linux distributions
TMA-ROCKY9-6.1.2.7
Ensure rsyslog is not configured as a log server
Descrição
rsyslog can be configured to receive log messages from remote hosts over the network by loading a remote-input module (imtcp, imudp, imptcp, or imrelp) and starting a listener, which makes the host act as a central log server.
Como é verificado
Método de auditoria: Comando shell
alt0() { o=$(bash -c '#!/usr/bin/env bash
{
a_conf=(/etc/rsyslog.conf /etc/rsyslog.d/*.conf)
while IFS= read -r l_inc; do
for l_f in $l_inc; do
[ -d "$l_f" ] && a_conf+=("$l_f"/*.conf) || a_conf+=("$l_f")
done
done < <(grep -Psoih -- '"'"'^\h*(?:\$IncludeConfig\h+|include\h*\(\h*file\h*=\h*"?)\K[^")\h]+'"'"' "${a_conf[@]}" 2>/dev/null)
grep -Psi -- '"'"'^\h*module\(load="?(imtcp|imudp|imptcp|imrelp)"?\)'"'"' "${a_conf[@]}" 2>/dev/null
grep -Psi -- '"'"'^\h*input\(type="?(imtcp|imudp|imptcp|imrelp)"?'"'"' "${a_conf[@]}" 2>/dev/null
grep -Psi -- '"'"'^\h*\$ModLoad\h+(imtcp|imudp|imptcp|imrelp)\b'"'"' "${a_conf[@]}" 2>/dev/null
grep -Psi -- '"'"'^\h*\$(InputTCPServerRun|UDPServerRun|InputPTCPServerRun|InputRELPServerRun) \b'"'"' "${a_conf[@]}" 2>/dev/null
}' 2>&1); [ -z "$o" ] || { echo "step1: $o" | head -c 300; return 1; }; }; if alt0; then echo compliant; fi- Saída esperada
compliant
Como é corrigido
Método de correção: Orientação ou patch de infraestrutura
1. Should any active log server configuration be found by the audit, edit the file(s) where those directives appear - /etc/rsyslog.conf, a drop-in under /etc/rsyslog.d/, or any non-standard file identified by the audit's configuration discovery - and remove or comment out the remote-input module load, input, and run directives for all of imtcp, imudp, imptcp, and imrelp. Ensure none of the following entries are present: advanced format module(load="imtcp") module(load="imudp") module(load="imptcp") module(load="imrelp") input(type="imtcp" port="514") input(type="imudp" port="514") input(type="imptcp" port="514") input(type="imrelp" port="2514") deprecated legacy format $ModLoad imtcp $ModLoa…
Propriedades
- Sistemas operacionais
- rocky-9
- Tags
- cis-convertedlinux
- Referência
- CIS Rocky Linux 9 Benchmark v3.0.0 - 6.1.2.7
Verificar este host
Execute isto em uma máquina que você tenha permissão para auditar. A varredura é somente leitura.
tmaegis scan --target linux