built-in-users.asciidoc 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. [role="xpack"]
  2. [[built-in-users]]
  3. === Built-in users
  4. The {stack-security-features} provide built-in user credentials to help you get
  5. up and running. These users have a fixed set of privileges and cannot be
  6. authenticated until their passwords have been set. The `elastic` user can be
  7. used to <<set-built-in-user-passwords,set all of the built-in user passwords>>.
  8. `elastic`:: A built-in _superuser_. See <<built-in-roles>>.
  9. `kibana`:: The user Kibana uses to connect and communicate with Elasticsearch.
  10. `logstash_system`:: The user Logstash uses when storing monitoring information in Elasticsearch.
  11. `beats_system`:: The user the Beats use when storing monitoring information in Elasticsearch.
  12. `apm_system`:: The user the APM server uses when storing monitoring information in {es}.
  13. `remote_monitoring_user`:: The user {metricbeat} uses when collecting and
  14. storing monitoring information in {es}. It has the `remote_monitoring_agent` and
  15. `remote_monitoring_collector` built-in roles.
  16. [float]
  17. [[built-in-user-explanation]]
  18. ==== How the built-in users work
  19. These built-in users are stored in a special `.security` index, which is managed
  20. by {es}. If a built-in user is disabled or its password
  21. changes, the change is automatically reflected on each node in the cluster. If
  22. your `.security` index is deleted or restored from a snapshot, however, any
  23. changes you have applied are lost.
  24. Although they share the same API, the built-in users are separate and distinct
  25. from users managed by the <<native-realm, native realm>>. Disabling the native
  26. realm will not have any effect on the built-in users. The built-in users can
  27. be disabled individually, using the
  28. <<security-api-disable-user,disable users API>>.
  29. [float]
  30. [[bootstrap-elastic-passwords]]
  31. ==== The Elastic bootstrap password
  32. When you install {es}, if the `elastic` user does not already have a password,
  33. it uses a default bootstrap password. The bootstrap password is a transient
  34. password that enables you to run the tools that set all the built-in user passwords.
  35. By default, the bootstrap password is derived from a randomized `keystore.seed`
  36. setting, which is added to the keystore during installation. You do not need
  37. to know or change this bootstrap password. If you have defined a
  38. `bootstrap.password` setting in the keystore, however, that value is used instead.
  39. For more information about interacting with the keystore, see
  40. <<secure-settings>>.
  41. NOTE: After you <<set-built-in-user-passwords,set passwords for the built-in users>>,
  42. in particular for the `elastic` user, there is no further use for the bootstrap
  43. password.
  44. [float]
  45. [[set-built-in-user-passwords]]
  46. ==== Setting built-in user passwords
  47. You must set the passwords for all built-in users.
  48. The +elasticsearch-setup-passwords+ tool is the simplest method to set the
  49. built-in users' passwords for the first time. It uses the `elastic` user's
  50. bootstrap password to run user management API requests. For example, you can run
  51. the command in an "interactive" mode, which prompts you to enter new passwords
  52. for the `elastic`, `kibana`, `logstash_system`, `beats_system`, `apm_system`,
  53. and `remote_monitoring_user` users:
  54. [source,shell]
  55. --------------------------------------------------
  56. bin/elasticsearch-setup-passwords interactive
  57. --------------------------------------------------
  58. For more information about the command options, see
  59. <<setup-passwords,elasticsearch-setup-passwords>>.
  60. IMPORTANT: After you set a password for the `elastic` user, the bootstrap
  61. password is no longer valid; you cannot run the `elasticsearch-setup-passwords`
  62. command a second time.
  63. Alternatively, you can set the initial passwords for the built-in users by using
  64. the *Management > Users* page in {kib} or the
  65. <<security-api-change-password,change password API>>. These methods are
  66. more complex. You must supply the `elastic` user and its bootstrap password to
  67. log into {kib} or run the API. This requirement means that you cannot use the
  68. default bootstrap password that is derived from the `keystore.seed` setting.
  69. Instead, you must explicitly set a `bootstrap.password` setting in the keystore
  70. before you start {es}. For example, the following command prompts you to enter a
  71. new bootstrap password:
  72. [source,shell]
  73. ----------------------------------------------------
  74. bin/elasticsearch-keystore add "bootstrap.password"
  75. ----------------------------------------------------
  76. You can then start {es} and {kib} and use the `elastic` user and bootstrap
  77. password to log into {kib} and change the passwords. Alternatively, you can
  78. submit Change Password API requests for each built-in user. These methods are
  79. better suited for changing your passwords after the initial setup is complete,
  80. since at that point the bootstrap password is no longer required.
  81. [[add-built-in-user-passwords]]
  82. [float]
  83. [[add-built-in-user-kibana]]
  84. ==== Adding built-in user passwords to {kib}
  85. After the `kibana` user password is set, you need to update the {kib} server
  86. with the new password by setting `elasticsearch.password` in the `kibana.yml`
  87. configuration file:
  88. [source,yaml]
  89. -----------------------------------------------
  90. elasticsearch.password: kibanapassword
  91. -----------------------------------------------
  92. See {kibana-ref}/using-kibana-with-security.html[Configuring security in {kib}].
  93. [float]
  94. [[add-built-in-user-logstash]]
  95. ==== Adding built-in user passwords to {ls}
  96. The `logstash_system` user is used internally within Logstash when
  97. monitoring is enabled for Logstash.
  98. To enable this feature in Logstash, you need to update the Logstash
  99. configuration with the new password by setting `xpack.monitoring.elasticsearch.password` in
  100. the `logstash.yml` configuration file:
  101. [source,yaml]
  102. ----------------------------------------------------------
  103. xpack.monitoring.elasticsearch.password: logstashpassword
  104. ----------------------------------------------------------
  105. If you have upgraded from an older version of Elasticsearch,
  106. the `logstash_system` user may have defaulted to _disabled_ for security reasons.
  107. Once the password has been changed, you can enable the user via the following API call:
  108. [source,console]
  109. ---------------------------------------------------------------------
  110. PUT _security/user/logstash_system/_enable
  111. ---------------------------------------------------------------------
  112. See {logstash-ref}/ls-security.html#ls-monitoring-user[Configuring credentials for {ls} monitoring].
  113. [float]
  114. [[add-built-in-user-beats]]
  115. ==== Adding built-in user passwords to Beats
  116. The `beats_system` user is used internally within Beats when monitoring is
  117. enabled for Beats.
  118. To enable this feature in Beats, you need to update the configuration for each
  119. of your beats to reference the correct username and password. For example:
  120. [source,yaml]
  121. ----------------------------------------------------------
  122. xpack.monitoring.elasticsearch.username: beats_system
  123. xpack.monitoring.elasticsearch.password: beatspassword
  124. ----------------------------------------------------------
  125. For example, see {metricbeat-ref}/monitoring.html[Monitoring {metricbeat}].
  126. The `remote_monitoring_user` is used when {metricbeat} collects and stores
  127. monitoring data for the {stack}. See <<monitoring-production>>.
  128. If you have upgraded from an older version of {es}, then you may not have set a
  129. password for the `beats_system` or `remote_monitoring_user` users. If this is
  130. the case, then you should use the *Management > Users* page in {kib} or the
  131. <<security-api-change-password,change password API>> to set a password
  132. for these users.
  133. [float]
  134. [[add-built-in-user-apm]]
  135. ==== Adding built-in user passwords to APM
  136. The `apm_system` user is used internally within APM when monitoring is enabled.
  137. To enable this feature in APM, you need to update the
  138. {apm-server-ref}/configuring-howto-apm-server.html[APM configuration file] to
  139. reference the correct username and password. For example:
  140. [source,yaml]
  141. ----------------------------------------------------------
  142. xpack.monitoring.elasticsearch.username: apm_system
  143. xpack.monitoring.elasticsearch.password: apmserverpassword
  144. ----------------------------------------------------------
  145. See {apm-server-ref}/monitoring.html[Monitoring APM Server].
  146. If you have upgraded from an older version of {es}, then you may not have set a
  147. password for the `apm_system` user. If this is the case,
  148. then you should use the *Management > Users* page in {kib} or the
  149. <<security-api-change-password,change password API>> to set a password
  150. for these users.
  151. [float]
  152. [[disabling-default-password]]
  153. ==== Disabling default password functionality
  154. [IMPORTANT]
  155. =============================================================================
  156. This setting is deprecated. The elastic user no longer has a default password.
  157. The password must be set before the user can be used.
  158. See <<bootstrap-elastic-passwords>>.
  159. =============================================================================