Allow HTTP routes to programmatically opt out of XSRF protection #53823
Description
Currently we have routes that are solely used by the external services (e.g. SAML POST callback route that is called by Identity Provider). Usually such services can't be configured to provide kbn-xsrf
HTTP header with their requests and trigger our server XSRF protection as the result.
To workaround that we introduced server.xsrf.whitelist
configuration a while ago, but that was never convenient since you should always configure it if you wish to use SAML and with a value that's already known to Kibana (/api/security/saml/callback
).
We're a looking for a better way to XSRF-whitelist certain endpoints and eliminate unnecessary admin/user involvement that'd simplify overall setup process. I can think of two options right now:
-
Provide additional route option to mark route as XSRF-whitelisted (similar to
authRequired: boolean
we already have). -
Expose programmatic
core.http.xsrf
-like API that would allow run-time editing of XSRF whitelist.
The first option sounds like a better one overall: simple to understand and easy to audit but I'd like to hear your thoughts on that @elastic/kibana-platform @elastic/kibana-security ?