audit-settings.asciidoc 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. [role="xpack"]
  2. [[auditing-settings]]
  3. === Auditing Security Settings
  4. ++++
  5. <titleabbrev>Auditing Settings</titleabbrev>
  6. ++++
  7. All of these settings can be added to the `elasticsearch.yml` configuration
  8. file. For more information, see
  9. {xpack-ref}/auditing.html[Auditing Security Events].
  10. [[general-audit-settings]]
  11. ==== General Auditing Settings
  12. `xpack.security.audit.enabled`::
  13. Set to `true` to enable auditing on the node. The default value is `false`.
  14. `xpack.security.audit.outputs`::
  15. Specifies where audit logs are output. For example: `[ index, logfile ]`. The
  16. default value is `logfile`, which puts the auditing events in a dedicated
  17. `<clustername>_access.log` file on the node. You can also specify `index`, which
  18. puts the auditing events in an {es} index that is prefixed with
  19. `.security_audit_log`. The index can reside on the same cluster or a separate
  20. cluster.
  21. +
  22. --
  23. TIP: If the index is unavailable, it is possible for auditing events to
  24. be lost. The `index` output type should therefore be used in conjunction with
  25. the `logfile` output type and the latter should be the official record of events.
  26. --
  27. [[event-audit-settings]]
  28. ==== Audited Event Settings
  29. The events and some other information about what gets logged can be
  30. controlled by using the following settings:
  31. `xpack.security.audit.logfile.events.include`::
  32. Specifies which events to include in the auditing output. The default value is:
  33. `access_denied, access_granted, anonymous_access_denied, authentication_failed, connection_denied, tampered_request, run_as_denied, run_as_granted`.
  34. `xpack.security.audit.logfile.events.exclude`::
  35. Excludes the specified events from the output. By default, no events are
  36. excluded.
  37. `xpack.security.audit.logfile.events.emit_request_body`::
  38. Specifies whether to include the request body from REST requests on certain
  39. event types such as `authentication_failed`. The default value is `false`.
  40. +
  41. --
  42. IMPORTANT: No filtering is performed when auditing, so sensitive data may be
  43. audited in plain text when including the request body in audit events.
  44. --
  45. [[node-audit-settings]]
  46. ==== Local Node Info Settings
  47. `xpack.security.audit.logfile.prefix.emit_node_name`::
  48. Specifies whether to include the node's name in the local node info. The
  49. default value is `true`.
  50. `xpack.security.audit.logfile.prefix.emit_node_host_address`::
  51. Specifies whether to include the node's IP address in the local node info. The
  52. default value is `false`.
  53. `xpack.security.audit.logfile.prefix.emit_node_host_name`::
  54. Specifies whether to include the node's host name in the local node info. The
  55. default value is `false`.
  56. [[index-audit-settings]]
  57. ==== Audit Log Indexing Configuration Settings
  58. `xpack.security.audit.index.bulk_size`::
  59. Controls how many audit events are batched into a single write. The default
  60. value is `1000`.
  61. `xpack.security.audit.index.flush_interval`::
  62. Controls how often buffered events are flushed to the index. The default value
  63. is `1s`.
  64. `xpack.security.audit.index.rollover`::
  65. Controls how often to roll over to a new index: `hourly`, `daily`, `weekly`, or
  66. `monthly`. The default value is `daily`.
  67. `xpack.security.audit.index.events.include`::
  68. Specifies the audit events to be indexed. The default value is
  69. `anonymous_access_denied, authentication_failed, realm_authentication_failed, access_granted, access_denied, tampered_request, connection_granted, connection_denied, run_as_granted, run_as_denied`.
  70. See {xpack-ref}/audit-event-types.html[Audit Entry Types] for the
  71. complete list.
  72. `xpack.security.audit.index.events.exclude`::
  73. Excludes the specified auditing events from indexing. By default, no events are
  74. excluded.
  75. `xpack.security.audit.index.events.emit_request_body`::
  76. Specifies whether to include the request body from REST requests on certain
  77. event types such as `authentication_failed`. The default value is `false`.
  78. `xpack.security.audit.index.settings`::
  79. Specifies settings for the indices that the events are stored in. For example,
  80. the following configuration sets the number of shards and replicas to 1 for the
  81. audit indices:
  82. +
  83. --
  84. [source,yaml]
  85. ----------------------------
  86. xpack.security.audit.index.settings:
  87. index:
  88. number_of_shards: 1
  89. number_of_replicas: 1
  90. ----------------------------
  91. --
  92. +
  93. --
  94. NOTE: These settings apply to the local audit indices, as well as to the
  95. <<remote-audit-settings, remote audit indices>>, but only if the remote cluster
  96. does *not* have {security} installed, or the {es} versions are different.
  97. If the remote cluster has {security} installed, and the versions coincide, the
  98. settings for the audit indices there will take precedence,
  99. even if they are unspecified (i.e. left to defaults).
  100. --
  101. [[remote-audit-settings]]
  102. ==== Remote Audit Log Indexing Configuration Settings
  103. To index audit events to a remote {es} cluster, you configure the following
  104. `xpack.security.audit.index.client` settings:
  105. `xpack.security.audit.index.client.hosts`::
  106. Specifies a comma-separated list of `host:port` pairs. These hosts should be
  107. nodes in the remote cluster. If you are using default values for the
  108. <<common-network-settings,`transport.tcp.port`>> setting, you can omit the
  109. `port` value. Otherwise, it must match the `transport.tcp.port` setting.
  110. `xpack.security.audit.index.client.cluster.name`::
  111. Specifies the name of the remote cluster.
  112. `xpack.security.audit.index.client.xpack.security.user`::
  113. Specifies the `username:password` pair that is used to authenticate with the
  114. remote cluster. This user must have authority to create the `.security-audit`
  115. index on the remote cluster.
  116. If the remote {es} cluster has Transport Layer Security (TLS/SSL) enabled, you
  117. must set the following setting to `true`:
  118. `xpack.security.audit.index.client.xpack.security.transport.ssl.enabled`::
  119. Used to enable or disable TLS/SSL for the transport client that forwards audit
  120. logs to the remote cluster. The default is `false`.
  121. You must also specify the information necessary to access certificates. See
  122. <<auditing-tls-ssl-settings>>.
  123. You can pass additional settings to the remote client by specifying them in the
  124. `xpack.security.audit.index.client` namespace. For example, you can add
  125. <<modules-transport,transport settings>> and
  126. <<tcp-settings,advanced TCP settings>> in that namespace. To allow the remote
  127. client to discover all of the nodes in the remote cluster you can specify the
  128. `client.transport.sniff` setting:
  129. [source,yaml]
  130. ----------------------------
  131. xpack.security.audit.index.client.transport.sniff: true
  132. ----------------------------