-
Notifications
You must be signed in to change notification settings - Fork 499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow SameSite cookie attribute to be configured #11210
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
### SameSite Cookie Attribute | ||
|
||
The SameSite cookie attribute is defined in an upcoming revision to [RFC 6265](https://datatracker.ietf.org/doc/html/rfc6265) (HTTP State Management Mechanism) called [6265bis](https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis-19>) ("bis" meaning "repeated"). The possible values are "None", "Lax", and "Strict". "Strict" is intended to help prevent Cross-Site Request Forgery (CSRF) attacks, as described in the RFC proposal and an OWASP [cheetsheet](https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#samesite-cookie-attribute). "Lax" is a middle ground between "Strict" and "None". | ||
|
||
New Dataverse installations are now set to "Lax" out of the box by the installer (in the case of a "classic" installation) or through an updated base image (in the case of a Docker installation). See upgrade instructions below. | ||
|
||
|
||
See also [the guides](https://dataverse-guide--11210.org.readthedocs.build/en/11210/installation/config.html#samesite-cookie-attribute), https://github.com/IQSS/dataverse-security/issues/27 and #11210. | ||
|
||
## Upgrade instructions | ||
|
||
To bring your Dataverse installation in line with the new "Lax" (as opposed to "None") value described in [the guides](https://dataverse-guide--11210.org.readthedocs.build/en/11210/installation/config.html#samesite-cookie-attribute), we recommend running the following commands: | ||
|
||
``` | ||
asadmin set server-config.network-config.protocols.protocol.http-listener-1.http.cookie-same-site-value=Lax | ||
|
||
./asadmin set server-config.network-config.protocols.protocol.http-listener-1.http.cookie-same-site-enabled=true | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,6 +151,15 @@ Password complexity rules for "builtin" accounts can be adjusted with a variety | |
- :ref:`:PVGoodStrength` | ||
- :ref:`:PVCustomPasswordResetAlertMessage` | ||
|
||
.. _samesite-cookie-attribute: | ||
|
||
SameSite Cookie Attribute | ||
^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
The SameSite cookie attribute is defined in an upcoming revision to `RFC 6265 <https://datatracker.ietf.org/doc/html/rfc6265>`_ (HTTP State Management Mechanism) called `6265bis <https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis-19>`_ ("bis" meaning "repeated"). The possible values are "None", "Lax", and "Strict". "Strict" is intended to help prevent Cross-Site Request Forgery (CSRF) attacks, as described in the RFC proposal and an OWASP `cheetsheet <https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#samesite-cookie-attribute>`_. "Lax" is a middle ground between "Strict" and "None". | ||
|
||
Dataverse installations are set to "Lax" out of the box by the installer (in the case of a "classic" installation) or through the base image (in the case of a Docker installation). For classic, see :ref:`http.cookie-same-site-value` and :ref:`http.cookie-same-site-enabled` for how to change the values. For Docker, see :ref:`base-tunables`. By default, Payara uses "None". See also Payara's `documentation <https://docs.payara.fish/community/docs/6.2024.6/Technical%20Documentation/Payara%20Server%20Documentation/General%20Administration/Administering%20HTTP%20Connectivity.html>`_ for the settings above. | ||
|
||
.. _ongoing-security: | ||
|
||
Ongoing Security of Your Installation | ||
|
@@ -3385,6 +3394,32 @@ To facilitate large file upload and download, the Dataverse Software installer b | |
|
||
and restart Payara to apply your change. | ||
|
||
.. _http.cookie-same-site-value: | ||
|
||
http.cookie-same-site-value | ||
++++++++++++++++++++++++++++ | ||
|
||
See :ref:`samesite-cookie-attribute` for context. | ||
|
||
The Dataverse installer configures the Payara **server-config.network-config.protocols.protocol.http-listener-1.http.cookie-same-site-value** setting to "Lax". From `Payara's documentation <https://docs.payara.fish/community/docs/6.2024.6/Technical%20Documentation/Payara%20Server%20Documentation/General%20Administration/Administering%20HTTP%20Connectivity.html>`_, the other possible values are "Strict" or "None". To change this to "Strict", for example, you could run the following command... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The value for this appears to do nothing if the http.cookie-same-site-enabled isn't set to true. Conversely, setting http.cookie-same-site-enabled=true without setting this one ends up sending None as the default which is worse than not having a SameSite setting at all. I think the docs should warn people about these issues. |
||
|
||
``./asadmin set server-config.network-config.protocols.protocol.http-listener-1.http.cookie-same-site-value=Strict`` | ||
|
||
... and restart Payara to apply your change. | ||
|
||
.. _http.cookie-same-site-enabled: | ||
|
||
http.cookie-same-site-enabled | ||
+++++++++++++++++++++++++++++ | ||
|
||
See :ref:`samesite-cookie-attribute` for context. | ||
|
||
The Dataverse installer configures the Payara **server-config.network-config.protocols.protocol.http-listener-1.http.cookie-same-site-enabled** setting to true. To change this to false, you could run the following command... | ||
|
||
``./asadmin set server-config.network-config.protocols.protocol.http-listener-1.http.cookie-same-site-enabled=true`` | ||
|
||
... and restart Payara to apply your change. | ||
|
||
mp.config.profile | ||
+++++++++++++++++ | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds like doing nothing means an installation would be using SameSite:None, but I think by default current installation are not sending anything, which is interpreted as 'Lax' by modern browsers. I.e. installations aren't less safe if they do nothing. Maybe 'To explicitly specify the Lax setting or to switch to Strict, you can use the following commands...' ? Perhaps we should also say 'The value 'None' should never be used with Dataverse.' ?
Same issue for the other docs - Lax is a way to make the current default explicit and None should never be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW: Not sure how you got a None for the Jessionid in the picture - I see no setting at all at QDR and on a test server. Could you have had the http.cookie-same-site-enabled=true already?