Using esusers to Authenticate Users
editUsing esusers to Authenticate Users
editYou can manage and authenticate users with Shield’s built-in system, esusers
.
An esusers realm is created by default when you install Shield. You use the
esusers command line tool to add and remove users, assign user roles,
and manage user passwords.
Configuring an esusers Realm
editLike other realms, you can configure options for an esusers
realm in the
shield.authc.realms
namespace in elasticsearch.yml
.
To configure an esusers realm:
-
Add a realm configuration of type
esusers
toelasticsearch.yml
in theshield.authc.realms
namespace. At a minimum, you must set the realmtype
toesusers
. If you are configuring multiple realms, you should also explicitly set theorder
attribute. See esusers Realm Settings for all of the options you can set for anesusers
realm.For example, the following snippet shows an
esusers
realm configuration that sets theorder
to zero so the realm is checked first:shield: authc: realms: esusers1: type: esusers order: 0
- Restart Elasticsearch.
esusers Realm Settings
editSetting |
Required |
Description |
|
yes |
Indicates the realm type. Must be set to |
|
no |
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 to |
|
no |
Indicates whether this realm is enabled or disabled.
Enables you to disable a realm without removing its
configuration. Defaults to |
|
no |
Points to the location
of the |
|
no |
Points to the location
of the |
|
no |
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
time units.
Defaults to |
|
no |
Specifies the maximum number of user entries that can be stored in the cache at one time. Defaults to 100,000. |
|
no |
Specifies the hashing algorithm that is used for the cached user credentials. See Cache hash algorithms for the possible values. (Expert Setting) |
When no realms are explicitly configured in elasticsearch.yml
, a default realm chain is
created that holds a single esusers
realm. If you wish to only work with esusers
realm
and you’re satisfied with the default files paths, there is no real need to add the above
configuration.