|
| 1 | +--- |
| 2 | +applies: |
| 3 | + hosted: all |
| 4 | + ece: all |
| 5 | + eck: all |
| 6 | + stack: all |
| 7 | + serverless: unavailable |
| 8 | +--- |
| 9 | + |
| 10 | +# Configure audit logging [audit-logging-configuration] |
| 11 | + |
| 12 | +When auditing security events, a single client request might generate multiple audit events across multiple cluster nodes, potentially leading to a high volume of log data and I/O operations. To maintain clarity and ensure logs remain actionable, {{es}} and {{kib}} provide configuration mechanisms to control what events are logged and which can be ignored. |
| 13 | + |
| 14 | +### Elasticsearch auditing configuration |
| 15 | + |
| 16 | +{{es}} configuration options include: |
| 17 | + |
| 18 | + * [{{es}} audited events settings](https://www.elastic.co/guide/en/elasticsearch/reference/current/auditing-settings.html#event-audit-settings): Use include and exclude filters to control the types of events that get logged. |
| 19 | + * [{{es}} node information settings](https://www.elastic.co/guide/en/elasticsearch/reference/current/auditing-settings.html#node-audit-settings): Control whether to add or hide node information such as hostname or IP address in the audited events. |
| 20 | + * [{{es}} ignore policies settings](https://www.elastic.co/guide/en/elasticsearch/reference/current/auditing-settings.html#audit-event-ignore-policies): Use ignore policies for fine-grained control over which audit events are printed to the log file. |
| 21 | + |
| 22 | + ::::{tip} |
| 23 | + In {{es}}, all auditing settings except `xpack.security.audit.enabled` are dynamic. This means you can configure them using the [cluster update settings API](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html), allowing changes to take effect immediately without requiring a restart. This approach is faster and more convenient than modifying `elasticsearch.yml`. |
| 24 | + :::: |
| 25 | + |
| 26 | +For a complete description of event details and format, refer to the following resources: |
| 27 | + * [{{es}} audit events details and schema]() asciidocalypse://elasticsearch/docs/reference/elasticsearch/elasticsearch-audit-events |
| 28 | + * [{{es}} log entry output format](/deploy-manage/monitor/logging-configuration/logfile-audit-output.md#audit-log-entry-format) |
| 29 | + |
| 30 | +### Kibana auditing configuration |
| 31 | + |
| 32 | +To control the logs that are outputted by Kibana, you can use [{{kib}} ignore filters](https://www.elastic.co/guide/en/kibana/current/security-settings-kb.html#audit-logging-ignore-filters). These are a list of filters that determine which events should be excluded from the audit log. |
| 33 | + |
| 34 | +In self-managed systems, you can optionally configure audit logs location, and file/rolling file using [{{kib}} audit logging settings](https://www.elastic.co/guide/en/kibana/current/security-settings-kb.html#audit-logging-settings). |
| 35 | + |
| 36 | + |
| 37 | +::::{tip} |
| 38 | +To configure {{kib}} settings, follow the same [procedure](./enabling-audit-logs.md#enable-audit-logging-procedure) as when enabling {{kib}} audit logs, but apply the relevant settings instead. |
| 39 | +:::: |
| 40 | + |
| 41 | +For a complete description of auditing event details, such as `category`, `type`, or `action`, refer to [{{kib}} audit events](https://www.elastic.co/guide/en/kibana/current/xpack-security-audit-logging.html#xpack-security-ecs-audit-logging). |
| 42 | + |
| 43 | +### General recommendations |
| 44 | + |
| 45 | +* Consider starting with {{es}} [`xpack.security.audit.logfile.events.include`](https://www.elastic.co/guide/en/elasticsearch/reference/current/auditing-settings.html#xpack-sa-lf-events-include) and [{{kib}} ignore filters](https://www.elastic.co/guide/en/kibana/current/security-settings-kb.html#audit-logging-ignore-filters) settings to specify the type of events you want to include or exclude in the auditing output. |
| 46 | + |
| 47 | +* If you need a more granular control, refer to [{{es}} audit events ignore policies](./logfile-audit-events-ignore-policies.md) for a better understanding how ignore policies work and when they are beneficial. |
| 48 | + |
| 49 | +* Refer to [auditing search queries](./auditing-search-queries.md) for details on logging request bodies in the {{es}} audit logs. |
| 50 | + |
| 51 | + ::::{important} |
| 52 | + Sensitive data may be audited in plain text when including the request body in audit events, even though all the security APIs, such as those that change the user’s password, have the credentials filtered out when audited. |
| 53 | + :::: |
0 commit comments