CIS Apache Tomcat 10 Benchmark

Secure configuration guidelines for Apache Tomcat 10 application server

v1.1.0 August 2024

Overview

▶

This CIS Benchmark provides prescriptive guidance for establishing a secure configuration posture for Apache Tomcat 10. Recommendations cover installation hardening, connector security, logging, account management, and application security settings.

~75Recommendations
5Sections
2Profile Levels
SectionAreaFocus
1InstallationRemove defaults, file permissions
2Connector SecurityConnector config, TLS/SSL
3LoggingAccess logs, application logging
4Account ManagementRoles, users, default accounts
5Security ConfigurationServer hardening, session management

Profile Definitions

▶
ProfileDescriptionIntended Use
L1Level 1Essential security settings with minimal impact.
L2Level 2Defense-in-depth for high-security deployments.

1 — Installation

▶

1.1 Remove Defaults

▶
1.1.1 Remove Sample Applications (Automated)
L1 Auto
Description

This recommendation addresses remove sample applications on the Apache Tomcat 10 application server. Following this CIS benchmark guideline helps maintain a secure configuration and reduces the risk of compromise.

Rationale

Implementing this recommendation reduces the risk of security compromise on the Apache Tomcat 10 application server. Unaddressed configuration weaknesses are frequently targeted by attackers during both automated scans and manual penetration testing.

Audit
ls $CATALINA_HOME/webapps/examples \
   $CATALINA_HOME/webapps/docs \
   $CATALINA_HOME/webapps/ROOT 2>/dev/null
# Should not exist
Remediation
rm -rf $CATALINA_HOME/webapps/examples
rm -rf $CATALINA_HOME/webapps/docs
rm -rf $CATALINA_HOME/webapps/ROOT
1.1.2 Remove Manager & Host-Manager If Not Needed (Manual)
L1 Manual
Description

This recommendation addresses remove manager & host-manager if not needed on the Apache Tomcat 10 application server. Following this CIS benchmark guideline helps maintain a secure configuration and reduces the risk of compromise.

Rationale

Implementing this recommendation reduces the risk of security compromise on the Apache Tomcat 10 application server. Unaddressed configuration weaknesses are frequently targeted by attackers during both automated scans and manual penetration testing.

Audit
ls $CATALINA_HOME/webapps/manager \
   $CATALINA_HOME/webapps/host-manager 2>/dev/null
Remediation
# If manager apps are not required:
rm -rf $CATALINA_HOME/webapps/manager
rm -rf $CATALINA_HOME/webapps/host-manager
1.1.3 Disable Auto-Deployment (Automated)
L2 Auto
Description

Auto-Deployment should be disabled on the Apache Tomcat 10 application server. Disabling unnecessary features and services minimizes the attack surface and reduces the risk of exploitation.

Rationale

Leaving Auto-Deployment active when it is not needed creates an unnecessary attack vector. Disabling it reduces the risk of exploitation and simplifies the security management of the Apache Tomcat 10 application server.

Audit
grep -i 'autoDeploy' $CATALINA_HOME/conf/server.xml
# Should be autoDeploy="false"
Remediation
<!-- In server.xml, set Host attributes: -->
<Host ... autoDeploy="false" deployOnStartup="false">

1.2 File Permissions

▶
1.2.1 Ensure CATALINA_HOME Ownership Is Correct (Automated)
L1 Auto
Description

This recommendation verifies that CATALINA_HOME Ownership Is Correct on the Apache Tomcat 10 application server. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to cATALINA_HOME Ownership Is Correct may leave the Apache Tomcat 10 application server vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
ls -ld $CATALINA_HOME
# Should be owned by tomcat:tomcat (or dedicated user)
Remediation
chown -R tomcat:tomcat $CATALINA_HOME
1.2.2 Ensure Conf Directory Permissions Are Restricted (Automated)
L1 Auto
Description

This setting ensures that Conf Directory Permissions is restricted on the Apache Tomcat 10 application server. Restricting this capability limits potential abuse and enforces the principle of least privilege across the environment.

Rationale

Unrestricted Conf Directory Permissions could allow unauthorized users or processes to perform actions beyond their intended scope. Applying least-privilege principles to the Apache Tomcat 10 application server is essential for defense in depth.

