ignore-policy.asciidoc 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. [role="xpack"]
  2. [[audit-log-ignore-policy]]
  3. === Logfile audit events ignore policies
  4. The comprehensive audit trail is necessary to ensure accountability. It offers tremendous
  5. value during incident response and can even be required for demonstrating compliance.
  6. The drawback of an audited system is represented by the inevitable performance penalty incurred.
  7. In all truth, the audit trail spends _I/O ops_ that are not available anymore for the user's queries.
  8. Sometimes the verbosity of the audit trail may become a problem that the event type restrictions,
  9. <<audit-log-settings, defined by `include` and `exclude`>>, will not alleviate.
  10. *Audit events ignore policies* are a finer way to tune the verbosity of the audit trail.
  11. These policies define rules that match audit events which will be _ignored_ (read as: not printed).
  12. Rules match on the values of attributes of audit events and complement the `include` or `exclude` method.
  13. Imagine the corpus of audit events and the policies chopping off unwanted events.
  14. With a sole exception, all audit events are subject to the ignore policies.
  15. The exception are events of type `security_config_change`, which cannot be filtered out,
  16. unless excluded altogether.
  17. IMPORTANT: When utilizing audit events ignore policies you are acknowledging potential
  18. accountability gaps that could render illegitimate actions undetectable.
  19. Please take time to review these policies whenever your system architecture changes.
  20. A policy is a named set of filter rules. Each filter rule applies to a single event attribute,
  21. one of the `users`, `realms`, `roles` or `indices` attributes. The filter rule defines
  22. a list of <<regexp-syntax,Lucene regexp>>, *any* of which has to match the value of the audit
  23. event attribute for the rule to match.
  24. A policy matches an event if *all* the rules comprising it match the event.
  25. An audit event is ignored, therefore not printed, if it matches *any* policy. All other
  26. non-matching events are printed as usual.
  27. All policies are defined under the `xpack.security.audit.logfile.events.ignore_filters`
  28. settings namespace. For example, the following policy named _example1_ matches
  29. events from the _kibana_system_ or _admin_user_ principals that operate over indices of the
  30. wildcard form _app-logs*_:
  31. [source,yaml]
  32. ----------------------------
  33. xpack.security.audit.logfile.events.ignore_filters:
  34. example1:
  35. users: ["kibana_system", "admin_user"]
  36. indices: ["app-logs*"]
  37. ----------------------------
  38. An audit event generated by the _kibana_system_ user and operating over multiple indices
  39. , some of which do not match the indices wildcard, will not match.
  40. As expected, operations generated by all other users (even operating only on indices that
  41. match the _indices_ filter) will not match this policy either.
  42. Audit events of different types may have <<audit-event-attributes, different attributes>>.
  43. If an event does not contain an attribute for which some policy defines filters, the
  44. event will not match the policy.
  45. For example, the following policy will never match `authentication_success` or
  46. `authentication_failed` events, irrespective of the user's roles, because these
  47. event schemas do not contain the `role` attribute:
  48. [source,yaml]
  49. ----------------------------
  50. xpack.security.audit.logfile.events.ignore_filters:
  51. example2:
  52. roles: ["admin", "ops_admin_*"]
  53. ----------------------------
  54. Likewise, any events of users with multiple roles, some of which do not match the
  55. regexps will not match this policy.
  56. For completeness, although practical use cases should be sparse, a filter can match
  57. a missing attribute of an event, using the empty string ("") or the empty list ([]).
  58. For example, the following policy will match events that do not have the `indices`
  59. attribute (`anonymous_access_denied`, `authentication_success` and other types) as well
  60. as events over the _next_ index.
  61. [source,yaml]
  62. ----------------------------
  63. xpack.security.audit.logfile.events.ignore_filters:
  64. example3:
  65. indices: ["next", ""]
  66. ----------------------------