General security settings
Set these inelasticsearch.yml.
| Setting | Default | Description |
|---|---|---|
xpack.security.enabled | true | Enables Elasticsearch security features. Must be true to use authentication, authorization, and auditing. |
xpack.security.autoconfiguration.enabled | true | Enables security auto-configuration on first start. When false, you must configure security manually. |
xpack.security.enrollment.enabled | false | When true, the node can generate enrollment tokens for new nodes and Kibana instances. Set automatically by the auto-configuration process. |
xpack.security.fips_mode.enabled | false | Set to true when running in a FIPS 140-2 enabled JVM. |
Authentication
Built-in users
Elasticsearch ships with several built-in users. These accounts are stored in a special.security index and are available as soon as security is enabled.
| Username | Purpose |
|---|---|
elastic | Superuser. Full access to all cluster operations. Use for initial setup only; create dedicated users for day-to-day operations. |
kibana_system | Used by Kibana to connect to Elasticsearch. Do not use for general access. |
logstash_system | Used by Logstash monitoring agents. |
beats_system | Used by Beats monitoring agents. |
remote_monitoring_user | Used by Metricbeat for Stack Monitoring. |
elastic user’s password:
Authentication realms
Elasticsearch uses a chain of realms to authenticate users. Realms are evaluated inorder from lowest to highest.
- Native realm
- File realm
- LDAP / Active Directory
- PKI
The default realm. Users are stored in the Manage users with the Users API or Kibana’s user management UI.
.security index and managed via the Elasticsearch API. Suitable for most deployments.API keys
API keys provide a way to grant long-lived or short-lived programmatic access without sharing user credentials.Creating an API key
id and api_key. Store api_key securely — it is shown only once.
Using an API key in requests
Encode the key asbase64(id:api_key) and pass it in the Authorization header:
encoded field from the create response directly.
API key settings
| Setting | Default | Description |
|---|---|---|
xpack.security.authc.api_key.enabled | true | Enables the API key service. |
xpack.security.authc.api_key.cache.ttl | 1d | How long to cache API key credentials in memory. |
xpack.security.authc.api_key.cache.max_keys | 10000 | Maximum number of API keys held in the cache. |
xpack.security.authc.api_key.delete.retention_period | 7d | How long invalidated or expired keys are retained before deletion. Dynamic. |
Role-based access control (RBAC)
Every authenticated request in Elasticsearch is authorized against one or more roles assigned to the user or API key.Built-in roles
superuser
Full read/write access to the entire cluster, including cluster administration, index management, and user management.
kibana_admin
Full access to all Kibana features. Does not grant direct Elasticsearch index access.
viewer
Read-only access to all indices and Kibana features. Suitable for dashboards and reporting.
editor
Read and write access to Elasticsearch data and most Kibana features, but cannot manage users or roles.
Custom roles
Create or update a custom role using the role API:Document and field level security
Restrict access to specific documents or fields within an index using role definitions:| Setting | Default | Description |
|---|---|---|
xpack.security.dls_fls.enabled | true | Enables document and field level security. Set to false to prevent configuring DLS/FLS. |
xpack.security.dls.bitset.cache.size | 10% | Maximum memory for caching DLS BitSet objects. Accepts bytes (200mb) or heap percentage (5%). |
xpack.security.dls.bitset.cache.ttl | 2h | Time-to-live for cached DLS BitSet entries. |
TLS and transport encryption
Elasticsearch 8+ auto-configures TLS for both the transport (node-to-node) and HTTP (client-to-node) layers during initial setup. Certificates are stored inconfig/certs/.
- HTTP TLS settings
- Transport TLS settings
- LDAP TLS settings
TLS is required on the transport layer whenever
xpack.security.enabled is true. Disabling transport TLS on a secured cluster will prevent nodes from joining.Token service
Short-lived tokens provide session-like access for browser-based clients such as Kibana.| Setting | Default | Description |
|---|---|---|
xpack.security.authc.token.enabled | true | Enables the token service. Automatically false if HTTP SSL is disabled, to prevent token sniffing over plaintext. |
xpack.security.authc.token.timeout | 20m | Validity period for issued tokens. Maximum is 1h. |
