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