RHEL 9 must be configured so that the rsyslog daemon does not accept log messages from other servers unless the server is being used for log aggregation.

STIG ID: RHEL-09-652025  |  SRG: SRG-OS-000480-GPOS-00227 |  Severity: medium |  CCI: CCI-000366 |  Vulnerability Id: V-258143

Vulnerability Discussion

Unintentionally running a rsyslog server accepting remote messages puts the system at increased risk. Malicious rsyslog messages sent to the server could exploit vulnerabilities in the server software itself, could introduce misleading information into the system's logs, or could fill the system's storage leading to a denial of service.

If the system is intended to be a log aggregation server, its use must be documented with the information system security officer (ISSO).

Check

Note: If the system administrator can demonstrate that another tool (e.g., SPLUNK) is being used to manage log offload and aggregation in lieu of rsyslog, this check is not applicable.

Verify that RHEL 9 is not configured to receive remote logs using rsyslog with the following commands:

$ ss -tulnp | grep rsyslog

If no output is returned, rsyslog is not listening for remote logs.

If output appears, check for configured ports (514 is the default for syslog).

Check for remote logging configuration in rsyslog by examining the rsyslog configuration files:

$ sudo grep -E 'InputTCPServerRun | UDPServerRun' /etc/rsyslog.conf /etc/rsyslog.d/*

If uncommented lines are returned, this is a finding.

Fix

Configure RHEL 9 to not receive remote logs using rsyslog.

Remove the lines in /etc/rsyslog.conf and any files in the /etc/rsyslog.d directory that match any of the following:
module(load="imtcp")
module(load="imudp")
module(load="imrelp")
input(type="imudp" port="514")
input(type="imtcp" port="514")
input(type="imrelp" port="514")

The rsyslog daemon must be restarted for the changes to take effect:

$ sudo systemctl restart rsyslog.service