Loading...
Loading...
Compare original and translation side by side
Deployment note: Diagnostic API availability differs between self-managed, ECH, and Serverless. See Deployment Compatibility for details.
部署说明: 诊断API的可用性在自托管、ECH和Serverless部署之间存在差异。详情请见 部署兼容性。
| Item | Description |
|---|---|
| Elasticsearch URL | Cluster endpoint (e.g. |
| Authentication | Any valid credentials — even minimal — to reach the cluster |
| Cluster privileges | |
| Symptom | Section |
|---|---|
HTTP 401, | Authentication Failures |
HTTP 403, | Authorization Failures |
| SSL/TLS handshake error, certificate rejected | TLS and Certificate Errors |
| API key rejected, expired, or ineffective | API Key Issues |
| Role mapping not granting expected roles | Role Mapping Issues |
| Kibana login broken, redirect loop, CORS error | Kibana Authentication Issues |
| All users locked out, paid features disabled | License Expiry Recovery |
curl <auth_flags> "${ELASTICSEARCH_URL}/_security/_authenticate"curl <auth_flags> "${ELASTICSEARCH_URL}/_xpack"features.security.enabledcurl -X POST "${ELASTICSEARCH_URL}/_security/user/_has_privileges" \
<auth_flags> \
-H "Content-Type: application/json" \
-d '{
"index": [
{ "names": ["'"${INDEX_PATTERN}"'"], "privileges": ["read"] }
]
}'manage_securitycurl <auth_flags> "${ELASTICSEARCH_URL}/_license"curl <auth_flags> "${ELASTICSEARCH_URL}/_security/_authenticate"curl <auth_flags> "${ELASTICSEARCH_URL}/_xpack"features.security.enabledcurl -X POST "${ELASTICSEARCH_URL}/_security/user/_has_privileges" \
<auth_flags> \
-H "Content-Type: application/json" \
-d '{
"index": [
{ "names": ["'"${INDEX_PATTERN}"'"], "privileges": ["read"] }
]
}'manage_securitycurl <auth_flags> "${ELASTICSEARCH_URL}/_license"curl -v <auth_flags> "${ELASTICSEARCH_URL}/_security/_authenticate" 2>&1-vWWW-Authenticateauthentication_exceptionreasoncurl -v <auth_flags> "${ELASTICSEARCH_URL}/_security/_authenticate" 2>&1-vWWW-Authenticateauthentication_exceptionreason| Symptom | Likely cause |
|---|---|
| Wrong username or password |
| Credentials do not match any realm in the chain |
| The native user account is disabled |
| API key or bearer token has expired |
No | Security may be disabled; check |
| 症状 | 可能原因 |
|---|---|
| 用户名或密码错误 |
| 凭据与认证链中的任何域都不匹配 |
| 本地用户账户已被禁用 |
| API密钥或Bearer令牌已过期 |
无 | 安全功能可能已禁用;请检查 |
| Cause | Action |
|---|---|
| Wrong credentials | Verify username/password or API key value. See elasticsearch-authn. |
| Disabled user | |
| Expired API key | Create a new API key. See API Key Issues. |
| Realm chain order | Check |
| Security disabled | Enable |
| Paid realm after expiry | License expired — see License Expiry Recovery. |
curl -X POST "${ELASTICSEARCH_URL}/_security/user/_has_privileges" \
<auth_flags> \
-H "Content-Type: application/json" \
-d '{
"index": [
{ "names": ["logs-*"], "privileges": ["read", "view_index_metadata"] }
],
"cluster": ["monitor"]
}'has_all_requestedcurl <auth_flags> "${ELASTICSEARCH_URL}/_security/_authenticate"rolesauthentication_realmcurl -X POST "${ELASTICSEARCH_URL}/_security/user/_has_privileges" \
<auth_flags> \
-H "Content-Type: application/json" \
-d '{
"index": [
{ "names": ["logs-*"], "privileges": ["read", "view_index_metadata"] }
],
"cluster": ["monitor"]
}'has_all_requestedcurl <auth_flags> "${ELASTICSEARCH_URL}/_security/_authenticate"rolesauthentication_realm| Symptom | Likely cause |
|---|---|
| Role is missing the required index privilege |
| Role is missing the required cluster privilege |
| User has fewer roles than expected | Roles array was replaced (not merged) on last update |
| API key returns 403 on previously allowed | API key privileges are a snapshot — role changes after |
| operation | creation do not propagate to existing keys |
| 症状 | 可能原因 |
|---|---|
针对索引的 | 角色缺少所需的索引权限 |
针对集群的 | 角色缺少所需的集群权限 |
| 用户拥有的角色少于预期 | 上次更新时角色数组被替换(而非合并) |
| API密钥在之前允许的操作上返回403 | API密钥的权限是快照式的——创建密钥后角色的变更不会同步到现有密钥 |
| Cause | Action |
|---|---|
| Missing index privilege | Add the privilege to the role or create a new role. See elasticsearch-authz. |
| Missing cluster privilege | Add the cluster privilege. See elasticsearch-authz. |
| Roles replaced on update | Fetch current roles first, then update with the full array. See elasticsearch-authz. |
| Stale API key privileges | Create a new API key with updated |
| 原因 | 操作 |
|---|---|
| 缺少索引权限 | 为角色添加所需权限或创建新角色。请参考elasticsearch-authz。 |
| 缺少集群权限 | 为角色添加集群权限。请参考elasticsearch-authz。 |
| 更新时角色被替换 | 先获取当前角色,然后使用完整数组进行更新。请参考elasticsearch-authz。 |
| API密钥权限过时 | 使用更新后的 |
curl -v --cacert "${CA_CERT}" "https://${ELASTICSEARCH_HOST}:9200/" 2>&1 | head -30SSL certificate problem: unable to get local issuer certificateSSL certificate problem: certificate has expiredSSL: no alternative certificate subject name matches target host nameopenssl s_client -connect "${ELASTICSEARCH_HOST}:9200" -showcerts </dev/null 2>&1curl -v --cacert "${CA_CERT}" "https://${ELASTICSEARCH_HOST}:9200/" 2>&1 | head -30SSL certificate problem: unable to get local issuer certificateSSL certificate problem: certificate has expiredSSL: no alternative certificate subject name matches target host nameopenssl s_client -connect "${ELASTICSEARCH_HOST}:9200" -showcerts </dev/null 2>&1| Error message | Likely cause |
|---|---|
| Missing or wrong CA certificate |
| Server or CA certificate past expiry |
| Certificate SAN does not include the hostname |
| Self-signed cert not in the trust store |
| Truststore missing the CA or wrong password |
| 错误信息 | 可能原因 |
|---|---|
| 缺少或使用了错误的CA证书 |
| 服务器或CA证书已过期 |
| 证书的SAN不包含目标主机名 |
| 自签名证书不在信任存储中 |
| 信任存储中缺少CA证书或密码错误 |
| Cause | Action |
|---|---|
| Wrong CA cert | Pass the correct CA with |
| Expired certificate | Regenerate certificates with |
| Hostname mismatch | Regenerate the certificate with the correct SAN entries. |
| Self-signed cert | Distribute the CA cert to all clients or use a publicly trusted CA. |
| Quick workaround | Use |
| 原因 | 操作 |
|---|---|
| CA证书错误 | 使用 |
| 证书过期 | 使用 |
| 主机名不匹配 | 重新生成包含正确SAN条目的证书。 |
| 自签名证书 | 将CA证书分发给所有客户端,或使用公共可信CA。 |
| 临时解决方法 | 使用 |
curl "${ELASTICSEARCH_URL}/_security/api_key?name=${KEY_NAME}" <auth_flags>expirationinvalidatedrole_descriptorscurl "${ELASTICSEARCH_URL}/_security/api_key?name=${KEY_NAME}" <auth_flags>expirationinvalidatedrole_descriptors| Symptom | Likely cause |
|---|---|
| 401 when using the key | Key expired or invalidated |
| 403 on operations that should be allowed | Key was created with insufficient |
| Derived key has no access | API key created another API key — derived keys have no privilege |
| Key works for some indices but not others | |
| 症状 | 可能原因 |
|---|---|
| 使用密钥时返回401 | 密钥已过期或被吊销 |
| 本应允许的操作返回403 | 创建密钥时 |
| 派生密钥无访问权限 | API密钥创建了另一个API密钥——派生密钥没有任何权限 |
| 密钥对部分索引有效但对其他索引无效 | |
| Cause | Action |
|---|---|
| Expired key | Create a new key with appropriate |
| Invalidated key | Create a new key. Invalidated keys cannot be reinstated. |
| Wrong scope | Create a new key with correct |
| Derived key problem | Use |
| 原因 | 操作 |
|---|---|
| 密钥过期 | 创建带有合适 |
| 密钥被吊销 | 创建新密钥。被吊销的密钥无法恢复。 |
| 作用域错误 | 使用正确的 |
| 派生密钥问题 | 使用用户凭据执行 |
curl <auth_flags> "${ELASTICSEARCH_URL}/_security/_authenticate"usernameauthentication_realm.namerolescurl <auth_flags> "${ELASTICSEARCH_URL}/_security/role_mapping"rulesenabledcurl <auth_flags> "${ELASTICSEARCH_URL}/_security/_authenticate"usernameauthentication_realm.namerolescurl <auth_flags> "${ELASTICSEARCH_URL}/_security/role_mapping"rulesenabled| Symptom | Likely cause |
|---|---|
User has empty | No mapping matches the user's attributes |
| User gets wrong roles | A different mapping matched first or the rule is too broad |
| Mapping exists but does not apply | |
| Mustache template produces wrong role name | Template syntax error or unexpected attribute value |
authentication_realm.namegroups_authenticaterules| 症状 | 可能原因 |
|---|---|
用户的 | 没有映射匹配用户的属性 |
| 用户获得错误的角色 | 其他映射先匹配成功,或规则范围太广 |
| 映射存在但不生效 | |
| Mustache模板生成错误的角色名称 | 模板语法错误或属性值不符合预期 |
authentication_realm.namegroups_authenticaterules| Cause | Action |
|---|---|
| No matching rule | Update the mapping rules to match the user's realm and attributes. |
| Mapping disabled | Set |
| Template error | Test the Mustache template with known attribute values. See elasticsearch-authz. |
| Rule too broad | Add |
| 原因 | 操作 |
|---|---|
| 无匹配规则 | 更新映射规则以匹配用户的域和属性。 |
| 映射被禁用 | 将映射的 |
| 模板错误 | 使用已知的属性值测试Mustache模板。请参考elasticsearch-authz。 |
| 规则范围太广 | 添加 |
kbn-xsrfkbn-xsrfkbn-xsrfcurl -X PUT "${KIBANA_URL}/api/security/role/my-role" \
<auth_flags> \
-H "kbn-xsrf: true" \
-H "Content-Type: application/json" \
-d '{ ... }'400 Bad Request"Request must contain a kbn-xsrf header"kbn-xsrfcurl -X PUT "${KIBANA_URL}/api/security/role/my-role" \
<auth_flags> \
-H "kbn-xsrf: true" \
-H "Content-Type: application/json" \
-d '{ ... }'400 Bad Request"Request must contain a kbn-xsrf header"xpack.security.authc.realms.saml.*.sp.acsidp.metadata.pathelasticsearch.ymlserver.publicBaseUrlcurl <auth_flags> "${ELASTICSEARCH_URL}/_security/_authenticate"elasticsearch.ymlxpack.security.authc.realms.saml.*.sp.acsidp.metadata.pathserver.publicBaseUrlcurl <auth_flags> "${ELASTICSEARCH_URL}/_security/_authenticate"Unable to retrieve version information from Elasticsearch nodeselasticsearch.hostskibana.ymlelasticsearch.usernameelasticsearch.passwordelasticsearch.serviceAccountTokenUnable to retrieve version information from Elasticsearch nodeskibana.ymlelasticsearch.hostselasticsearch.usernameelasticsearch.passwordelasticsearch.serviceAccountTokencurl <auth_flags> "${ELASTICSEARCH_URL}/_license"license.status"expired"curl <auth_flags> "${ELASTICSEARCH_URL}/_license"license.status"expired"| Deployment | First step |
|---|---|
| Self-managed | Log in with a file-based user ( |
| ECH | Contact Elastic support or renew via the Cloud console. |
| Serverless | Not applicable — licensing is fully managed by Elastic. |
| 部署类型 | 第一步 |
|---|---|
| 自托管 | 使用文件用户( |
| ECH | 联系Elastic支持或通过云控制台续订许可证。 |
| Serverless | 不适用——许可证完全由Elastic管理。 |
logs-*curl -u "joe:${PASSWORD}" "${ELASTICSEARCH_URL}/_security/_authenticate""roles": ["viewer"]curl -X POST "${ELASTICSEARCH_URL}/_security/user/_has_privileges" \
-u "joe:${PASSWORD}" \
-H "Content-Type: application/json" \
-d '{"index": [{"names": ["logs-*"], "privileges": ["read"]}]}'"has_all_requested": falseviewerreadlogs-*logs-readerlogs-*curl -u "joe:${PASSWORD}" "${ELASTICSEARCH_URL}/_security/_authenticate""roles": ["viewer"]curl -X POST "${ELASTICSEARCH_URL}/_security/user/_has_privileges" \
-u "joe:${PASSWORD}" \
-H "Content-Type: application/json" \
-d '{"index": [{"names": ["logs-*"], "privileges": ["read"]}]}'"has_all_requested": falseviewerlogs-*readlogs-readercurl -u "admin:${PASSWORD}" "${ELASTICSEARCH_URL}/_security/api_key?name=my-key""expiration": 1709251200000expirationcurl -u "admin:${PASSWORD}" "${ELASTICSEARCH_URL}/_security/api_key?name=my-key""expiration": 1709251200000expirationcurl -u "elastic:${PASSWORD}" "${ELASTICSEARCH_URL}/_security/_authenticate"curl -s "${IDP_METADATA_URL}" | head -5server.publicBaseUrlkibana.ymlcurl -u "elastic:${PASSWORD}" "${ELASTICSEARCH_URL}/_security/_authenticate"curl -s "${IDP_METADATA_URL}" | head -5kibana.ymlserver.publicBaseUrlcurl -u "admin:${PASSWORD}" "${ELASTICSEARCH_URL}/_license""status": "expired""type": "platinum"curl -u "admin:${PASSWORD}" "${ELASTICSEARCH_URL}/_license""status": "expired""type": "platinum"_authenticate_authenticateGET /_security/_authenticateGET /_security/_authenticateGET /_licenseGET /_license_has_privileges_has_privilegesPOST /_security/user/_has_privilegesPOST /_security/user/_has_privilegeselasticmanage_securityelasticelasticmanage_securityelasticcurl -k--insecurecurl -k--insecure| Tool / API | Self-managed | ECH | Serverless |
|---|---|---|---|
| Yes | Yes | Yes |
| Yes | Yes | Yes |
| Yes | Yes | Limited |
| Yes | Yes (read) | Not available |
| Yes | Yes | Yes |
| Yes | Yes | Yes |
| Yes | Not available | Not available |
| Yes | Not available | Not available |
| Elasticsearch logs | Yes | Via Cloud UI | Via Cloud UI |
elasticsearch-users| 工具/API | 自托管 | ECH | Serverless |
|---|---|---|---|
| 是 | 是 | 是 |
| 是 | 是 | 是 |
| 是 | 是 | 受限 |
| 是 | 是(只读) | 不可用 |
| 是 | 是 | 是 |
| 是 | 是 | 是 |
| 是 | 不可用 | 不可用 |
节点上的 | 是 | 不可用 | 不可用 |
| Elasticsearch日志 | 是 | 通过云UI查看 | 通过云UI查看 |
elasticsearch-users