influxdb/session
Jamie Strandboge c40ad64604
feat(security): set SameSite=strict on session cookie (#23723)
* feat(security): set SameSite=strict on session cookie

Use SameSite=Strict as a hardening measure against cross-origin attacks.
While browsers have been moving to default to SameSite=Lax, explicitly
setting SameSite ensures that all browsers enforce it consistently.
While 'lax' is a reasonable hardening choice, the cookie is only
required for requests to '/api/...' and we don't expect 3rd party links
into '/api/...', so this stricter setting should be safe in terms of
usability. Furthermore, while our GET APIs are not state-changing, using
'strict' future-proofs us in case we add a state-changing GET API ('lax'
allows cross-origin 'GET' requests for increased usability for read-only
requests).

Also add a comment to SetCORS() lack of Access-Control-Allow-Credentials
as a reminder that its omission is intentional for defense in depth on
when to attach the cookie to a request.

* chore: mention that Lax sends the cookie with other safe HTTP methods
2022-09-15 15:30:19 -05:00
..
errors.go refactor: automated move of errors and id from root to kit (#21101) 2021-03-30 14:10:02 -04:00
http_server.go feat(security): set SameSite=strict on session cookie (#23723) 2022-09-15 15:30:19 -05:00
http_server_test.go feat(security): set SameSite=strict on session cookie (#23723) 2022-09-15 15:30:19 -05:00
middleware_logging.go fix: change logging level to debug to reduce noise (#18054) 2020-05-12 10:16:00 -07:00
middleware_metrics.go feat(session): Build out a new session service (#17950) 2020-05-11 15:04:11 -06:00
service.go fix: more expressive errors (#22448) 2021-09-13 15:12:35 -04:00
service_test.go chore: remove kv Session service and sessionsv1 bucket (#18823) 2020-07-02 15:15:08 +01:00
storage.go fix: more expressive errors (#22448) 2021-09-13 15:12:35 -04:00
storage_test.go feat(session): Build out a new session service (#17950) 2020-05-11 15:04:11 -06:00