| name | cis-tomcat8-v100-10.18 |
| description | Use the logEffectiveWebXml and metadata-complete settings for deploying applications in production (Automated) |
| category | cis-tomcat |
| version | 1.0.0 |
| author | cyberstrike-official |
| tags | ["cis","tomcat","linux","java","configuration","hardening","security","deployment"] |
| cis_id | 10.18 |
| cis_benchmark | CIS Apache Tomcat 8 Benchmark v1.0.0 |
| tech_stack | ["linux","tomcat","java"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
10.18 Use the logEffectiveWebXml and metadata-complete settings for deploying applications in production (Automated)
Description
Both fragments and annotations give rise to security concerns. web.xml contains a metadata-complete attribute on the web-app element whose binary value defines whether other sources of metadata should be considered when deploying this web application, this includes annotations on class files (@WebServlet, but also @WebListener, @WebFilter, ...), web-fragment.xml as well as classes located in WEB-INF/classes. In addition, you can also allow you to log the effective web.xml, when an application starts, and the effective web.xml is the result of taking the main web.xml for your application merging in all the fragments applying all the annotations. By logging that, you are able to review it, and see if that is in fact what you actually want.
Rationale
Enable logEffectiveWebXml will allow you to log the effective web.xml and you are able to see if that is in fact what you actually want. Enable metadata-complete so that the web.xml is the only metadata considered.
Audit Procedure
- Review each application's
web.xml file located in the applications $CATALINA_HOME/webapps/<app_name>/WEB-INF/web.xml and determine if the logEffectiveWebXml is properly is set.
<web-app
...
metadata-complete="true"
...
>
- Review each application's
context.xml file located in the applications $CATALINA_HOME/webapps/<app_name>/META-INF/context.xml and determine if the metadata-complete property is set.
<Context
...
logEffectiveWebXml="true"
...
>
Remediation
- Set the
metadata-complete value in the in each of the applications to .