Skip to content

Commit e05d83f

Browse files
DOC Audit security config change (#66839)
Audit log doc changes about: * the new security_config_change event type (main scope of this PR) * remove mentions of the 6.5 audit format changes (the JSON format) * mention the new archiving and rotation by size (in v8 only) * mention the request.id event attribute used to correlate audit events * mention that audit is only available on certain subscription levels * add an exhaustive audit event example list (because schema became too complex to explain in words 😢 given the new security_config_change events) * move the ignore policies are explained on a separate page (it was collocated with the logfile output since we had multiple outputs and the policies were specific the the logfile only). Co-authored-by: Lisa Cawley lcawley@elastic.co Relates #62916 Closes #29912
1 parent 886e154 commit e05d83f

File tree

7 files changed

+396
-567
lines changed

7 files changed

+396
-567
lines changed

docs/reference/settings/audit-settings.asciidoc

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@
88
[[auditing-settings-description]]
99
You can use <<enable-audit-logging,audit logging>> to record security-related
1010
events, such as authentication failures, refused connections, and data-access
11-
events.
11+
events. In addition, changes via the APIs to the security configuration, such
12+
as creating, updating and removing <<native-realm, native>> and
13+
<<built-in-users, built-in>> users, <<security-api-put-role, roles>>,
14+
<<security-api-put-role-mapping, role mappings>> and
15+
<<security-api-create-api-key, API keys>> are also recorded.
16+
--
17+
TIP: Audit logs are only available on certain subscription levels.
18+
For more information, see {subscriptions}.
19+
--
1220

1321
If configured, auditing settings must be set on every node in the cluster.
1422
Static settings, such as `xpack.security.audit.enabled`, must be configured in
@@ -40,29 +48,38 @@ by using the following settings:
4048
// tag::xpack-sa-lf-events-include-tag[]
4149
`xpack.security.audit.logfile.events.include`::
4250
(<<dynamic-cluster-setting,Dynamic>>)
43-
Specifies which events to include in the auditing output. The default value is:
51+
Specifies the <<audit-event-types, kind of events>> to print in the auditing output.
52+
In addition, `_all` can be used to exhaustively audit all the events, but this is usually
53+
discouraged since it will get very verbose.
54+
The default list value contains:
4455
`access_denied, access_granted, anonymous_access_denied, authentication_failed,
45-
connection_denied, tampered_request, run_as_denied, run_as_granted`.
56+
connection_denied, tampered_request, run_as_denied, run_as_granted,
57+
security_config_change`.
4658
// end::xpack-sa-lf-events-include-tag[]
4759

4860
[[xpack-sa-lf-events-exclude]]
4961
// tag::xpack-sa-lf-events-exclude-tag[]
5062
`xpack.security.audit.logfile.events.exclude`::
5163
(<<dynamic-cluster-setting,Dynamic>>)
52-
Excludes the specified events from the output. By default, no events are
53-
excluded.
64+
Excludes the specified <<audit-event-types, kind of events>> from the include list.
65+
This is useful in the case where the `events.include` setting contains the special value `_all`.
66+
The default is the empty list.
5467
// end::xpack-sa-lf-events-exclude-tag[]
5568

5669
[[xpack-sa-lf-events-emit-request]]
5770
// tag::xpack-sa-lf-events-emit-request-tag[]
5871
`xpack.security.audit.logfile.events.emit_request_body`::
5972
(<<dynamic-cluster-setting,Dynamic>>)
60-
Specifies whether to include the request body from REST requests on certain
61-
event types such as `authentication_failed`. The default value is `false`.
73+
Specifies whether to include the full request body from REST requests as an
74+
attribute of certain kinds of audit events. This setting can be used to
75+
<<auditing-search-queries, audit search queries>>.
76+
+
77+
The default value is `false`, so request bodies are not printed.
6278
+
6379
--
64-
IMPORTANT: No filtering is performed when auditing, so sensitive data may be
65-
audited in plain text when including the request body in audit events.
80+
IMPORTANT: Be advised that sensitive data may be audited in plain text when including
81+
the request body in audit events, even though all the security APIs, such as those that
82+
change the user's password, have the credentials filtered out when audited.
6683
--
6784

6885
// end::xpack-sa-lf-events-emit-request-tag[]
@@ -99,8 +116,6 @@ The default value is `false`.
99116
`xpack.security.audit.logfile.emit_node_id`::
100117
(<<dynamic-cluster-setting,Dynamic>>)
101118
Specifies whether to include the node id as a field in each audit event.
102-
This is available for the new format only. That is to say, this information
103-
does not exist in the `<clustername>_access.log` file.
104119
Unlike <<node-name,node name>>, whose value might change if the administrator
105120
changes the setting in the config file, the node id will persist across cluster
106121
restarts and the administrator cannot change it.
@@ -110,11 +125,13 @@ The default value is `true`.
110125
[[audit-event-ignore-policies]]
111126
==== Audit Logfile Event Ignore Policies
112127

113-
These settings affect the <<audit-log-ignore-policy,ignore policies>>
128+
The following settings affect the <<audit-log-ignore-policy,ignore policies>>
114129
that enable fine-grained control over which audit events are printed to the log file.
115130
All of the settings with the same policy name combine to form a single policy.
116-
If an event matches all of the conditions for a specific policy, it is ignored
117-
and not printed.
131+
If an event matches all the conditions of any policy, it is ignored and not printed.
132+
Most audit events are subject to the ignore policies. The sole exception are
133+
events of the `security_config_change` type, which cannot be filtered out, unless
134+
<<xpack-sa-lf-events-exclude, excluded>> altogether.
118135

119136
[[xpack-sa-lf-events-ignore-users]]
120137
// tag::xpack-sa-lf-events-ignore-users-tag[]

x-pack/docs/en/security/auditing/auditing-search-queries.asciidoc

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
=== Auditing search queries
55

66
There is no <<audit-event-types, audit event type>> specifically
7-
dedicated to search queries. Search queries are analyzed and then processed; the
7+
dedicated to search queries. Search queries are analyzed and then processed; the
88
processing triggers authorization actions that are audited.
99
However, the original raw query, as submitted by the client, is not accessible
1010
downstream when authorization auditing occurs.
1111

1212
Search queries are contained inside HTTP request bodies, however, and some
13-
audit events that are generated by the REST layer can be toggled to output
14-
the request body to the audit log.
13+
audit events that are generated by the REST layer, on the coordinating node,
14+
can be toggled to output the request body to the audit log. Therefore, one
15+
must audit request bodies in order to audit search queries.
1516

1617
To make certain audit events include the request body, edit the following
1718
setting in the `elasticsearch.yml` file:
@@ -26,9 +27,15 @@ audited in plain text when audit events include the request body. Also, the
2627
request body can contain malicious content that can break a parser consuming
2728
the audit logs.
2829

29-
There are only a handful of <<audit-event-types, audit event types>> that are
30-
generated in the REST layer and can access the request body. Most of them are not
31-
included by default.
30+
The request body is printed as an escaped JSON string value (RFC 4627) to the `request.body`
31+
event attribute.
32+
33+
Not all events contain the `request.body` attribute, even when the above setting
34+
is toggled. The ones that do are: `authentication_success`,
35+
`authentication_failed`, `realm_authentication_failed`, `tampered_request`, `run_as_denied`,
36+
and `anonymous_access_denied`. The `request.body` attribute is printed on the coordinating node only
37+
(the node that handles the REST request). Most of these event types are
38+
<<xpack-sa-lf-events-include, not included by default>>.
3239

3340
A good practical piece of advice is to add `authentication_success` to the event
3441
types that are audited (add it to the list in the `xpack.security.audit.logfile.events.include`),

x-pack/docs/en/security/auditing/enable-audit-logging.asciidoc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,28 @@
33
== Enabling audit logging
44

55
You can log security-related events such as authentication failures and refused connections
6-
to monitor your cluster for suspicious activity.
6+
to monitor your cluster for suspicious activity (including data access authorization and user
7+
security configuration changes).
8+
79
Audit logging also provides forensic evidence in the event of an attack.
810

911
[IMPORTANT]
1012
============================================================================
1113
Audit logs are **disabled** by default. You must explicitly enable audit logging.
1214
============================================================================
15+
--
16+
TIP: Audit logs are only available on certain subscription levels.
17+
For more information, see {subscriptions}.
18+
--
1319

1420
To enable enable audit logging:
1521

1622
. Set `xpack.security.audit.enabled` to `true` in `elasticsearch.yml`.
1723
. Restart {es}.
1824

1925
When audit logging is enabled, <<audit-event-types, security events>> are persisted to
20-
a dedicated `<clustername>_audit.json` file on the host's file system (on each node).
26+
a dedicated `<clustername>_audit.json` file on the host's file system, on every cluster node.
27+
For more information, see <<audit-log-output>>.
2128

2229
You can configure additional options to control what events are logged and
2330
what information is included in the audit log.

0 commit comments

Comments
 (0)