audit-settings.asciidoc 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. [role="xpack"]
  2. [[auditing-settings]]
  3. === Auditing security settings
  4. ++++
  5. <titleabbrev>Auditing settings</titleabbrev>
  6. ++++
  7. [[auditing-settings-description]]
  8. You can use <<enable-audit-logging,audit logging>> to record security-related
  9. events, such as authentication failures, refused connections, and data-access
  10. events.
  11. If configured, auditing settings must be set on every node in the cluster.
  12. Static settings, such as `xpack.security.audit.enabled`, must be configured in
  13. `elasticsearch.yml` on each node. For dynamic auditing settings, use the
  14. <<cluster-update-settings,cluster update settings API>> to ensure the setting is
  15. the same on all nodes.
  16. [[general-audit-settings]]
  17. ==== General Auditing Settings
  18. [[xpack-security-audit-enabled]]
  19. // tag::xpack-security-audit-enabled-tag[]
  20. `xpack.security.audit.enabled`::
  21. (<<static-cluster-setting,Static>>)
  22. Set to `true` to enable auditing on the node. The default value is `false`. This
  23. puts the auditing events in a dedicated file named `<clustername>_audit.json` on
  24. each node.
  25. +
  26. If enabled, this setting must be configured in `elasticsearch.yml` on all nodes
  27. in the cluster.
  28. // end::xpack-security-audit-enabled-tag[]
  29. [[event-audit-settings]]
  30. ==== Audited Event Settings
  31. The events and some other information about what gets logged can be controlled
  32. by using the following settings:
  33. [[xpack-sa-lf-events-include]]
  34. // tag::xpack-sa-lf-events-include-tag[]
  35. `xpack.security.audit.logfile.events.include`::
  36. (<<dynamic-cluster-setting,Dynamic>>)
  37. Specifies which events to include in the auditing output. The default value is:
  38. `access_denied, access_granted, anonymous_access_denied, authentication_failed,
  39. connection_denied, tampered_request, run_as_denied, run_as_granted`.
  40. // end::xpack-sa-lf-events-include-tag[]
  41. [[xpack-sa-lf-events-exclude]]
  42. // tag::xpack-sa-lf-events-exclude-tag[]
  43. `xpack.security.audit.logfile.events.exclude`::
  44. (<<dynamic-cluster-setting,Dynamic>>)
  45. Excludes the specified events from the output. By default, no events are
  46. excluded.
  47. // end::xpack-sa-lf-events-exclude-tag[]
  48. [[xpack-sa-lf-events-emit-request]]
  49. // tag::xpack-sa-lf-events-emit-request-tag[]
  50. `xpack.security.audit.logfile.events.emit_request_body`::
  51. (<<dynamic-cluster-setting,Dynamic>>)
  52. Specifies whether to include the request body from REST requests on certain
  53. event types such as `authentication_failed`. The default value is `false`.
  54. +
  55. --
  56. IMPORTANT: No filtering is performed when auditing, so sensitive data may be
  57. audited in plain text when including the request body in audit events.
  58. --
  59. // end::xpack-sa-lf-events-emit-request-tag[]
  60. [[node-audit-settings]]
  61. ==== Local Node Info Settings
  62. [[xpack-sa-lf-emit-node-name]]
  63. // tag::xpack-sa-lf-emit-node-name-tag[]
  64. `xpack.security.audit.logfile.emit_node_name`::
  65. (<<dynamic-cluster-setting,Dynamic>>)
  66. Specifies whether to include the <<node-name,node name>> as a field in
  67. each audit event. The default value is `false`.
  68. // end::xpack-sa-lf-emit-node-name-tag[]
  69. [[xpack-sa-lf-emit-node-host-address]]
  70. // tag::xpack-sa-lf-emit-node-host-address-tag[]
  71. `xpack.security.audit.logfile.emit_node_host_address`::
  72. (<<dynamic-cluster-setting,Dynamic>>)
  73. Specifies whether to include the node's IP address as a field in each audit event.
  74. The default value is `false`.
  75. // end::xpack-sa-lf-emit-node-host-address-tag[]
  76. [[xpack-sa-lf-emit-node-host-name]]
  77. // tag::xpack-sa-lf-emit-node-host-name-tag[]
  78. `xpack.security.audit.logfile.emit_node_host_name`::
  79. (<<dynamic-cluster-setting,Dynamic>>)
  80. Specifies whether to include the node's host name as a field in each audit event.
  81. The default value is `false`.
  82. // end::xpack-sa-lf-emit-node-host-name-tag[]
  83. [[xpack-sa-lf-emit-node-id]]
  84. // tag::xpack-sa-lf-emit-node-id-tag[]
  85. `xpack.security.audit.logfile.emit_node_id`::
  86. (<<dynamic-cluster-setting,Dynamic>>)
  87. Specifies whether to include the node id as a field in each audit event.
  88. This is available for the new format only. That is to say, this information
  89. does not exist in the `<clustername>_access.log` file.
  90. Unlike <<node-name,node name>>, whose value might change if the administrator
  91. changes the setting in the config file, the node id will persist across cluster
  92. restarts and the administrator cannot change it.
  93. The default value is `true`.
  94. // end::xpack-sa-lf-emit-node-id-tag[]
  95. [[audit-event-ignore-policies]]
  96. ==== Audit Logfile Event Ignore Policies
  97. These settings affect the <<audit-log-ignore-policy,ignore policies>>
  98. that enable fine-grained control over which audit events are printed to the log file.
  99. All of the settings with the same policy name combine to form a single policy.
  100. If an event matches all of the conditions for a specific policy, it is ignored
  101. and not printed.
  102. [[xpack-sa-lf-events-ignore-users]]
  103. // tag::xpack-sa-lf-events-ignore-users-tag[]
  104. `xpack.security.audit.logfile.events.ignore_filters.<policy_name>.users`::
  105. (<<dynamic-cluster-setting,Dynamic>>)
  106. A list of user names or wildcards. The specified policy will
  107. not print audit events for users matching these values.
  108. // end::xpack-sa-lf-events-ignore-users-tag[]
  109. [[xpack-sa-lf-events-ignore-realms]]
  110. // tag::xpack-sa-lf-events-ignore-realms-tag[]
  111. `xpack.security.audit.logfile.events.ignore_filters.<policy_name>.realms`::
  112. (<<dynamic-cluster-setting,Dynamic>>)
  113. A list of authentication realm names or wildcards. The specified policy will
  114. not print audit events for users in these realms.
  115. // end::xpack-sa-lf-events-ignore-realms-tag[]
  116. [[xpack-sa-lf-events-ignore-roles]]
  117. // tag::xpack-sa-lf-events-ignore-roles-tag[]
  118. `xpack.security.audit.logfile.events.ignore_filters.<policy_name>.roles`::
  119. (<<dynamic-cluster-setting,Dynamic>>)
  120. A list of role names or wildcards. The specified policy will
  121. not print audit events for users that have these roles. If the user has several
  122. roles, some of which are *not* covered by the policy, the policy will
  123. *not* cover this event.
  124. // end::xpack-sa-lf-events-ignore-roles-tag[]
  125. [[xpack-sa-lf-events-ignore-indices]]
  126. // tag::xpack-sa-lf-events-ignore-indices-tag[]
  127. `xpack.security.audit.logfile.events.ignore_filters.<policy_name>.indices`::
  128. (<<dynamic-cluster-setting,Dynamic>>)
  129. A list of index names or wildcards. The specified policy will
  130. not print audit events when all the indices in the event match
  131. these values. If the event concerns several indices, some of which are
  132. *not* covered by the policy, the policy will *not* cover this event.
  133. // end::xpack-sa-lf-events-ignore-indices-tag[]