STIGUI
V-222940CAT II — Medium severitySV-222940r1264530_rule

Remote hostname must be logged.

Rule version TCAT-AS-000250 · STIG v3 · 2026-08-26

Discussion

The access logfile format is defined within a Valve that implements the org.apache.catalina.valves.AccessLogValve interface within the /opt/tomcat/server.xml configuration file: The %h pattern code is included in the pattern element and logs the remote hostname. Including the hostname pattern in the log configuration provides useful information about the connecting host that is critical for troubleshooting and forensic investigations.

Check

As an elevated user on the Tomcat server:

Edit the $CATALINA_BASE/conf/server.xml file.

Review all "Valve" elements.

If the pattern= statement does not include %h, this is a finding.

EXAMPLE: <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="false"> ... <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log" suffix=".txt" pattern="%h %l %t %u &quot;%r&quot; %s %b" /> ... </Host>

Fix

As a privileged user on the Tomcat server:

Edit the $CATALINA_BASE/conf/server.xml file.

Modify the <Valve> element(s) nested within the <Host> element(s).

Change the AccessLogValve setting to include %h in the pattern= statement.

EXAMPLE: <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="false"> ... <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log" suffix=".txt" pattern="%h %l %t %u &quot;%r&quot; %s %b" /> ... </Host>

Restart the Tomcat server: sudo systemctl restart tomcat sudo systemctl daemon-reload

Identifiers

Group ID
V-222940
Group title
SRG-APP-000097-AS-000060
Rule ID
SV-222940r1264530_rule
Check ID
C-24612r426264_chk
Fix ID
F-24601r426265_fix