elasticsearch auth_error ai_generated true

ElasticsearchSecurityException: 缺少身份验证凭据 [全局]

ElasticsearchSecurityException: missing authentication credentials [global]

ID: elasticsearch/missing-authentication-credentials

其他格式: JSON · Markdown 中文 · English
95%修复率
87%置信度
1证据数
2023-11-20首次发现

版本兼容性

版本状态引入弃用备注
7.17.0 active
8.10.0 active
8.14.0 active

根因分析

对 Elasticsearch 的请求缺少必要的身份验证凭据,通常是由于缺少 API 密钥或令牌。

English

A request to Elasticsearch lacks required authentication credentials, often due to missing API key or token.

generic

官方文档

https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html

解决方案

  1. 通过 Kibana 或 `POST /_security/api_key` 端点生成新的 API 密钥,并将其包含在 `Authorization` 头中:`Authorization: ApiKey <base64编码的密钥>`。
  2. 在请求中使用有效的用户名和密码:`curl -u username:password https://localhost:9200/_cluster/health`。
  3. 使用服务账户令牌配置客户端:`PUT _security/service/elastic/kibana/credential/token`,并在请求中使用。

无效尝试

常见但无效的做法:

  1. 70% 失败

    Disabling security exposes the cluster to unauthorized access and is not a proper fix.

  2. 95% 失败

    Restarting does not provide the missing credentials; the error will recur.

  3. 90% 失败

    The client still uses old credentials, causing authentication failure.