Audit
stat -c '%a' $CATALINA_HOME/conf
stat -c '%a' $CATALINA_HOME/conf/*
# conf/ should be 700, files 600
Remediation
chmod 700 $CATALINA_HOME/conf
chmod 600 $CATALINA_HOME/conf/*
1.2.3 Run Tomcat as a Non-Root User (Automated)
L1 Auto
Description

This recommendation addresses run tomcat as a non-root user on the Apache Tomcat 10 application server. Following this CIS benchmark guideline helps maintain a secure configuration and reduces the risk of compromise.

Rationale

Implementing this recommendation reduces the risk of security compromise on the Apache Tomcat 10 application server. Unaddressed configuration weaknesses are frequently targeted by attackers during both automated scans and manual penetration testing.

Audit
ps aux | grep '[c]atalina' | awk '{print $1}'
# Should NOT be root
Remediation
# Create a dedicated user:
useradd -r -s /usr/sbin/nologin tomcat
chown -R tomcat:tomcat $CATALINA_HOME
# Start Tomcat as the tomcat user

2 — Connector Security

▶

2.1 Connector Configuration

▶
2.1.1 Disable the Shutdown Port (Automated)
L1 Auto
Description

the Shutdown Port should be disabled on the Apache Tomcat 10 application server. Disabling unnecessary features and services minimizes the attack surface and reduces the risk of exploitation.

Rationale

Leaving the Shutdown Port active when it is not needed creates an unnecessary attack vector. Disabling it reduces the risk of exploitation and simplifies the security management of the Apache Tomcat 10 application server.

Audit
grep 'port=' $CATALINA_HOME/conf/server.xml | head -1
# <Server port="-1" shutdown="SHUTDOWN">
Remediation
<!-- In server.xml: -->
<Server port="-1" shutdown="SHUTDOWN">
2.1.2 Set Custom Error Pages (Automated)
L1 Auto
Description

This recommendation addresses the configuration of Custom Error Pages on the Apache Tomcat 10 application server. Proper configuration ensures alignment with CIS security guidelines and reduces exposure to known attack vectors.

Rationale

An improperly configured Custom Error Pages may create security weaknesses that attackers can exploit. Following the CIS recommendation ensures a consistent and auditable security posture for the Apache Tomcat 10 application server.

Audit
grep -A 2 'error-page' $CATALINA_HOME/conf/web.xml
Remediation
<!-- In conf/web.xml, add custom error pages: -->
<error-page>
  <error-code>404</error-code>
  <location>/error.html</location>
</error-page>
<error-page>
  <error-code>500</error-code>
  <location>/error.html</location>
</error-page>
2.1.3 Ensure Server Header Is Not Disclosed (Automated)
L1 Auto
Description

This recommendation verifies that Server Header Is Not Disclosed on the Apache Tomcat 10 application server. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to server Header Is Not Disclosed may leave the Apache Tomcat 10 application server vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep 'server=' $CATALINA_HOME/conf/server.xml
# Connector should have server="" attribute
Remediation
<!-- In each Connector element in server.xml: -->
<Connector ... server=" " />
2.1.4 Ensure X-Powered-By Header Is Disabled (Automated)
L1 Auto
Description

This setting controls whether X-Powered-By Header is disabled on the Apache Tomcat 10 application server. Disabling this feature reduces the attack surface by removing unnecessary functionality that could be exploited by an attacker.

Rationale

Leaving X-Powered-By Header enabled when it is not required unnecessarily expands the attack surface. An attacker could leverage this feature to gain unauthorized access or escalate privileges on the Apache Tomcat 10 application server.

Audit
grep 'xpoweredBy' $CATALINA_HOME/conf/server.xml
# Should be xpoweredBy="false"
Remediation
<Connector ... xpoweredBy="false" />

2.2 TLS / SSL

▶
2.2.1 Ensure TLS Is Enabled for All Connectors (Automated)
L1 Auto
Description

This recommendation verifies that TLS Is Enabled for All Connectors on the Apache Tomcat 10 application server. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to tLS Is Enabled for All Connectors may leave the Apache Tomcat 10 application server vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep -E 'SSLEnabled|sslProtocol' $CATALINA_HOME/conf/server.xml
Remediation
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
           SSLEnabled="true" maxThreads="150" scheme="https" secure="true">
  <SSLHostConfig>
    <Certificate certificateKeystoreFile="conf/keystore.jks"
                 certificateKeystorePassword="changeit" type="RSA" />
  </SSLHostConfig>
</Connector>
2.2.2 Ensure Weak SSL/TLS Protocols Are Disabled (Automated)
L1 Auto
Description

This setting controls whether Weak SSL/TLS Protocols is disabled on the Apache Tomcat 10 application server. Disabling this feature reduces the attack surface by removing unnecessary functionality that could be exploited by an attacker.

Rationale

Leaving Weak SSL/TLS Protocols enabled when it is not required unnecessarily expands the attack surface. An attacker could leverage this feature to gain unauthorized access or escalate privileges on the Apache Tomcat 10 application server.

Audit
grep 'sslEnabledProtocols' $CATALINA_HOME/conf/server.xml
Remediation
<SSLHostConfig sslProtocol="TLS"
               protocols="TLSv1.3,TLSv1.2">

3 — Logging

▶

3.1 Access Logging

▶
3.1.1 Ensure AccessLogValve Is Configured (Automated)
L1 Auto
Description

This recommendation addresses the proper configuration of AccessLogValve on the Apache Tomcat 10 application server. Proper configuration ensures the component operates securely and in accordance with organizational security policies.

Rationale

Misconfiguration of AccessLogValve can lead to security gaps that may be exploited by attackers. A properly configured Apache Tomcat 10 application server reduces exposure to both known vulnerabilities and configuration drift.

Audit
grep 'AccessLogValve' $CATALINA_HOME/conf/server.xml
Remediation
<!-- In each Host element in server.xml: -->
<Valve className="org.apache.catalina.valves.AccessLogValve"
       directory="logs" prefix="access_log" suffix=".txt"
       pattern="%h %l %u %t &quot;%r&quot; %s %b %D" />
3.1.2 Ensure Log Files Are Rotated (Automated)
L1 Auto
Description

This recommendation verifies that Log Files Are Rotated on the Apache Tomcat 10 application server. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to log Files Are Rotated may leave the Apache Tomcat 10 application server vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep 'rotatable' $CATALINA_HOME/conf/server.xml
# Default is true — verify it is not set to false
Remediation

Ensure rotatable="true" (default) is set on the AccessLogValve and configure external log rotation for catalina.out.

3.2 Application Logging

▶
3.2.1 Ensure Logging Level Is INFO or Higher (Automated)
L1 Auto
Description

This recommendation verifies that Logging Level Is INFO or Higher on the Apache Tomcat 10 application server. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to logging Level Is INFO or Higher may leave the Apache Tomcat 10 application server vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep '.level' $CATALINA_HOME/conf/logging.properties
# Levels should be INFO, WARNING, or SEVERE — not FINE/FINER/FINEST
Remediation
# In conf/logging.properties:
.handlers = 1catalina.org.apache.juli.AsyncFileHandler, java.util.logging.ConsoleHandler
1catalina.org.apache.juli.AsyncFileHandler.level = INFO

4 — Account Management

▶

4.1 Roles & Users

▶
4.1.1 Remove Default Users from tomcat-users.xml (Automated)
L1 Auto
Description

This recommendation addresses remove default users from tomcat-users.xml on the Apache Tomcat 10 application server. Following this CIS benchmark guideline helps maintain a secure configuration and reduces the risk of compromise.

Rationale

Implementing this recommendation reduces the risk of security compromise on the Apache Tomcat 10 application server. Unaddressed configuration weaknesses are frequently targeted by attackers during both automated scans and manual penetration testing.

Audit
cat $CATALINA_HOME/conf/tomcat-users.xml
# Should not contain default users (admin, tomcat, role1, etc.)
Remediation
<!-- Remove or comment out all default user/role entries.
     Only define necessary users with strong passwords. -->
4.1.2 Use LockOutRealm to Prevent Brute-Force Attacks (Automated)
L1 Auto
Description

This recommendation addresses use lockoutrealm to prevent brute-force attacks on the Apache Tomcat 10 application server. Following this CIS benchmark guideline helps maintain a secure configuration and reduces the risk of compromise.

Rationale

Implementing this recommendation reduces the risk of security compromise on the Apache Tomcat 10 application server. Unaddressed configuration weaknesses are frequently targeted by attackers during both automated scans and manual penetration testing.

Audit
grep 'LockOutRealm' $CATALINA_HOME/conf/server.xml
Remediation
<Realm className="org.apache.catalina.realm.LockOutRealm"
       failureCount="5" lockOutTime="300">
  <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
         resourceName="UserDatabase"/>
</Realm>
4.1.3 Restrict Manager Application Access by IP (Automated)
L2 Auto
Description

Access to Manager Application Access by IP should be restricted on the Apache Tomcat 10 application server. Limiting access enforces the principle of least privilege and prevents unauthorized use of sensitive functionality.

Rationale

Implementing this recommendation reduces the risk of security compromise on the Apache Tomcat 10 application server. Unaddressed configuration weaknesses are frequently targeted by attackers during both automated scans and manual penetration testing.

Audit
cat $CATALINA_HOME/webapps/manager/META-INF/context.xml
# Check RemoteAddrValve allow pattern
Remediation
<Context antiResourceLocking="false" privileged="true">
  <Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="127\.0\.0\.1|::1|10\.0\.0\.\d+" />
</Context>

5 — Security Configuration

▶

5.1 Server Hardening

▶
5.1.1 Enable Security Manager (Manual)
L2 Manual
Description

Security Manager should be enabled on the Apache Tomcat 10 application server. Enabling this security feature provides additional protection and aligns the configuration with CIS benchmark recommendations.

Rationale

Without Security Manager, the Apache Tomcat 10 application server may lack a critical defense layer. Enabling this control provides additional protection against common threats and aligns the configuration with security best practices.

Audit
# Check if Tomcat was started with -security flag:
ps aux | grep catalina | grep '\-security'
Remediation
# Start Tomcat with Security Manager:
$CATALINA_HOME/bin/catalina.sh start -security
# Configure catalina.policy for required permissions
5.1.2 Ensure CSRF Prevention Filter Is Enabled (Automated)
L1 Auto
Description

This setting controls whether CSRF Prevention Filter is enabled on the Apache Tomcat 10 application server. Enabling this feature strengthens the security posture by enforcing the recommended configuration via server.xml, web.xml, or Tomcat configuration files.

Rationale

Without CSRF Prevention Filter enabled, the Apache Tomcat 10 application server may lack critical protections against known attack vectors. Enabling this control mitigates risk and aligns the deployment with industry-accepted security baselines.

Audit
grep 'CsrfPreventionFilter' $CATALINA_HOME/conf/web.xml
Remediation
<!-- In conf/web.xml: -->
<filter>
  <filter-name>CsrfPreventionFilter</filter-name>
  <filter-class>org.apache.catalina.filters.CsrfPreventionFilter</filter-class>
</filter>
5.1.3 Ensure Directory Listing Is Disabled (Automated)
L1 Auto
Description

This setting controls whether Directory Listing is disabled on the Apache Tomcat 10 application server. Disabling this feature reduces the attack surface by removing unnecessary functionality that could be exploited by an attacker.

Rationale

Leaving Directory Listing enabled when it is not required unnecessarily expands the attack surface. An attacker could leverage this feature to gain unauthorized access or escalate privileges on the Apache Tomcat 10 application server.

Audit
grep -A 5 'DefaultServlet' $CATALINA_HOME/conf/web.xml | grep 'listings'
# Should be <param-value>false</param-value>
Remediation
<!-- In the default servlet definition in conf/web.xml: -->
<init-param>
  <param-name>listings</param-name>
  <param-value>false</param-value>
</init-param>
5.1.4 Ensure HttpHeaderSecurityFilter Is Configured (Automated)
L1 Auto
Description

This recommendation addresses the proper configuration of HttpHeaderSecurityFilter on the Apache Tomcat 10 application server. Proper configuration ensures the component operates securely and in accordance with organizational security policies.

Rationale

Misconfiguration of HttpHeaderSecurityFilter can lead to security gaps that may be exploited by attackers. A properly configured Apache Tomcat 10 application server reduces exposure to both known vulnerabilities and configuration drift.

Audit
grep 'HttpHeaderSecurityFilter' $CATALINA_HOME/conf/web.xml
Remediation
<filter>
  <filter-name>httpHeaderSecurity</filter-name>
  <filter-class>org.apache.catalina.filters.HttpHeaderSecurityFilter</filter-class>
  <init-param>
    <param-name>hstsEnabled</param-name>
    <param-value>true</param-value>
  </init-param>
</filter>

5.2 Session Management

▶
5.2.1 Ensure Session Timeout Is Set (Automated)
L1 Auto
Description

This recommendation configures the timeout for Session on the Apache Tomcat 10 application server. Appropriate timeout values limit the window of opportunity for attacks and ensure resources are released in a timely manner.

Rationale

Failure to session Timeout Is Set may leave the Apache Tomcat 10 application server vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep 'session-timeout' $CATALINA_HOME/conf/web.xml
# Should be 15 minutes or less
Remediation
<session-config>
  <session-timeout>15</session-timeout>
</session-config>
5.2.2 Ensure Session Cookies Are Secure (Automated)
L1 Auto
Description

This recommendation verifies that Session Cookies Are Secure on the Apache Tomcat 10 application server. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to session Cookies Are Secure may leave the Apache Tomcat 10 application server vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
grep -A 5 'cookie-config' $CATALINA_HOME/conf/web.xml
Remediation
<session-config>
  <session-timeout>15</session-timeout>
  <cookie-config>
    <http-only>true</http-only>
    <secure>true</secure>
  </cookie-config>
  <tracking-mode>COOKIE</tracking-mode>
</session-config>