HSTS (RFC6797) HTTP Strict Transport Security
- Liferay Portal 6.2 CE GA1+
- Liferay Portal 6.2 EE GA1+
- Liferay Portal 6.1 CE GA2+
- Liferay Portal 6.1 EE GA2+
- Security Enabled: This app uses Liferay's PACL Security Manager.
- Disclaimer: This app was submitted by a Liferay employee but is in no way affiliated with Liferay, Inc. or its affiliates.
This app adds the HSTS header (RFC-6797) to https-responses. More information about HSTS (HTTP Strict Transport Security) can be found here:
While it's possible to configure frontend webservers to add this header automatically, this app enables you to conditionally handle anonymous users differently from logged in users: You can configure the timeout for both kinds of users differently, e.g. to totally disable HSTS for anonymous users, while enforcing it for logged in users.
Due to the nature of HSTS, this is browser based: Whenever a user logs on on a specific browser, that browser is forced into https in future, no matter if the user ever logs in again. The assumption is that whatever browser is used to log in to the system, it might be used to log in again. If nobody ever logged in from a certain browser and your site is public, you don't need to force them into https.
If a request is received through https, the header will be sent back. You will need to configure the timeout values in *Control Panel / Portal Settings / General*. The timeout is configured in seconds, i.e. one year (365 days) is equivalent to 31536000 seconds
To deactivate this header, undeploy the plugin (it does nothing but add the header) or just minimize the impact by specifying the max-age as 0
Note, due to the RFC-6797specification, this can only work properly under the following circumstances:
- Your server has a properly trusted - not a self-signed - certificate
- You access your site through https (HSTS does not work on http)
- You're running on the standard ports, 80 for http and 443 for https, e.g.
Sorry, I couldn't find the proper PACL configuration, so that this app runs without security manager. Check the source code (contained and on the linked website) for actual activity. Contribute PACL by sending a pullrequest on github.
This feature has been suggested in http://issues.liferay.com/browse/LPS-39213. Due to the nature (manipulating HTTPS response headers) there are no meaningful screenshots available for this application. The images you see are: The Response-Header Inspection of Firebug and the portal-ext.properties configuration that you need to override the default (safe) value of 30 seconds, so that the header is valid for a year.
- Fully configurable through Control Panel - no restart required after installation
- Supports separate anonymous and logged-in HSTS configuration
- Security Manager enabled
* Supports separate anonymous and logged-in HSTS configuration
* Security Manager enabled