elasticsearch-audit
Enable, configure, and query Elasticsearch security audit logs. Use when the task involves audit logging setup, event filtering, or investigating security incidents like failed logins.
What this skill does
# Elasticsearch Audit Logging
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](references/api-reference.md).
> **Deployment note:** Audit logging configuration differs across deployment types. See
> [Deployment Compatibility](#deployment-compatibility) for details.
## Jobs to Be Done
- Enable or disable security audit logging on a cluster
- Select which security events to record (authentication, access, config changes)
- Create filter policies to reduce audit log noise
- Query audit logs for failed authentication attempts
- Investigate unauthorized access or privilege escalation incidents
- Set up compliance-focused audit configuration
- Detect brute-force login patterns from audit data
- Configure audit output to an index for programmatic querying
## Prerequisites
| 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
Enable audit logging dynamically without a restart:
```bash
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:
```bash
curl "${ELASTICSEARCH_URL}/_cluster/settings?include_defaults=true&flat_settings=true" \
<auth_flags> | jq '.defaults | with_entries(select(.key | startswith("xpack.security.audit")))'
```
## Audit Output
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. |
### Configure output via API
```bash
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.outputs` may require a static setting in `elasticsearch.yml`
> on older versions (pre-8.x). On 8.x+, prefer the cluster settings API.
## Select Events to Record
Control which event types are included or excluded. By default, all events are recorded when audit is enabled.
### Include specific events only
```bash
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"
]
}
}'
```
### Exclude noisy events
```bash
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 types reference
| 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](references/api-reference.md) for the complete event type list with field details.
## Filter Policies
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.
### Ignore system and internal users
```bash
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"]
}
}
}
}'
```
### Ignore health-check traffic on specific indices
```bash
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-*"]
}
}
}
}'
```
### Filter policy fields
| 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.
### Remove a filter policy
Set the policy to `null`:
```bash
curl -X PUT "${ELASTICSEARCH_URL}/_cluster/settings" \
<auth_Related in Security
mac-ops
IncludedComprehensive macOS workstation operations — diagnose kernel panics, identify failing drives, audit launchd startup items, decode wake reasons, triage TCC permission denials, manage APFS snapshots, recover from no-boot. Use for: Mac is slow, slow bootup, won't boot, kernel panic, kernel_task hot, mds_stores CPU, photoanalysisd, cloudd, login loop, gray screen, sleep wake failure, drive failing, IO errors, APFS snapshots eating space, Time Machine local snapshots, Spotlight indexing, launchd, LaunchAgent, LaunchDaemon, login items, TCC permissions, Full Disk Access, Screen Recording denied, Gatekeeper, quarantine, com.apple.quarantine, app is damaged, helper tool, /Library/PrivilegedHelperTools, pmset, wake reasons, dark wake, sysdiagnose, panic.ips, DiagnosticReports, configuration profile, MDM profile, remote diagnostics over SSH.
a11y-audit
IncludedRun accessibility audits on web projects combining automated scanning (axe-core, Lighthouse) with WCAG 2.1 AA compliance mapping, manual check guidance, and structured reporting. Output is configurable: markdown report only, markdown plus machine-readable JSON, or markdown plus issue tracker integration. Use this skill whenever the user mentions "accessibility audit", "a11y audit", "WCAG audit", "accessibility check", "compliance scan", or asks to check a web project for accessibility issues. Also trigger when the user wants to verify WCAG conformance or map findings to a specific standard (CAN-ASC-6.2, EN 301 549, ADA/AODA).
erpclaw
IncludedAI-native ERP system with self-extending OS. Full accounting, invoicing, inventory, purchasing, tax, billing, HR, payroll, advanced accounting (ASC 606/842, intercompany, consolidation), and financial reporting. 413 actions across 14 domains, 43 expansion modules. Constitutional guardrails, adversarial audit, schema migration. Double-entry GL, immutable audit trail, US GAAP.
assess
IncludedAssesses and rates quality 0-10 across multiple dimensions (correctness, maintainability, security, performance, testability, simplicity) with pros/cons analysis. Compares against project conventions and prior decisions from memory. Produces structured evaluation reports with actionable improvement suggestions. Use when evaluating code, designs, architectures, or comparing alternative approaches.
spring-boot-security-jwt
IncludedProvides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based access control using Spring Security 6.x. Use when implementing authentication or authorization in Spring Boot applications.
code-hardcode-audit
IncludedDetect hardcoded values, magic numbers, and leaked secrets. TRIGGERS - hardcode audit, magic numbers, PLR2004, secret scanning.