delegate-pki-authentication.asciidoc 2.8 KB

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