overview.asciidoc 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. [role="xpack"]
  2. [[auditing]]
  3. == Auditing security events
  4. You can enable auditing to keep track of security-related events such as
  5. authentication failures and refused connections. Logging these events enables you
  6. to monitor your cluster for suspicious activity and provides evidence in the
  7. event of an attack.
  8. [IMPORTANT]
  9. ============================================================================
  10. Audit logs are **disabled** by default. To enable this functionality, you
  11. must set `xpack.security.audit.enabled` to `true` in `elasticsearch.yml`.
  12. ============================================================================
  13. The {es} {security-features} provide two ways to persist audit logs:
  14. * The <<audit-log-output, `logfile`>> output, which persists events to
  15. a dedicated `<clustername>_audit.log` file on the host's file system.
  16. For backwards compatibility reasons, a file named `<clustername>_access.log`
  17. is also generated.
  18. * The <<audit-index, `index`>> output, which persists events to an Elasticsearch
  19. index. The audit index can reside on the same cluster, or a separate cluster.
  20. By default, only the `logfile` output is used when enabling auditing,
  21. implicitly outputting to both `<clustername>_audit.log` and `<clustername>_access.log`.
  22. To facilitate browsing and analyzing the events, you can also enable
  23. indexing by setting `xpack.security.audit.outputs` in `elasticsearch.yml`:
  24. [source,yaml]
  25. ----------------------------
  26. xpack.security.audit.outputs: [ index, logfile ]
  27. ----------------------------
  28. TIP: If you choose to enable the `index` output type, we strongly recommend that
  29. you still use the `logfile` output as the official record of events. If the
  30. target index is unavailable (for example, during a rolling upgrade), the `index`
  31. output can lose messages.