elasticsearch
auth_error
ai_generated
true
ElasticsearchSecurityException: 缺少身份验证凭据 [全局]
ElasticsearchSecurityException: missing authentication credentials [global]
ID: elasticsearch/missing-authentication-credentials
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.
官方文档
https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html解决方案
-
通过 Kibana 或 `POST /_security/api_key` 端点生成新的 API 密钥,并将其包含在 `Authorization` 头中:`Authorization: ApiKey <base64编码的密钥>`。
-
在请求中使用有效的用户名和密码:`curl -u username:password https://localhost:9200/_cluster/health`。
-
使用服务账户令牌配置客户端:`PUT _security/service/elastic/kibana/credential/token`,并在请求中使用。
无效尝试
常见但无效的做法:
-
70% 失败
Disabling security exposes the cluster to unauthorized access and is not a proper fix.
-
95% 失败
Restarting does not provide the missing credentials; the error will recur.
-
90% 失败
The client still uses old credentials, causing authentication failure.