ssl.asciidoc 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. [role="xpack"]
  2. [[security-api-ssl]]
  3. === SSL Certificate API
  4. The `certificates` API enables you to retrieve information about the X.509
  5. certificates that are used to encrypt communications in your {es} cluster.
  6. ==== Request
  7. `GET /_xpack/ssl/certificates`
  8. ==== Description
  9. For more information about how certificates are configured in conjunction with
  10. Transport Layer Security (TLS), see
  11. {xpack-ref}/ssl-tls.html[Setting up SSL/TLS on a cluster].
  12. The API returns a list that includes certificates from all TLS contexts
  13. including:
  14. * {xpack} default TLS settings
  15. * Settings for transport and HTTP interfaces
  16. * TLS settings that are used within authentication realms
  17. * TLS settings for remote monitoring exporters
  18. The list includes certificates that are used for configuring trust, such as
  19. those configured in the `xpack.ssl.truststore` and
  20. `xpack.ssl.certificate_authorities` settings. It also includes certificates that
  21. that are used for configuring server identity, such as `xpack.ssl.keystore` and
  22. `xpack.ssl.certificate` settings.
  23. The list does not include certificates that are sourced from the default SSL
  24. context of the Java Runtime Environment (JRE), even if those certificates are in
  25. use within {xpack}.
  26. If {xpack} is configured to use a keystore or truststore, the API output
  27. includes all certificates in that store, even though some of the certificates
  28. might not be in active use within the cluster.
  29. ==== Results
  30. The response is an array of objects, with each object representing a
  31. single certificate. The fields in each object are:
  32. `path`:: (string) The path to the certificate, as configured in the
  33. `elasticsearch.yml` file.
  34. `format`:: (string) The format of the file. One of: `jks`, `PKCS12`, `PEM`.
  35. `alias`:: (string) If the path refers to a container file (a jks keystore, or a
  36. PKCS#12 file), the alias of the certificate. Otherwise, null.
  37. `subject_dn`:: (string) The Distinguished Name of the certificate's subject.
  38. `serial_number`:: (string) The hexadecimal representation of the certificate's
  39. serial number.
  40. `has_private_key`:: (boolean) If {xpack} has access to the private key for this
  41. certificate, this field has a value of `true`.
  42. `expiry`:: (string) The ISO formatted date of the certificate's expiry
  43. (not-after) date.
  44. ==== Authorization
  45. If {security} is enabled, you must have `monitor` cluster privileges to use this
  46. API. For more information, see
  47. {xpack-ref}/security-privileges.html[Security Privileges].
  48. ==== Examples
  49. The following example provides information about the certificates on a single
  50. node of {es}:
  51. [source,js]
  52. --------------------------------------------------
  53. GET /_xpack/ssl/certificates
  54. --------------------------------------------------
  55. // CONSOLE
  56. // TEST[skip:todo]
  57. The API returns the following results:
  58. [source,js]
  59. ----
  60. [
  61. {
  62. "path": "certs/elastic-certificates.p12",
  63. "format": "PKCS12",
  64. "alias": "instance",
  65. "subject_dn": "CN=Elastic Certificate Tool Autogenerated CA",
  66. "serial_number": "a20f0ee901e8f69dc633ff633e5cd5437cdb4137",
  67. "has_private_key": false,
  68. "expiry": "2021-01-15T20:42:49.000Z"
  69. },
  70. {
  71. "path": "certs/elastic-certificates.p12",
  72. "format": "PKCS12",
  73. "alias": "ca",
  74. "subject_dn": "CN=Elastic Certificate Tool Autogenerated CA",
  75. "serial_number": "a20f0ee901e8f69dc633ff633e5cd5437cdb4137",
  76. "has_private_key": false,
  77. "expiry": "2021-01-15T20:42:49.000Z"
  78. },
  79. {
  80. "path": "certs/elastic-certificates.p12",
  81. "format": "PKCS12",
  82. "alias": "instance",
  83. "subject_dn": "CN=instance",
  84. "serial_number": "fc1905e1494dc5230218d079c47a617088f84ce0",
  85. "has_private_key": true,
  86. "expiry": "2021-01-15T20:44:32.000Z"
  87. }
  88. ]
  89. ----
  90. // NOTCONSOLE