SameSite cookie attribute
For secure web communication, Google has mandated the usage of theSameSite
cookie attribute. By complying with Google Chrome’s newSameSite
policy, the NetScaler appliance can manage third-party cookies with theSameSite
attribute set in theset-cookie
header. The cookie setting mitigates attacks and provides a secured web communication.
Until February 2020, theSameSite
attribute was not explicitly set in the cookie. The browser took the default value as “None.” However, with certain browser upgrade, such as Google Chrome 80, there is a change in the default cross-domain behavior in cookies.
Setting cookie attribute value
TheSameSite
attribute is set to one of the following values and for the Google Chrome browser, the default value is set as “Lax.”
None.表明requ浏览器使用cookieests in the cross-site context only on secure connections.
Lax.表明requ浏览器使用cookieests in the same-site context. In the cross-site context, only safe HTTP methods like GET request can use the cookie.
Strict.Use the cookie only when the user is requesting for the domain explicitly.
Note:
If set-cookies (including firewall session cookies) have the
SameSite
attribute and if theaddcookiesamesite
attribute flag is enabled in the Web Application Firewall profile, then theSameSite
attribute is overwritten according to the value configured in the profile.
Configure the SameSite attribute in the Web App Firewall profile by using the CLI
To configure theSameSite
attribute, you must complete the following steps:
- Enable the
SameSite
cookie attribute. - Set the cookie attribute for the appfw session cookies.
Enable the `Samesite’ cookie attribute
At the command prompt, type:
set appfw profile
Example:
set appfw profile p1 –insertCookieSameSiteAttribute ON
Set same site cookie attribute value for Web Application Firewall session cookies
At the command prompt, type:
set appfw profile
Example:
set appfw profile p1 – cookieSameSiteAttribute LAX
Where attribute types are,
None.Cookie attribute SameSite is set to “none” and marked secure for all WAF and application cookies.
Lax.Cookie attribute SameSite is set to “Lax” for all WAF and application cookies.
Strict.Cookie attribute SameSite is set to “Lax” for all WAF and application cookies.
Configure the SameSite cookie attribute in the Web App Firewall profile by using the GUI
- Navigate toSecurity > NetScaler Web App Firewall > Profiles.
- In the details pane, select a profile and clickEdit.
- In theNetScaler Web App Firewall Profilepage, clickProfile SettingsunderAdvanced Settings.
InProfile Settingssection set the following parameters:
a. Insert the cookie
Samesite
attribute. Select the check box to enable the cookieSamesite
attribute. b. Cookie Samesite Attribute. Select an option from the drop-down list to set theSamesite
cookie value.- ClickOKandDone.