elasticsearch-security-troubleshooting
Diagnose and resolve Elasticsearch security errors: 401/403 failures, TLS problems, expired API keys, role mapping mismatches, and Kibana login issues. Use when the user reports a security error.
What this skill does
# Elasticsearch Security Troubleshooting
Diagnose and resolve common Elasticsearch security issues. This skill provides a structured triage workflow for
authentication failures, authorization errors, TLS problems, API key issues, role mapping mismatches, Kibana login
failures, and license-expiry lockouts.
For authentication methods and API key management, see the **elasticsearch-authn** skill. For roles, users, and role
mappings, see the **elasticsearch-authz** skill. For license management, see the **elasticsearch-license** skill.
For diagnostic API endpoints, see [references/api-reference.md](references/api-reference.md).
> **Deployment note:** Diagnostic API availability differs between self-managed, ECH, and Serverless. See
> [Deployment Compatibility](#deployment-compatibility) for details.
## Jobs to Be Done
- Diagnose HTTP 401 authentication failures
- Diagnose HTTP 403 permission denied errors
- Troubleshoot TLS/SSL handshake or certificate errors
- Investigate expired or invalid API keys
- Debug role mappings that do not grant expected roles
- Fix Kibana login failures, redirect loops, or CORS errors
- Recover from a license-expiry lockout
- Determine why a user lacks access to a specific index
## Prerequisites
| Item | Description |
| ---------------------- | -------------------------------------------------------------------------- |
| **Elasticsearch URL** | Cluster endpoint (e.g. `https://localhost:9200` or a Cloud deployment URL) |
| **Authentication** | Any valid credentials — even minimal — to reach the cluster |
| **Cluster privileges** | `monitor` for read-only diagnostics; `manage_security` for fixes |
Prompt the user for any missing values. If the user cannot authenticate at all, start with
[TLS and Certificate Errors](#tls-and-certificate-errors) or [License Expiry Recovery](#license-expiry-recovery).
## Diagnostic Workflow
Route the symptom to the correct section:
| Symptom | Section |
| ---------------------------------------------- | ------------------------------------------------------------- |
| HTTP 401, `authentication_exception` | [Authentication Failures](#authentication-failures-401) |
| HTTP 403, `security_exception`, access denied | [Authorization Failures](#authorization-failures-403) |
| SSL/TLS handshake error, certificate rejected | [TLS and Certificate Errors](#tls-and-certificate-errors) |
| API key rejected, expired, or ineffective | [API Key Issues](#api-key-issues) |
| Role mapping not granting expected roles | [Role Mapping Issues](#role-mapping-issues) |
| Kibana login broken, redirect loop, CORS error | [Kibana Authentication Issues](#kibana-authentication-issues) |
| All users locked out, paid features disabled | [License Expiry Recovery](#license-expiry-recovery) |
Each section follows a **Gather - Diagnose - Resolve** pattern.
## Diagnostic Toolkit
Use these APIs at the start of any security investigation:
```bash
curl <auth_flags> "${ELASTICSEARCH_URL}/_security/_authenticate"
```
Confirms identity, realm, and roles. If this fails with 401, the problem is authentication.
```bash
curl <auth_flags> "${ELASTICSEARCH_URL}/_xpack"
```
Confirms whether security is enabled (`features.security.enabled`). If security is disabled, all security APIs return
errors.
```bash
curl -X POST "${ELASTICSEARCH_URL}/_security/user/_has_privileges" \
<auth_flags> \
-H "Content-Type: application/json" \
-d '{
"index": [
{ "names": ["'"${INDEX_PATTERN}"'"], "privileges": ["read"] }
]
}'
```
Tests whether the authenticated user holds specific privileges without requiring `manage_security`.
```bash
curl <auth_flags> "${ELASTICSEARCH_URL}/_license"
```
Check license type and status. An expired paid license disables paid realms and features.
## Authentication Failures (401)
A 401 response means Elasticsearch could not verify the caller's identity.
### Gather
```bash
curl -v <auth_flags> "${ELASTICSEARCH_URL}/_security/_authenticate" 2>&1
```
The `-v` flag shows headers and the response body. Look for:
- `WWW-Authenticate` header — indicates which auth schemes the cluster accepts.
- `authentication_exception` in the response body — the `reason` field describes what failed.
### Diagnose
| Symptom | Likely cause |
| -------------------------------------------------- | ----------------------------------------------- |
| `unable to authenticate user` | Wrong username or password |
| `unable to authenticate with provided credentials` | Credentials do not match any realm in the chain |
| `user is not enabled` | The native user account is disabled |
| `token is expired` | API key or bearer token has expired |
| No `WWW-Authenticate` header | Security may be disabled; check `GET /_xpack` |
If the user authenticates via an external realm (LDAP, AD, SAML, OIDC), the realm chain order matters. Elasticsearch
tries realms in configured order and stops at the first match. If a higher-priority realm rejects the credentials before
the intended realm is reached, authentication fails.
### Resolve
| Cause | Action |
| ----------------------- | -------------------------------------------------------------------------- |
| Wrong credentials | Verify username/password or API key value. See **elasticsearch-authn**. |
| Disabled user | `PUT /_security/user/{name}/_enable`. See **elasticsearch-authz**. |
| Expired API key | Create a new API key. See [API Key Issues](#api-key-issues). |
| Realm chain order | Check `elasticsearch.yml` realm order (self-managed only). |
| Security disabled | Enable `xpack.security.enabled: true` in `elasticsearch.yml` and restart. |
| Paid realm after expiry | License expired — see [License Expiry Recovery](#license-expiry-recovery). |
## Authorization Failures (403)
A 403 response means the user is authenticated but lacks the required privileges.
### Gather
Test the specific privileges the operation requires:
```bash
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"]
}'
```
The response contains a `has_all_requested` boolean and per-resource breakdowns.
Also check the user's effective roles:
```bash
curl <auth_flags> "${ELASTICSEARCH_URL}/_security/_authenticate"
```
Inspect the `roles` array and `authentication_realm` to confirm the user is who you expect.
### Diagnose
| Symptom | Likely cause |
| ----------------------------------------- | ------------------------------------------------------ |
| `has_all_requested: false` for an index | Role is missing the required index privilege |
| `has_all_requested: false` for a cluster | 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 |
### Resolve
| Cause | Action Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.