built-in-users.asciidoc 9.0 KB

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