How to enable HTTP Security, HttpOnly, and SameSite DX cookies in HCL DX
Applies to
HCL Digital Experience v9.5 and higher
Introduction
This article provides the steps to enable different HTTP-related security flags and attributes in your HCL Digital Experience (DX) environment through the IBM WebSphere Application Server (WAS) and NGINX Ingress controller. The following security flags and attributes will be discussed:
- Cookie with a Secure flag: Allows a cookie to only be transmitted over an encrypted connection (for example, HTTPS).
- Cookie With a HttpOnly flag: Prevents a cookie from being accessed by client-side APIs such as JavaScript.
- Cookie with a SameSite attribute: Controls where a browser sends cookies. Possible values are
strict,lax, ornone.
Instructions
You can enable the security flags and attributes through the following:
- IBM WAS
- NGINX Ingress
- NGINX Ingress Enterprise
Enabling through the WebSphere Application Server
- In IBM WAS, navigate to Security > Global Security > Web and SIP security > Single sign-on (SSO).
- Tick the
Enabledcheckbox to enable SSL. - Tick the
Set security cookies to HTTPOnly to help prevent cross-site scripting attackscheckbox - Click Apply.
- Click Save at the top of the console messages.
-
Configure the
JSESSIONIDcookie:- Navigate to Server > Server Types > Web application servers > <\server_name> > Web Container Settings > Web container > Session management > Enable cookies
- Tick the
Restrict cookies to HTTPS sessionscheckbox. - Tick the
Set session cookies to HTTPOnly to help prevent cross-site scripting attackscheckbox. - Click Apply.
- Click Save at the top of the console messages.
Enabling through NGINX Ingress
-
In your
custom-values.yamlfile, set the following parameters:apiVersion: networking.k8s.io/v1 kind: Ingress metadata: annotations: nginx.ingress.kubernetes.io/proxy-cookie-path: | / "/; HTTPOnly; Secure; SameSite=strict" -
Perform a Helm upgrade to apply your changes.
Enabling through NGINX Ingress Enterprise
-
In your
custom-values.yamlfile, set the following parameters:apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: cafe-ingress-with-annotations annotations: nginx.org/server-snippets: | proxy_cookie_path / "/; secure; HttpOnly; SameSite=strict"; -
Perform a Helm upgrade to apply your changes.