Token导航 LogoToken导航

Agent Skill · 研究检索

elasticsearch-authn(弹性搜索授权)

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

elasticsearch-authn 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 11,668。

总安装 11,031周安装 469GitHub Stars 445下载 3,865核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:elasticsearch-authn(弹性搜索授权)
来源仓库:https://github.com/elastic/agent-skills
仓库路径:skills/elasticsearch-authn
安装命令:
npx skills add https://github.com/elastic/agent-skills --skill elasticsearch-authn
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/elastic/agent-skills --skill elasticsearch-authn

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

elasticsearch-authn 用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查,适合梳理敏感配置和分析鉴权逻辑。适用于 Elasticsearch 集群的身份验证和 API 密钥管理场景。支持所有内置认证领域、凭证验证和完整的 API 密钥生命周期管理。

安装命令:npx skills add https://github.com/elastic/agent-skills --skill elasticsearch-authn 使用时不能把工具输出直接当最终结论,涉及密钥、令牌或生产系统时应先确认最小权限和操作边界。

来源仓库内路径:skills/elasticsearch-authn

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/elastic/agent-skills --skill elasticsearch-aut…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

elasticsearch-authn 怎么安装?

在终端执行 npx skills add https://github.com/elastic/agent-skills --skill elasticsearch-authn。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

elasticsearch-authn 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

elasticsearch-authn 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

elasticsearch-authn 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

elasticsearch-authn 用的人多吗?

公开数据是累计安装 11,031 次,近一周安装 469 次,下载 3,865 次,GitHub 445 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

elasticsearch-authn 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
elasticsearch-authn

弹性搜索授权 · 本页

11,031445接触敏感数据未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Elasticsearch Authentication

Authenticate to an Elasticsearch cluster using any supported authentication realm that is already configured. This skill covers all built-in realms, credential verification, and the full API key lifecycle.

For roles, users, role assignment, and role mappings, see the elasticsearch-authz skill.

For detailed API endpoints, see references/api-reference.md.

Deployment note: Not all realms are available on every deployment type. See Deployment Compatibility for self-managed vs. ECH vs. Serverless details.

Critical principles

  • Never ask for credentials in chat. Do not ask the user to paste passwords, API keys, tokens, or any secret into the conversation. Secrets must not appear in conversation history.
  • Always use environment variables. All code examples in this skill reference environment variables (e.g. ELASTICSEARCH_PASSWORD, ELASTICSEARCH_API_KEY). When a required variable is missing, instruct the user to set it in a .env file in the project root — never prompt for the value directly.
  • Prefer .env over terminal exports. Agents may run commands in a sandboxed shell session that does not inherit the user's terminal environment. A .env file in the working directory is reliable across all execution contexts. Only suggest export as a fallback when the user explicitly prefers it.

Jobs to Be Done

  • Authenticate to a cluster using username and password (native realm)
  • Connect using an API key (bearer token)
  • Verify who is currently authenticated (_authenticate)
  • Choose the right authentication realm for a deployment
  • Create an API key with scoped privileges for automation or service access
  • Rotate or invalidate an existing API key
  • Set up service account tokens for Elastic stack components
  • Authenticate with PKI / mutual TLS certificate-based authentication after PKI/TLS setup
  • Authenticate with configured external identity providers (SAML, OIDC, LDAP, AD, Kerberos)
  • Grant API keys on behalf of other users

Prerequisites

