TCAT-AS-000030 - HTTP Strict Transport Security (HSTS) must be enabled.

Warning! Audit Deprecated

This audit has been deprecated and will be removed in a future update.

View Next Audit Version

Information

HTTP Strict Transport Security (HSTS) instructs web browsers to only use secure connections for all future requests when communicating with a website. Doing so helps prevent SSL protocol attacks, SSL stripping, cookie hijacking, and other attempts to circumvent SSL protection.

Implementing HSTS requires testing of your web applications to ensure SSL certificates align correctly with application requirements and sub-domains if sub-domains are used. Ensure certificates are installed and working correctly. If sub-domains are in use, all sub-domains must be covered in the SSL/TLS certificate and the includeSubDomains directive must be specified in order for HSTS to function properly.

Solution

From the Tomcat server as a privileged user, edit the web.xml file:

sudo nano $CATALINA_BASE/conf/web.xml file.

Uncomment the existing httpHeaderSecurity filter section or create the filter section using the following code:

NOTE: includeSubDomains param-value and url-pattern values may change and can vary according to local deployment requirements.
<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>
<init-param>
<param-name>maxAgeSeconds</param-name>
<param-value>31536000</param-value>
</init-param>
<init-param>
<param-name>includeSubDomains</param-name>
<param-value>true</param-value>
</init-param>
<async-supported>true</async-supported>
</filter>

Create or uncomment the httpHeaderSecurity filter mapping:
<filter-mapping>
<filter-name>httpHeaderSecurity</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>

See Also

https://dl.dod.cyber.mil/wp-content/uploads/stigs/zip/U_Apache_Tomcat_Application_Server_9_V2R2_STIG.zip

Item Details

References: CAT|III, CCI|CCI-001453, Rule-ID|SV-222928r616154_rule, STIG-ID|TCAT-AS-000030, STIG-Legacy|SV-111375, STIG-Legacy|V-102431, Vuln-ID|V-222928

Plugin: Unix

Control ID: 38664665b09f2e4f3229cd1e34039c8a9184f49624a32cd543e49a42ae4f2cd7