TMAegis베타
linux 관련 규칙 더 보기

Linux distributions

TMA-RHEL9-6.1.2.7

Ensure rsyslog is not configured as a log server

보통레벨 1자동linux

설명

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.

점검 방법

감사 방식: 셸 명령

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
예상 출력
compliant

조치 방법

조치 방식: 가이드 또는 인프라 패치

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…

속성

운영 체제
rhel-9
태그
cis-convertedlinux
참고 자료
CIS Red Hat Enterprise Linux 9 Benchmark v3.0.0 - 6.1.2.7

이 호스트 점검하기

감사 권한이 있는 시스템에서 실행하세요. 스캔은 읽기 전용입니다.

shell
tmaegis scan --target linux