audit-settings.asciidoc 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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. In addition, changes via the APIs to the security configuration, such
  11. as creating, updating and removing <<native-realm, native>> and
  12. <<built-in-users, built-in>> users, <<security-api-put-role, roles>>,
  13. <<security-api-put-role-mapping, role mappings>> and
  14. <<security-api-create-api-key, API keys>> are also recorded.
  15. --
  16. TIP: Audit logs are only available on certain subscription levels.
  17. For more information, see {subscriptions}.
  18. --
  19. If configured, auditing settings must be set on every node in the cluster.
  20. Static settings, such as `xpack.security.audit.enabled`, must be configured in
  21. `elasticsearch.yml` on each node. For dynamic auditing settings, use the
  22. <<cluster-update-settings,cluster update settings API>> to ensure the setting is
  23. the same on all nodes.
  24. [[general-audit-settings]]
  25. ==== General Auditing Settings
  26. [[xpack-security-audit-enabled]]
  27. // tag::xpack-security-audit-enabled-tag[]
  28. `xpack.security.audit.enabled`::
  29. (<<static-cluster-setting,Static>>)
  30. Set to `true` to enable auditing on the node. The default value is `false`. This
  31. puts the auditing events in a dedicated file named `<clustername>_audit.json` on
  32. each node.
  33. +
  34. If enabled, this setting must be configured in `elasticsearch.yml` on all nodes
  35. in the cluster.
  36. // end::xpack-security-audit-enabled-tag[]
  37. [[event-audit-settings]]
  38. ==== Audited Event Settings
  39. The events and some other information about what gets logged can be controlled
  40. by using the following settings:
  41. [[xpack-sa-lf-events-include]]
  42. // tag::xpack-sa-lf-events-include-tag[]
  43. `xpack.security.audit.logfile.events.include`::
  44. (<<dynamic-cluster-setting,Dynamic>>)
  45. Specifies the <<audit-event-types, kind of events>> to print in the auditing output.
  46. In addition, `_all` can be used to exhaustively audit all the events, but this is usually
  47. discouraged since it will get very verbose.
  48. The default list value contains:
  49. `access_denied, access_granted, anonymous_access_denied, authentication_failed,
  50. connection_denied, tampered_request, run_as_denied, run_as_granted,
  51. security_config_change`.
  52. // end::xpack-sa-lf-events-include-tag[]
  53. [[xpack-sa-lf-events-exclude]]
  54. // tag::xpack-sa-lf-events-exclude-tag[]
  55. `xpack.security.audit.logfile.events.exclude`::
  56. (<<dynamic-cluster-setting,Dynamic>>)
  57. Excludes the specified <<audit-event-types, kind of events>> from the include list.
  58. This is useful in the case where the `events.include` setting contains the special value `_all`.
  59. The default is the empty list.
  60. // end::xpack-sa-lf-events-exclude-tag[]
  61. [[xpack-sa-lf-events-emit-request]]
  62. // tag::xpack-sa-lf-events-emit-request-tag[]
  63. `xpack.security.audit.logfile.events.emit_request_body`::
  64. (<<dynamic-cluster-setting,Dynamic>>)
  65. Specifies whether to include the full request body from REST requests as an
  66. attribute of certain kinds of audit events. This setting can be used to
  67. <<auditing-search-queries, audit search queries>>.
  68. +
  69. The default value is `false`, so request bodies are not printed.
  70. +
  71. --
  72. IMPORTANT: Be advised that sensitive data may be audited in plain text when including
  73. the request body in audit events, even though all the security APIs, such as those that
  74. change the user's password, have the credentials filtered out when audited.
  75. --
  76. // end::xpack-sa-lf-events-emit-request-tag[]
  77. [[node-audit-settings]]
  78. ==== Local Node Info Settings
  79. [[xpack-sa-lf-emit-node-name]]
  80. // tag::xpack-sa-lf-emit-node-name-tag[]
  81. `xpack.security.audit.logfile.emit_node_name`::
  82. (<<dynamic-cluster-setting,Dynamic>>)
  83. Specifies whether to include the <<node-name,node name>> as a field in
  84. each audit event. The default value is `false`.
  85. // end::xpack-sa-lf-emit-node-name-tag[]
  86. [[xpack-sa-lf-emit-node-host-address]]
  87. // tag::xpack-sa-lf-emit-node-host-address-tag[]
  88. `xpack.security.audit.logfile.emit_node_host_address`::
  89. (<<dynamic-cluster-setting,Dynamic>>)
  90. Specifies whether to include the node's IP address as a field in each audit event.
  91. The default value is `false`.
  92. // end::xpack-sa-lf-emit-node-host-address-tag[]
  93. [[xpack-sa-lf-emit-node-host-name]]
  94. // tag::xpack-sa-lf-emit-node-host-name-tag[]
  95. `xpack.security.audit.logfile.emit_node_host_name`::
  96. (<<dynamic-cluster-setting,Dynamic>>)
  97. Specifies whether to include the node's host name as a field in each audit event.
  98. The default value is `false`.
  99. // end::xpack-sa-lf-emit-node-host-name-tag[]
  100. [[xpack-sa-lf-emit-node-id]]
  101. // tag::xpack-sa-lf-emit-node-id-tag[]
  102. `xpack.security.audit.logfile.emit_node_id`::
  103. (<<dynamic-cluster-setting,Dynamic>>)
  104. Specifies whether to include the node id as a field in each audit event.
  105. Unlike <<node-name,node name>>, whose value might change if the administrator
  106. changes the setting in the config file, the node id will persist across cluster
  107. restarts and the administrator cannot change it.
  108. The default value is `true`.
  109. // end::xpack-sa-lf-emit-node-id-tag[]
  110. [[audit-event-ignore-policies]]
  111. ==== Audit Logfile Event Ignore Policies
  112. The following settings affect the <<audit-log-ignore-policy,ignore policies>>
  113. that enable fine-grained control over which audit events are printed to the log file.
  114. All of the settings with the same policy name combine to form a single policy.
  115. If an event matches all the conditions of any policy, it is ignored and not printed.
  116. Most audit events are subject to the ignore policies. The sole exception are
  117. events of the `security_config_change` type, which cannot be filtered out, unless
  118. <<xpack-sa-lf-events-exclude, excluded>> altogether.
  119. [[xpack-sa-lf-events-ignore-users]]
  120. // tag::xpack-sa-lf-events-ignore-users-tag[]
  121. `xpack.security.audit.logfile.events.ignore_filters.<policy_name>.users`::
  122. (<<dynamic-cluster-setting,Dynamic>>)
  123. A list of user names or wildcards. The specified policy will
  124. not print audit events for users matching these values.
  125. // end::xpack-sa-lf-events-ignore-users-tag[]
  126. [[xpack-sa-lf-events-ignore-realms]]
  127. // tag::xpack-sa-lf-events-ignore-realms-tag[]
  128. `xpack.security.audit.logfile.events.ignore_filters.<policy_name>.realms`::
  129. (<<dynamic-cluster-setting,Dynamic>>)
  130. A list of authentication realm names or wildcards. The specified policy will
  131. not print audit events for users in these realms.
  132. // end::xpack-sa-lf-events-ignore-realms-tag[]
  133. [[xpack-sa-lf-events-ignore-actions]]
  134. // tag::xpack-sa-lf-events-ignore-actions-tag[]
  135. `xpack.security.audit.logfile.events.ignore_filters.<policy_name>.actions`::
  136. (<<dynamic-cluster-setting,Dynamic>>)
  137. A list of action names or wildcards. Action name can be found in the `action`
  138. field of the audit event. The specified policy will not print audit events
  139. for actions matching these values.
  140. // end::xpack-sa-lf-events-ignore-actions-tag[]
  141. [[xpack-sa-lf-events-ignore-roles]]
  142. // tag::xpack-sa-lf-events-ignore-roles-tag[]
  143. `xpack.security.audit.logfile.events.ignore_filters.<policy_name>.roles`::
  144. (<<dynamic-cluster-setting,Dynamic>>)
  145. A list of role names or wildcards. The specified policy will
  146. not print audit events for users that have these roles. If the user has several
  147. roles, some of which are *not* covered by the policy, the policy will
  148. *not* cover this event.
  149. // end::xpack-sa-lf-events-ignore-roles-tag[]
  150. [[xpack-sa-lf-events-ignore-indices]]
  151. // tag::xpack-sa-lf-events-ignore-indices-tag[]
  152. `xpack.security.audit.logfile.events.ignore_filters.<policy_name>.indices`::
  153. (<<dynamic-cluster-setting,Dynamic>>)
  154. A list of index names or wildcards. The specified policy will
  155. not print audit events when all the indices in the event match
  156. these values. If the event concerns several indices, some of which are
  157. *not* covered by the policy, the policy will *not* cover this event.
  158. // end::xpack-sa-lf-events-ignore-indices-tag[]