The easiest way to manage and authenticate users is with the internal
realm. You can use the REST APIs or Kibana to add and remove users, assign user roles, and
manage user passwords.
The native realm is added to the realm chain by default. You don’t need to explicitly configure a native realm to manage users through the REST APIs.
When you configure realms in
elasticsearch.yml, only the
realms you specify are used for authentication. To use the
native realm as a fallback, you must include it in the realm chain.
You can, however, configure options for the
native realm in the
xpack.security.authc.realms namespace in
configuring a native realm enables you to set the order in which it appears in
the realm chain, temporary disable the realm, and control its cache options.
To configure a native realm:
Add a realm configuration of type
xpack.security.authc.realmsnamespace. At a minimum, you must set the realm
native. If you are configuring multiple realms, you should also explicitly set the
orderattribute. See Native Realm Settings for all of the options you can set for the
For example, the following snippet shows a
nativerealm configuration that sets the
orderto zero so the realm is checked first:
xpack: security: authc: realms: native1: type: native order: 0
- Restart Elasticsearch.
Table 1. Native Realm Settings
Indicates the realm type. Must be set to
Indicates the priority of this realm within
the realm chain. Realms with a lower order
are consulted first. Although not required,
we recommend explicitly setting this value
when you configure multiple realms. Defaults
Indicates whether this realm is enabled or
disabled. When set to
Specifies the time-to-live for cached user
entries. A user’s credentials are cached for
this period of time. Specify the time period
using the standard Elasticsearch
Specifies the maximum number of user entries that can be cached at any given time. Defaults to 100,000.
Specifies the hashing algorithm that is used for the cached user credentials. See Cache hash algorithms for the possible values. (Expert Setting)
X-Pack security enables you to easily manage users in Kibana on the Management / Security / Users page.
Alternatively, you can manage users through the
user API. For more
information and examples, see User Management APIs.
To migrate file-based users to the
native realm, use the