Issue
-
In a security scan for our PaaS application, we see that some cookies do not have HTTPOnly, Secure and/or SameSite attributes. How can we apply these attributes to our PaaS NGINX instance?
Environment
- Liferay DXP 7.4+
- Liferay PaaS 4.x+
Resolution
- Create an ssl.conf file in the
/webserver/configs/{env}/conf.dfolder of your project repository. - Add
proxy_cookie_path / "/; HTTPOnly; Secure; SameSite=strict";to the ssl.conf file.- This example uses "strict," but you can adjust this according to your use case.
- Create a new build including these changes and deploy it to your environment.
- Check the cookies
Please note that in this example, the LFR_SESSION_STATE is not flagged with SameSite (can be set at the webserver level) or HTTPOnly (reason is explained in this article, and related code in 7.4 can be found here).