ItemDescription
Elasticsearch URLCluster endpoint (e.g. https://localhost:9200 or a Cloud deployment URL)
CredentialsDepends on the realm — see the methods below
Realms configuredAuthentication realms and their identity backends must already be configured (realm chain, IdP, LDAP/AD, Kerberos, PKI/TLS)

If any required value is missing, instruct the user to add it to a .env file in the project root. Terminal exports may not be visible to agents running in a separate shell session — the .env file is the reliable default. Never ask the user to paste credentials into the chat — secrets must not appear in conversation history.

Authentication Realms

Elasticsearch evaluates realms in a configured order (the realm chain). The first realm that can authenticate the request wins. Internal realms are managed by Elasticsearch; external realms delegate to enterprise identity systems.

Internal realms

Native (username and password)

Users stored in a dedicated Elasticsearch index. Simplest method for interactive use. Managed via Kibana or the user management APIs (see the elasticsearch-authz skill).

curl -u "${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}" "${ELASTICSEARCH_URL}/_security/_authenticate"
File

Users defined in flat files on each cluster node (elasticsearch-users CLI). Always active regardless of license state, making it the fallback for disaster recovery when paid realms are disabled. Only available on self-managed deployments.

curl -u "${FILE_USER}:${FILE_PASSWORD}" "${ELASTICSEARCH_URL}/_security/_authenticate"

External realms

LDAP

Authenticates against an external LDAP directory using username and password. Self-managed only — not available on ECH or Serverless. Typically combined with role mappings to translate LDAP groups to Elasticsearch roles.

curl -u "${LDAP_USER}:${LDAP_PASSWORD}" "${ELASTICSEARCH_URL}/_security/_authenticate"

The request is identical to native — Elasticsearch routes it to the LDAP realm via the realm chain.

Active Directory

Authenticates against an Active Directory domain. Self-managed only — not available on ECH or Serverless. Similar to LDAP but uses AD-specific defaults (user principal name, sAMAccountName). Typically combined with role mappings for AD group-to-role translation.

curl -u "${AD_USER}:${AD_PASSWORD}" "${ELASTICSEARCH_URL}/_security/_authenticate"
PKI (TLS client certificates)

Authenticates using X.509 client certificates presented during the TLS handshake. Requires a PKI realm and TLS on the HTTP layer. On ECH, PKI support is limited — check deployment settings. Not available on Serverless. Best for service-to-service communication in mutual TLS environments.

curl --cert "${CLIENT_CERT}" --key "${CLIENT_KEY}" --cacert "${CA_CERT}" \
  "${ELASTICSEARCH_URL}/_security/_authenticate"
SAML

Enables SAML 2.0 Web Browser SSO, primarily for Kibana authentication. On self-managed, configure in elasticsearch.yml. On ECH, configure through the Cloud deployment settings UI. On Serverless, SAML is handled at the organization level and not configurable per project. Not usable by standard REST clients — the browser-based redirect flow is handled by Kibana. Configure another realm (e.g. native or API keys) alongside SAML for programmatic API access.

OIDC (OpenID Connect)

Enables OpenID Connect SSO, primarily for Kibana authentication. On self-managed, configure in elasticsearch.yml. On ECH, configure through the Cloud deployment settings UI. Not available on Serverless. Like SAML, it relies on browser redirects and is not suited for direct REST client use. For programmatic access alongside OIDC, use API keys or native users.

Custom applications can exchange OIDC tokens for Elasticsearch access tokens via POST /_security/oidc/authenticate, but this requires implementing the full OIDC redirect flow.

JWT (JSON Web Tokens)

Accepts JWTs issued by an external identity provider as bearer tokens. On self-managed, configure in elasticsearch.yml. On ECH, configure through the Cloud deployment settings UI. Not available on Serverless. Supports two token types:

  • id_token (default) — OpenID Connect ID tokens for user-on-behalf-of flows.
  • access_token — OAuth2 client credentials for application identity flows.
curl -H "Authorization: Bearer ${JWT_TOKEN}" "${ELASTICSEARCH_URL}/_security/_authenticate"

Each JWT realm handles one token type. Configure separate realms for id_token and access_token if both are needed.

Kerberos

Authenticates using Kerberos tickets via the SPNEGO mechanism. Self-managed only — not available on ECH or Serverless. Requires a working KDC infrastructure, proper DNS, and time synchronization.

kinit "${KERBEROS_PRINCIPAL}"
curl --negotiate -u : "${ELASTICSEARCH_URL}/_security/_authenticate"

The --negotiate flag enables SPNEGO. The -u: is required by curl but the username is ignored — the principal from kinit is used. Requires curl 7.49+ with GSS-API/SPNEGO support.

API keys

Not a realm, but a distinct authentication mechanism. Pass a Base64-encoded API key in the Authorization header. Preferred for programmatic and automated access.

curl -H "Authorization: ApiKey ${ELASTICSEARCH_API_KEY}" "${ELASTICSEARCH_URL}/_security/_authenticate"

ELASTICSEARCH_API_KEY is the encoded value (Base64 of id:api_key) returned when the key was created.

Verify authentication

Always verify credentials before proceeding:

curl <auth_flags> "${ELASTICSEARCH_URL}/_security/_authenticate"

Check username, roles, and authentication_realm.type to confirm identity and method:

authentication_realm.typeRealm
nativeNative
fileFile
ldapLDAP
active_directoryActive Directory
pkiPKI
samlSAML
oidcOpenID Connect
jwtJWT
kerberosKerberos

For API keys, authentication_type is "api_key" (not a realm type).

Manage API Keys

Create an API key

curl -X POST "${ELASTICSEARCH_URL}/_security/api_key" \
  <auth_flags> \
  -H "Content-Type: application/json" \
  -d '{
    "name": "'"${KEY_NAME}"'",
    "expiration": "30d",
    "role_descriptors": {
      "'"${ROLE_NAME}"'": {
        "cluster": [],
        "indices": [
          {
            "names": ["'"${INDEX_PATTERN}"'"],
            "privileges": ["read"]
          }
        ]
      }
    }
  }'

The response contains id, api_key, and encoded. Store encoded securely — it cannot be retrieved again.

