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