elasticsearch-authn
Authenticate to Elasticsearch using native, file-based, LDAP/AD, SAML, OIDC, Kerberos, JWT, or certificate realms. Use when connecting with credentials, choosing a realm, or managing API keys. Assumes the target realms are already configured.
Security Assessment
Detected risks:
About elasticsearch-authn
Authenticate to an Elasticsearch cluster using any supported authentication realm and manage the full API key lifecycle. It covers native username/password, file-based users, external LDAP and Active Directory, PKI / mutual-TLS client certificates, SAML, OIDC, JWT bearer tokens, and Kerberos, and assumes the target realms are already configured. For roles and role mappings it points to a companion elasticsearch-authz skill.
Elasticsearch evaluates realms in a configured order called the realm chain, and the first realm that can authenticate a request wins; internal realms (native, file) are managed by Elasticsearch while external realms delegate to enterprise identity systems. Many external realms send an identical _authenticate request and are simply routed by the chain. The skill maps typical jobs to be done — verifying who is currently authenticated, connecting with an API key bearer token, creating scoped API keys for automation, rotating or invalidating keys, granting keys on behalf of other users, and setting up service-account tokens.
A strong operational theme is secret hygiene: it instructs never to ask the user to paste passwords, keys, or tokens into the chat, and to reference environment variables such as ELASTICSEARCH_URL, ELASTICSEARCH_API_KEY, and ELASTICSEARCH_USERNAME/PASSWORD, preferring a project .env file over terminal exports because sandboxed agent shells may not inherit the user's environment. Each realm entry notes deployment compatibility, since not every realm is available across self-managed, Elastic Cloud Hosted, and Serverless deployments — for example file, LDAP, AD, and Kerberos are self-managed only, and SAML/OIDC rely on browser-redirect flows better suited to Kibana than to REST clients. Concrete curl examples accompany each method, and detailed endpoints live in a referenced api-reference file.
FAQ
Which authentication realms does this skill cover?
Native, file, LDAP, Active Directory, PKI/TLS client certificates, SAML, OIDC, JWT, and Kerberos — all built-in Elasticsearch realms, assuming they are already configured.
How does it handle credentials safely?
It never asks you to paste secrets into chat; instead it references environment variables like ELASTICSEARCH_URL and ELASTICSEARCH_API_KEY and prefers a project .env file over terminal exports.
Does it manage API keys?
Yes — it covers the full API key lifecycle: creating scoped keys, rotating or invalidating them, and granting keys on behalf of other users, plus service-account tokens for stack components.
Are all realms available on every deployment?
No — file, LDAP, AD, and Kerberos are self-managed only, PKI is limited on ECH, and several realms are unavailable on Serverless; a deployment-compatibility section details this.
Where do I manage roles and role mappings?
Those are out of scope here; the skill directs you to the companion elasticsearch-authz skill for roles, users, role assignment, and role mappings.
Install elasticsearch-authn
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
elastic/agent-skills