Omit role_descriptors to inherit a snapshot of the authenticated user's current privileges.

Limitation: An API key cannot create another API key with privileges. The derived key is created with no effective access. Use POST /_security/api_key/grant with user credentials instead.

Get and invalidate API keys

curl "${ELASTICSEARCH_URL}/_security/api_key?name=${KEY_NAME}" <auth_flags>
curl -X DELETE "${ELASTICSEARCH_URL}/_security/api_key" \
  <auth_flags> \
  -H "Content-Type: application/json" \
  -d '{"name": "'"${KEY_NAME}"'"}'

Examples

Create a scoped API key

Request: "Create an API key that can only read from metrics-*."

POST /_security/api_key
{
  "name": "metrics-reader-key",
  "expiration": "90d",
  "role_descriptors": {
    "metrics-reader": {
      "indices": [
        {
          "names": ["metrics-*"],
          "privileges": ["read", "view_index_metadata"]
        }
      ]
    }
  }
}

Verify which realm authenticated the user

GET /_security/_authenticate
{
  "username": "joe",
  "authentication_realm": { "name": "ldap1", "type": "ldap" },
  "authentication_type": "realm"
}

Authenticate with a JWT bearer token

curl -H "Authorization: Bearer ${JWT_TOKEN}" "https://my-cluster:9200/_security/_authenticate"

Confirm the response shows authentication_realm.type as "jwt".

Guidelines

Choosing an authentication method

MethodBest forTrade-offs
Native userInteractive use, simple setupsPassword must be stored or prompted
File userDisaster recovery, bootstrapMust be configured on every node
API keyProgrammatic access, CI/CD, scoped accessCannot be retrieved after creation
LDAP / ADEnterprise directory integrationRequires network access to directory server
PKI certificateService-to-service, mutual TLS environmentsRequires PKI infrastructure and PKI realm
SAMLKibana SSO via enterprise IdPBrowser-only; not for REST clients
OIDCKibana SSO via OpenID Connect providerBrowser-only; not for REST clients
JWTToken-based service and user authenticationRequires external token issuer and realm config
KerberosWindows/enterprise Kerberos environmentsRequires KDC, DNS, time sync infrastructure

Prefer API keys for automated workflows — they support fine-grained scoping and independent expiration. For Kibana SSO, use SAML or OIDC. For enterprise directory integration, use LDAP or AD with role mappings (see elasticsearch-authz).

Avoid superuser credentials

Never use the built-in elastic superuser or any superuser-role account for day-to-day operations, automation, or application access. Instead, create a dedicated user or API key with only the privileges the task requires. The elastic user should be reserved for initial cluster setup and emergency recovery only.

Security

  • An API key cannot create another API key with privileges. Use user credentials or POST /_security/api_key/grant for programmatic key creation.
  • Always set expiration on API keys. Avoid indefinite keys in production.
  • Scope API keys via role_descriptors. Never create unscoped keys for automated systems.
  • Never receive, echo, or log passwords, API keys, tokens, or any credentials in the chat. Instruct the user to manage secrets in their terminal, environment variables, or files directly.
  • Never store secrets in code, scripts, or version control. Load from environment variables.
  • Use GET /_security/_authenticate to verify credentials before running management operations.
  • When generating passwords for native users, use at least 16 characters mixing uppercase, lowercase, digits, and symbols. Never use placeholder values like changeme or password123.
  • SAML and OIDC are for browser-based SSO only. Always configure a companion realm (native, file, or API keys) for REST API access alongside them.

Deployment Compatibility

Not all authentication realms are available on every deployment type. Self-managed clusters support all realms. Elastic Cloud Hosted (ECH) is managed by Elastic with no node-level access. Serverless is fully managed SaaS.

RealmSelf-managedECHServerless
NativeYesYesNot available
FileYesNot availableNot available
LDAPYesNot availableNot available
Active DirectoryYesNot availableNot available
PKIYesLimitedNot available
SAMLYesYes (deployment config)Organization-level
OIDCYesYes (deployment config)Not available
JWTYesYes (deployment config)Not available
KerberosYesNot availableNot available
API keysYesYesYes

ECH notes:

  • No node access, so the file realm and elasticsearch-users CLI are not available.
  • LDAP, Active Directory, and Kerberos cannot be configured on ECH.
  • SAML, OIDC, and JWT are configurable via the Cloud deployment settings UI.
  • The elastic superuser is available but should still be avoided for routine use.

Serverless notes:

  • API keys are the primary authentication method.
  • Native users do not exist — users are managed at the Elastic Cloud organization level.
  • SAML SSO is configured at the organization level, not per project.

平台分布

Codex

33.14%
按下载量换算1,281

Claude

32.8%
按下载量换算1,268

Cursor

19.66%
按下载量换算760

Gemini CLI

10.42%
按下载量换算403

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills