Apache Tomcat Security: 8 Practical Hardening Checks
Apache Tomcat security depends on more than a working HTTPS endpoint. The application connector, deployment channel, administrative applications, operating-system permissions and upstream proxy each create a boundary that needs a clear owner.
This guide explains eight practical hardening checks, with examples designed to make the result verifiable. It covers standalone Tomcat and the operational questions to ask about embedded deployments. Use the documentation branch matching your installation; settings from one release should not be copied blindly into another.
Technical review: 30 October 2026. Test configuration examples against your installed product version before using them in production.
1. Start Apache Tomcat security with a supported branch
Apache’s version matrix currently lists Tomcat 11.0, 10.1 and 9.0 as supported branches. Tomcat 11 requires Java 17 or later, 10.1 requires Java 11 or later, and 9.0 supports Java 8 or later. These are minimum runtime requirements, not a recommendation to keep an old JDK unpatched.
Tomcat 9 uses the older Java EE-era APIs, while Tomcat 10.1 and 11 use Jakarta APIs. Moving a WAR across that boundary can require dependency and source changes. Confirm application compatibility, framework support and the Java runtime together.
Check the current version matrix and the security page for your branch before each upgrade. Select a currently maintained patch release rather than freezing the patch number printed in a blog. For embedded Tomcat, follow the application’s supported dependency-management path and verify what is actually packaged.
2. Map connectors, applications and deployment paths
Record CATALINA_HOME, CATALINA_BASE, Java version, listening addresses, proxy routes and deployed contexts. Identify who can write the WAR, modify configuration or change the service definition. An inventory should distinguish a public application port from management access.
An Apache Tomcat security review should trace the public connector and the separate administrative access path.
# Linux examples; service names and installation paths vary
systemctl status tomcat --no-pager
ss -lnt
# If the script exists in this installation:
${CATALINA_HOME}/bin/version.sh
Compare that record with what is reachable from your authorised test networks. A local port listing does not prove that a cloud firewall, container port mapping or load balancer is configured correctly.
3. Keep Manager and Host Manager off public paths
The Manager application can deploy or remove applications. Remove administrative and example applications you do not need. Where Manager is required, constrain its network path and grant only the role needed by the human or automation account.
Tomcat distinguishes roles such as manager-gui, manager-script and manager-status. Do not give a single account every role for convenience. Review the Manager documentation, particularly the separation between browser and scripted access.
The following is an illustrative Context-level address restriction for a lab management application on a current branch. Replace the documentation-only network with your approved management network, and verify the Valve is available in your branch:
<Valve className="org.apache.catalina.valves.RemoteCIDRValve"
allow="127.0.0.1/32,::1/128,192.0.2.0/24" />
It is not an authentication configuration and must not replace one. Test from both permitted and denied addresses. If the connector sees only a proxy address, establish trustworthy client-address handling before relying on an IP restriction.
4. Define which proxy may supply forwarded information
Tomcat behind a proxy may need the original scheme and client address for redirects, secure cookies, logs and access decisions. Configure trusted proxy handling explicitly; do not accept forwarded headers from arbitrary external clients.
Keep documented owners for Apache Tomcat security exceptions, including proxy and deployment permissions.
Restrict direct access to the backend connector. Otherwise, a user may bypass a gateway or supply headers that the application incorrectly treats as authoritative. Use the Remote IP Valve reference to review proxy matching, header names and logging behaviour.
A useful validation case is a request arriving through the approved proxy and a second authorised test request attempting the direct backend route. Record the client identity and scheme observed by the application in each case.
5. Test TLS through the complete request path
Document where encryption terminates and whether the backend hop needs TLS under your network and compliance requirements. Plan certificate renewal, hostname verification and trust-store updates together. A temporary laboratory certificate is not an adequate production trust model.
# Public endpoint checks; replace with your own hostname
curl -I https://app.example.com/
openssl s_client -connect app.example.com:443 \
-servername app.example.com -verify_return_error </dev/null
Also test a real sign-in, redirect and session-cookie flow. A successful TLS handshake does not validate application authorisation or prove that the reverse proxy preserves the intended scheme.
6. Limit what the service account can modify
Run the service without unnecessary root or administrator privileges. Separate deployable code and configuration from writable uploads, logs and temporary files. Review ownership and access rather than applying broad recursive permission commands.
For a deployment review, ask a concrete question: if application code is compromised, which files and external services can that identity change? Restrict cloud roles, database credentials and deployment tokens as part of the same assessment.
Keep secrets out of WAR files and container images. If the application runs on Kubernetes, our guide to Kubernetes Secrets management explains the delivery and rotation boundaries.
Verify Apache Tomcat security changes with application tests and an administrative recovery check.
7. Review application behaviour as well as server settings
Validate authentication, role mapping, session handling, upload processing and error responses at the application layer. A web.xml security constraint is not an IP allowlist, and stacking authenticator Valves is not a general recipe for multifactor authentication.
Follow the security considerations for your branch when reviewing default applications, connectors and error reporting. Removing version information can reduce unnecessary disclosure, but it does not fix vulnerable code. Dependency updates and application security testing remain separate work.
Set request and resource boundaries based on measurements. A very large connector thread pool can move the bottleneck into a database connection pool rather than improve throughput. Test representative concurrency before calling a setting a hardening improvement.
8. Give every hardening change a test and rollback
- Capture the existing configuration and a recoverable deployment artifact.
- Apply one reviewed change in a representative environment.
- Check normal application traffic and administrative denials.
- Inspect access and application logs without exposing session tokens.
- Load-test important paths and verify dependency capacity.
- Record the evidence, owner and rollback trigger.
Apache Tomcat security: frequently asked questions
Should every application move immediately to Tomcat 11?
Choose a supported branch compatible with the application and runtime, then plan and test migration. A major-version upgrade is not just a binary replacement.
Does hiding the server banner secure Tomcat?
No. It is only one disclosure control. Patch state, permissions, management exposure and application vulnerabilities matter more.
Can a startup check replace functional testing?
No. A running process can still have broken redirects, excessive access or an unavailable database. Validate the end-to-end paths users and operators rely on.
Official references
- Tomcat 11 security considerations
- Tomcat 10.1 security considerations
- Apache Tomcat security advisories
Related reading: Reload Apache Configuration Safely: 5 Practical Steps · Penetration Testing and Why is it Important ?
Keep exploring: See all security and encryption guides.





Leave a Reply