Auditing security settingsedit

You can use audit logging to record security-related events, such as authentication failures, refused connections, and data-access events.

If configured, auditing settings must be set on every node in the cluster. Static settings, such as xpack.security.audit.enabled, must be configured in elasticsearch.yml on each node. For dynamic auditing settings, use the cluster update settings API to ensure the setting is the same on all nodes.

General Auditing Settingsedit

xpack.security.audit.enabled

(Static) Set to true to enable auditing on the node. The default value is false. This puts the auditing events in a dedicated file named <clustername>_audit.json on each node.

If enabled, this setting must be configured in elasticsearch.yml on all nodes in the cluster.

Audited Event Settingsedit

The events and some other information about what gets logged can be controlled by using the following settings:

xpack.security.audit.logfile.events.include
(Dynamic) Specifies which events to include in the auditing output. The default value is: access_denied, access_granted, anonymous_access_denied, authentication_failed, connection_denied, tampered_request, run_as_denied, run_as_granted.
xpack.security.audit.logfile.events.exclude
(Dynamic) Excludes the specified events from the output. By default, no events are excluded.
xpack.security.audit.logfile.events.emit_request_body

(Dynamic) Specifies whether to include the request body from REST requests on certain event types such as authentication_failed. The default value is false.

No filtering is performed when auditing, so sensitive data may be audited in plain text when including the request body in audit events.

Local Node Info Settingsedit

xpack.security.audit.logfile.emit_node_name
(Dynamic) Specifies whether to include the node name as a field in each audit event. The default value is false.
xpack.security.audit.logfile.emit_node_host_address
(Dynamic) Specifies whether to include the node’s IP address as a field in each audit event. The default value is false.
xpack.security.audit.logfile.emit_node_host_name
(Dynamic) Specifies whether to include the node’s host name as a field in each audit event. The default value is false.
xpack.security.audit.logfile.emit_node_id
(Dynamic) Specifies whether to include the node id as a field in each audit event. This is available for the new format only. That is to say, this information does not exist in the <clustername>_access.log file. Unlike node name, whose value might change if the administrator changes the setting in the config file, the node id will persist across cluster restarts and the administrator cannot change it. The default value is true.

Audit Logfile Event Ignore Policiesedit

These settings affect the ignore policies that enable fine-grained control over which audit events are printed to the log file. All of the settings with the same policy name combine to form a single policy. If an event matches all of the conditions for a specific policy, it is ignored and not printed.

xpack.security.audit.logfile.events.ignore_filters.<policy_name>.users
(Dynamic) A list of user names or wildcards. The specified policy will not print audit events for users matching these values.
xpack.security.audit.logfile.events.ignore_filters.<policy_name>.realms
(Dynamic) A list of authentication realm names or wildcards. The specified policy will not print audit events for users in these realms.
xpack.security.audit.logfile.events.ignore_filters.<policy_name>.roles
(Dynamic) A list of role names or wildcards. The specified policy will not print audit events for users that have these roles. If the user has several roles, some of which are not covered by the policy, the policy will not cover this event.
xpack.security.audit.logfile.events.ignore_filters.<policy_name>.indices
(Dynamic) A list of index names or wildcards. The specified policy will not print audit events when all the indices in the event match these values. If the event concerns several indices, some of which are not covered by the policy, the policy will not cover this event.