built-in-users.asciidoc 9.4 KB

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