delegate-pki-authentication.asciidoc 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. --
  2. :api: delegate-pki
  3. :request: DelegatePkiAuthenticationRequest
  4. :response: DelegatePkiAuthenticationResponse
  5. --
  6. [role="xpack"]
  7. [id="{upid}-{api}"]
  8. === Delegate PKI Authentication API
  9. This API is called by *smart* proxies to Elasticsearch, such as Kibana, that
  10. terminate the user's TLS session but that still wish to authenticate the user
  11. on the Elasticsearch side using a PKI realm, which normally requires users to
  12. authenticate over TLS directly to Elasticsearch. It implements the exchange of
  13. the client's {@code X509Certificate} chain from the TLS authentication into an
  14. Elasticsearch access token.
  15. IMPORTANT: The association between the subject public key in the target
  16. certificate and the corresponding private key is *not* validated. This is part
  17. of the TLS authentication process and it is delegated to the proxy calling this
  18. API. The proxy is *trusted* to have performed the TLS authentication, and this
  19. API translates that authentication into an Elasticsearch access token.
  20. [id="{upid}-{api}-request"]
  21. ==== Delegate PKI Authentication Request
  22. The request contains the client's {@code X509Certificate} chain. The
  23. certificate chain is represented as a list where the first element is the
  24. target certificate containing the subject distinguished name that is requesting
  25. access. This may be followed by additional certificates, with each subsequent
  26. certificate being the one used to certify the previous one. The certificate
  27. chain is validated according to RFC 5280, by sequentially considering the trust
  28. configuration of every installed {@code PkiRealm} that has {@code
  29. PkiRealmSettings#DELEGATION_ENABLED_SETTING} set to {@code true} (default is
  30. {@code false}). A successfully trusted target certificate is also subject to
  31. the validation of the subject distinguished name according to that respective's
  32. realm {@code PkiRealmSettings#USERNAME_PATTERN_SETTING}.
  33. ["source","java",subs="attributes,callouts,macros"]
  34. --------------------------------------------------
  35. include-tagged::{doc-tests}/SecurityDocumentationIT.java[delegate-pki-request]
  36. --------------------------------------------------
  37. include::../execution.asciidoc[]
  38. [id="{upid}-{api}-response"]
  39. ==== Delegate PKI Authentication Response
  40. The returned +{response}+ contains the following properties:
  41. `accessToken`:: This is the newly created access token.
  42. It can be used to authenticate to the Elasticsearch cluster.
  43. `type`:: The type of the token, this is always `"Bearer"`.
  44. `expiresIn`:: The length of time (in seconds) until the token will expire.
  45. The token will be considered invalid after that time.
  46. ["source","java",subs="attributes,callouts,macros"]
  47. --------------------------------------------------
  48. include-tagged::{doc-tests}/SecurityDocumentationIT.java[delegate-pki-response]
  49. --------------------------------------------------
  50. <1> The `accessToken` can be used to authentication to Elasticsearch.