Enable and configure security audit logging for Elasticsearch via the cluster settings API. Audit logs record security
Works with
events such as authentication attempts, access grants and denials, role changes, and API key operations — essential for
compliance and incident investigation.
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionelasticsearch-auditExecute the skills CLI command in your project's root directory to begin installation:
Fetches elasticsearch-audit from elastic/agent-skills and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate elasticsearch-audit. Access via /elasticsearch-audit in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Create detailed user stories, acceptance criteria, and feature specs
Example
Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios
Reduce spec writing time by 50%, ensure comprehensive coverage
Research competitors, compare features, identify gaps
Example
Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities
Complete competitive research in 2 hours instead of 2 days
Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs
Example
Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale
0
total installs
0
this week
296
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
296
stars
Enable and configure security audit logging for Elasticsearch via the cluster settings API. Audit logs record security events such as authentication attempts, access grants and denials, role changes, and API key operations — essential for compliance and incident investigation.
For Kibana audit logging (saved object access, login/logout, space operations), see kibana-audit. For authentication and API key management, see elasticsearch-authn. For roles and user management, see elasticsearch-authz. For diagnosing security errors, see elasticsearch-security-troubleshooting.
For detailed API endpoints and event types, see references/api-reference.md.
Deployment note: Audit logging configuration differs across deployment types. See Deployment Compatibility for details.
| Item | Description |
|---|---|
| Elasticsearch URL | Cluster endpoint (e.g. https://localhost:9200 or a Cloud deployment URL) |
| Authentication | Valid credentials (see the elasticsearch-authn skill) |
| Cluster privileges | manage cluster privilege to update cluster settings |
| License | Audit logging requires a gold, platinum, enterprise, or trial license |
Prompt the user for any missing values.
Enable audit logging dynamically without a restart:
curl -X PUT "${ELASTICSEARCH_URL}/_cluster/settings" \
<auth_flags> \
-H "Content-Type: application/json" \
-d '{
"persistent": {
"xpack.security.audit.enabled": true
}
}'
To disable, set xpack.security.audit.enabled to false. Verify current state:
curl "${ELASTICSEARCH_URL}/_cluster/settings?include_defaults=true&flat_settings=true" \
<auth_flags> | jq '.defaults | with_entries(select(.key | startswith("xpack.security.audit")))'
Audit events can be written to two outputs. Both can be active simultaneously.
| Output | Setting value | Description |
|---|---|---|
| logfile | logfile |
Written to <ES_HOME>/logs/<cluster>_audit.json. Default. |
| index | index |
Written to .security-audit-* indices. Queryable via the API. |
curl -X PUT "${ELASTICSEARCH_URL}/_cluster/settings" \
<auth_flags> \
-H "Content-Type: application/json" \
-d '{
"persistent": {
"xpack.security.audit.enabled": true,
"xpack.security.audit.outputs": ["index", "logfile"]
}
}'
The index output is required for programmatic querying of audit events. The logfile output is useful for shipping to
external SIEM tools via Filebeat.
Note: On self-managed clusters,
xpack.security.audit.outputsmay require a static setting inelasticsearch.ymlon older versions (pre-8.x). On 8.x+, prefer the cluster settings API.
Control which event types are included or excluded. By default, all events are recorded when audit is enabled.
curl -X PUT "${ELASTICSEARCH_URL}/_cluster/settings" \
<auth_flags> \
-H "Content-Type: application/json" \
-d '{
"persistent": {
"xpack.security.audit.logfile.events.include": [
"authentication_failed",
"access_denied",
"access_granted",
"anonymous_access_denied",
"tampered_request",
"run_as_denied",
"connection_denied"
]
}
}'
curl -X PUT "${ELASTICSEARCH_URL}/_cluster/settings" \
<auth_flags> \
-H "Content-Type: application/json" \
-d '{
"persistent": {
"xpack.security.audit.logfile.events.exclude": [
"access_granted"
]
}
}'
Excluding access_granted significantly reduces log volume on busy clusters — use this when only failures matter.
| Event | Fires when |
|---|---|
authentication_failed |
Credentials were rejected |
authentication_success |
User authenticated successfully |
access_granted |
An authorized action was performed |
access_denied |
An action was denied due to insufficient privileges |
anonymous_access_denied |
An unauthenticated request was rejected |
tampered_request |
A request was detected as tampered with |
connection_granted |
A node joined the cluster (transport layer) |
connection_denied |
A node connection was rejected |
run_as_granted |
A run-as impersonation was authorized |
run_as_denied |
A run-as impersonation was denied |
security_config_change |
A security setting was changed (role, user, API key, etc.) |
See references/api-reference.md for the complete event type list with field details.
Filter policies let you suppress specific audit events by user, realm, role, or index without disabling the event type globally. Multiple policies can be active — an event is logged only if no policy filters it out.
curl -X PUT "${ELASTICSEARCH_URL}/_cluster/settings" \
<auth_flags> \
-H "Content-Type: application/json" \
-d '{
"persistent": {
"xpack.security.audit.logfile.events.ignore_filters": {
"system_users": {
"users": ["_xpack_security", "_xpack", "elastic/fleet-server"],
"realms": ["_service_account"]
}
}
}
}'
curl -X PUT "${ELASTICSEARCH_URL}/_cluster/settings" \
<auth_flags> \
-H "Content-Type: application/json" \
-d '{
"persistent": {
"xpack.security.audit.logfile.events.ignore_filters": {
"health_checks": {
"users": ["monitoring-user"],
"indices": [".monitoring-*"]
}
}
}
}'
| Field | Type | Description |
|---|---|---|
users |
array[string] | Usernames to exclude (supports wildcards) |
realms |
array[string] | Realm names to exclude |
roles |
array[string] | Role names to exclude |
indices |
array[string] | Index names or patterns to exclude (supports *) |
actions |
array[string] | Action names to exclude (e.g. indices:data/read/*) |
An event is filtered out if it matches all specified fields within a single policy.
Set the policy to null:
curl -X PUT "${ELASTICSEARCH_URL}/_cluster/settings" \
<auth_flags> \
-H "Content-Type: application/json" \
-d '{
"persistent": {
"xpack.security.audit.logfile.events.ignore_filters.health_checks": null
}
}'
When the index output is enabled, audit events are stored in .security-audit-* indices and can be queried.
curl -X POST "${ELASTICSEARCH_URL}/.security-audit-*/_search" \
<auth_flags> \
-H "Content-Type: application/json" \
-d '{
"query": {
"bool": {
"filter": [
{ "term": { "event.action": "authentication_failed" } },
{ "range": { "@timestamp": { "gte": "now-24h" } } }
]
}
},
"sort": [{ "@timestamp": { "order": "desc" } }],
"size": 50
}'
curl -X POST "${ELASTICSEARCH_URL}/.security-audit-*/_search" \
<auth_flags> \
-H "Content-Type: application/json" \
-d '{
"query": {
"bool": {
"filter": [
{ "term": { "event.action": "access_denied" } },
{ "term": { "indices": "logs-*" } },
{ "range": { "@timestamp": { "gte": "now-7d" } } }
]
}
},
"sort": [{ "@timestamp": { "order": "desc" } }],
"size": 20
}'
curl -X POST "${ELASTICSEARCH_URL}/.security-audit-*/_search" \
<auth_flags> \
-H "Content-Type: application/json" \
-d '{
"query": {
"bool": {
"filter": [
{ "term": { "event.action": "security_config_change" } },
{ "range": { "@timestamp": { "gte": "now-7d" } } }
]
}
},
"sort": [{ "@timestamp": { "order": "desc" } }],
"size": 50
}'
This captures role creation/deletion, user changes, API key operations, and role mapping updates.
Use terms aggregations on event.action (with size: 0) to count events by type over a time window. To detect
brute-force attempts, aggregate authentication_failed events by source.ip<
Make data-driven prioritization decisions faster
Draft PRDs, status updates, and stakeholder presentations
Example
Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement
Save 3-5 hours/week on communication overhead
Prerequisites
Time Estimate
30-60 minutes to see productivity improvements
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.
✗ Avoid when
Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.
shadcn/improve
mattpocock/skills
parcadei/continuous-claude-v3
cursor/plugins
ailabs-393/ai-labs-claude-skills
pproenca/dot-skills
elasticsearch-audit reduced setup friction for our internal harness; good balance of opinion and flexibility.
We added elasticsearch-audit from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
elasticsearch-audit has been reliable in day-to-day use. Documentation quality is above average for community skills.
Solid pick for teams standardizing on skills: elasticsearch-audit is focused, and the summary matches what you get after install.
elasticsearch-audit fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
I recommend elasticsearch-audit for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
elasticsearch-audit is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
We added elasticsearch-audit from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
Useful defaults in elasticsearch-audit — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
Keeps context tight: elasticsearch-audit is the kind of skill you can hand to a new teammate without a long onboarding doc.
showing 1-10 of 37