TCAT-AS-000260 - HTTP status code must be logged.


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.


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 %s in the pattern= statement.

<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' />

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

See Also

Item Details


References: 800-53|AU-3, CAT|III, CCI|CCI-000132, Rule-ID|SV-222941r879565_rule, STIG-ID|TCAT-AS-000260, STIG-Legacy|SV-111411, STIG-Legacy|V-102465, Vuln-ID|V-222941

Plugin: Unix

Control ID: de8ed129ebeb24de906b954e460a4e767d2b0cb7831b6dea64a5d1fb7f10294f