TMAegisBeta
Weitere Regeln für linux

Linux distributions

TMA-RHEL9-6.1.2.7

Ensure rsyslog is not configured as a log server

MittelStufe 1Automatisiertlinux

Beschreibung

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.

So wird geprüft

Prüfmethode: Shell-Befehl

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
Erwartete Ausgabe
compliant

So wird behoben

Behebungsmethode: Anleitung oder Infrastruktur-Patch

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…

Eigenschaften

Betriebssysteme
rhel-9
Tags
cis-convertedlinux
Referenz
CIS Red Hat Enterprise Linux 9 Benchmark v3.0.0 - 6.1.2.7

Diesen Host prüfen

Führen Sie dies auf einem Rechner aus, den Sie prüfen dürfen. Der Scan ist schreibgeschützt.

shell
tmaegis scan --target linux