# Kibana Audit

> Enable and configure Kibana audit logging for saved object access, logins, and space operations. Use when setting up Kibana audit, filtering events, or correlating Kibana and ES audit logs.

- Skill: `aspectrr/kibana-audit` (Agent Skill)
- Install (CLI): `npx skillmds@latest add aspectrr/kibana-audit`
- Raw SKILL.md: https://api.skillmd.com/api/skills/aspectrr/kibana-audit/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- Author: aspectrr (https://skillmd.com/u/aspectrr)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/aspectrr/kibana-audit

---


# Kibana Audit Logging

Enable and configure audit logging for Kibana via `kibana.yml`. Covers application-layer security events: saved object
CRUD, login/logout, session expiry, and space operations.

## Enable Kibana Audit Logging

```yaml
xpack.security.audit.enabled: true
xpack.security.audit.appender:
  type: rolling-file
  fileName: /path/to/kibana/data/audit.log
  policy:
    type: time-interval
    interval: 24h
  strategy:
    type: numeric
    max: 10
```

A Kibana restart is required after changes.

## Event Types

| Event action                       | Description                                  |
| ---------------------------------- | -------------------------------------------- |
| `saved_object_create`              | A saved object was created                   |
| `saved_object_get`                 | A saved object was read                      |
| `saved_object_update`              | A saved object was updated                   |
| `saved_object_delete`              | A saved object was deleted                   |
| `saved_object_find`                | A saved object search was performed          |
| `login`                            | A user logged in (success or failure)        |
| `logout`                           | A user logged out                            |
| `session_cleanup`                  | An expired session was cleaned up            |
| `space_create/update/delete`       | Space operations                             |

## Filter Policies

```yaml
xpack.security.audit.ignore_filters:
  - actions: [saved_object_find]
    categories: [database]
```

## Correlate with ES Audit Logs

Both Kibana and ES record the same `trace.id` (via `X-Opaque-Id` header). This is the primary correlation key.

### Search ES audit by trace ID

```bash
curl -X POST "${ELASTICSEARCH_URL}/.security-audit-*/_search" \
  <auth_flags> \
  -H "Content-Type: application/json" \
  -d '{
    "query": {
      "bool": {
        "filter": [
          { "term": { "trace.id": "'"${TRACE_ID}"'" } },
          { "range": { "@timestamp": { "gte": "now-24h" } } }
        ]
      }
    },
    "sort": [{ "@timestamp": { "order": "asc" } }]
  }'
```

## Ship Kibana Audit to Elasticsearch

```yaml
filebeat.inputs:
  - type: log
    paths: ["/path/to/kibana/data/audit.log"]
    json.keys_under_root: true

output.elasticsearch:
  hosts: ["https://localhost:9200"]
  index: "kibana-audit-%{+yyyy.MM.dd}"
```

## Deployment Compatibility

| Capability                  | Self-managed | ECH          | Serverless    |
| --------------------------- | ------------ | ------------ | ------------- |
| Kibana audit                | Yes          | Via Cloud UI | Not available |
| Correlate via `trace.id`    | Yes          | Yes          | Not available |

## Guidelines

- Always enable alongside Elasticsearch audit for full coverage.
- Use `trace.id` for correlation between Kibana and ES events.
- Filter noisy `saved_object_find` events to reduce volume.
- Ship logs to Elasticsearch via Filebeat for unified querying.

