UCF STIG Viewer Logo

HTTP status code must be logged.


Overview

Finding ID Version Rule ID IA Controls Severity
V-222941 TCAT-AS-000260 SV-222941r615938_rule Low
Description
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 %s pattern code is included in the pattern element and logs the server response code associated with the event e.g. 200 OK or 400 Bad Request. Including the status pattern in the log configuration provides useful server response information about the event which is critical for troubleshooting and forensic investigations.
STIG Date
Apache Tomcat Application Sever 9 Security Technical Implementation Guide 2020-12-11

Details

Check Text ( C-24613r426267_chk )
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 %s, this is a finding.

EXAMPLE:
unpackWARs="true" autoDeploy="false">
...
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %t %u "%r" %s %b" />
...
Fix Text (F-24602r426268_fix)
As a privileged user on the Tomcat server:

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

Modify the element(s) nested within the element(s).

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

EXAMPLE:
unpackWARs="true" autoDeploy="false">
...
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %t %u "%r" %s %b" />
...


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