# Elasticsearch temporary access

[Temporary access overview](/docs/concepts/temporary-access) covers target setup, connection methods, and credential handling.

Elasticsearch targets create native users with fixed roles, or API keys with
explicit role descriptors. For a temporary user:

```json
{"provider":"elasticsearch","executor":"in_do","endpoint":"https://search.example.com:9200","roles":["reader"]}
```

Pass `{"username":"lease-manager","password":"..."}` as the encrypted management
credential. The manager needs `manage_security` for users; API keys require
`manage_own_api_key` or `manage_api_key`, plus the privileges granted to the key.
Register and mint with `seekrit dynamic`, or use the dashboard. User output has
`endpoint`, `username`, and `password`; deletion at expiry depends on the broker.
The broker checks the ownership marker before deleting a user.

For API keys set `credentialType: "api_key"` and supply `roleDescriptors`, for
example `{"reader":{"indices":[{"names":["logs-*"],"privileges":["read"]}]}}`.
Cluster and index permissions are supported; empty or omitted descriptors are
rejected to prevent inheriting the manager's permissions. API keys additionally
expire upstream and return `id`, `apiKey`, and `encoded` for the `ApiKey` header.
Revocation invalidates the key, checks per-key failures even on HTTP 200, and
retries failures. Existing requests are not cancelled. HTTPS with a public DNS
hostname is required; nonstandard TLS ports are supported.

See the [CLI reference](/docs/reference/cli) and [API reference](/docs/reference/api) for commands and endpoints.
