summaryrefslogtreecommitdiff
path: root/doc/source/config.rst
diff options
context:
space:
mode:
authorxXx-caillou-xXx2017-11-24 14:03:37 +0100
committerjvoisin2017-11-24 14:03:37 +0100
commit5a224ee0c92d1639395d6a0c629316ae64226125 (patch)
tree8925d27e2bbfa877e9fb1fc20868fbef3d009b04 /doc/source/config.rst
parent79304a29661476dc75bba07c5a83133122bbcb5c (diff)
Implement anti csrf measures
This is done by using the "samesite" cookie attribute.
Diffstat (limited to 'doc/source/config.rst')
-rw-r--r--doc/source/config.rst24
1 files changed, 22 insertions, 2 deletions
diff --git a/doc/source/config.rst b/doc/source/config.rst
index fc0df2d..c271403 100644
--- a/doc/source/config.rst
+++ b/doc/source/config.rst
@@ -115,6 +115,26 @@ It can either be ``enabled`` or ``disabled``.
115 sp.auto_cookie_secure.enable(); 115 sp.auto_cookie_secure.enable();
116 sp.auto_cookie_secure.disable(); 116 sp.auto_cookie_secure.disable();
117 117
118cookie_samesite
119^^^^^^^^^^^^^^^^
120 * `default: disabled`
121
122``samesite`` will add the `samesite <https://tools.ietf.org/html/draft-west-first-party-cookies-07>`_
123attribute to cookies. It `prevents CSRF <https://www.owasp.org/index.php/SameSite>`_
124but is not implemented by `all web browsers <https://caniuse.com/#search=samesite>`_ yet.
125
126It can either be set to ``strict`` or ``lax``:
127
128- The ``lax`` attribute prevents cookies from being sent cross-domain for
129 "dangerous" methods, like ``POST``, ``PUT`` or ``DELETE``.
130
131- The ``strict`` one prevents any cookies from beind sent cross-domain.
132
133::
134
135 sp.cookie.name("cookie1").samesite("lax");
136 sp.cookie.name("cookie2").samesite("strict");;
137
118.. _cookie-encryption_config: 138.. _cookie-encryption_config:
119 139
120cookie_encryption 140cookie_encryption
@@ -137,8 +157,8 @@ It can either be ``enabled`` or ``disabled`` and can be used in ``simulation`` m
137 157
138:: 158::
139 159
140 sp.cookie_encryption.cookie("my_cookie_name"); 160 sp.cookie.name("my_cookie_name").encrypt();
141 sp.cookie_encryption.cookie("another_cookie_name"); 161 sp.cookie.name("another_cookie_name").encrypt();
142 162
143Choosing the proper environment variable 163Choosing the proper environment variable
144"""""""""""""""""""""""""""""""""""""""" 164""""""""""""""""""""""""""""""""""""""""