Skip to content

Commit b6936e3

Browse files
Remove index audit output type (#37707)
This commit removes the Index Audit Output type, following its deprecation in 6.7 by 8765a31. It also adds the migration notice (settings notice). In general, the problem with the index audit output is that event indexing can be slower than the rate with which audit events are generated, especially during the daily rollovers or the rolling cluster upgrades. In this situation audit events will be lost which is a terrible failure situation for an audit system. Besides of the settings under the `xpack.security.audit.index` namespace, the `xpack.security.audit.outputs` setting has also been deprecated and will be removed in 7. Although explicitly configuring the logfile output does not touch any deprecation bits, this setting is made redundant in 7 so this PR deprecates it as well. Relates #29881
1 parent f12bfb4 commit b6936e3

File tree

26 files changed

+51
-3874
lines changed

26 files changed

+51
-3874
lines changed

docs/reference/migration/migrate_7_0/settings.asciidoc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,18 @@ node's keystore, i.e., they are not to be specified via the cluster settings API
154154
`xpack.notification.pagerduty.account.<id>.secure_service_api_key`
155155
- `xpack.notification.slack.account.<id>.url`, instead use
156156
`xpack.notification.slack.account.<id>.secure_url`
157+
158+
[float]
159+
[[remove-audit-index-output]]
160+
==== Audit index output type removed
161+
162+
All the settings under the `xpack.security.audit.index` namespace have been
163+
removed. In addition, the `xpack.security.audit.outputs` setting has been
164+
removed as well.
165+
166+
These settings enabled and configured the audit index output type. This output
167+
type has been removed because it was unreliable in certain scenarios and this
168+
could have lead to dropping audit events while the operations on the system
169+
were allowed to continue as usual. The recommended replacement is the
170+
use of the `logfile` audit output type and using other components from the
171+
Elastic Stack to handle the indexing part.

docs/reference/settings/audit-settings.asciidoc

Lines changed: 6 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,19 @@ file. For more information, see
1414

1515
`xpack.security.audit.enabled`::
1616
Set to `true` to enable auditing on the node. The default value is `false`.
17-
18-
`xpack.security.audit.outputs`::
19-
Specifies where audit logs are output. For example: `[ index, logfile ]`. The
20-
default value is `logfile`, which puts the auditing events in a dedicated
21-
file named `<clustername>_audit.log` on each node.
22-
You can also specify `index`, which puts the auditing events in an {es} index
23-
that is prefixed with `.security_audit_log`. The index can reside on the same
24-
cluster or a separate cluster.
25-
+
26-
For backwards compatibility reasons, if you use the logfile output type, a
27-
`<clustername>_access.log` file is also created. It contains the same
28-
information, but it uses the older (pre-6.5.0) formatting style.
29-
If the backwards compatible format is not required, it should be disabled.
30-
To do that, change its logger level to `off` in the `log4j2.properties` file.
31-
For more information, see <<configuring-logging-levels>>.
32-
+
33-
--
34-
TIP: If the index is unavailable, it is possible for auditing events to
35-
be lost. The `index` output type should therefore be used in conjunction with
36-
the `logfile` output type and the latter should be the official record of events.
37-
38-
--
17+
This puts the auditing events in a dedicated file named `<clustername>_audit.log`
18+
on each node. For more information, see <<configuring-logging-levels>>.
3919

4020
[[event-audit-settings]]
4121
==== Audited Event Settings
4222

43-
The events and some other information about what gets logged can be
44-
controlled by using the following settings:
23+
The events and some other information about what gets logged can be controlled
24+
by using the following settings:
4525

4626
`xpack.security.audit.logfile.events.include`::
4727
Specifies which events to include in the auditing output. The default value is:
48-
`access_denied, access_granted, anonymous_access_denied, authentication_failed, connection_denied, tampered_request, run_as_denied, run_as_granted`.
28+
`access_denied, access_granted, anonymous_access_denied, authentication_failed,
29+
connection_denied, tampered_request, run_as_denied, run_as_granted`.
4930

5031
`xpack.security.audit.logfile.events.exclude`::
5132
Excludes the specified events from the output. By default, no events are
@@ -113,98 +94,3 @@ A list of index names or wildcards. The specified policy will
11394
not print audit events when all the indices in the event match
11495
these values. If the event concerns several indices, some of which are
11596
*not* covered by the policy, the policy will *not* cover this event.
116-
117-
[[index-audit-settings]]
118-
==== Audit Log Indexing Configuration Settings
119-
120-
`xpack.security.audit.index.bulk_size`::
121-
Controls how many audit events are batched into a single write. The default
122-
value is `1000`.
123-
124-
`xpack.security.audit.index.flush_interval`::
125-
Controls how often buffered events are flushed to the index. The default value
126-
is `1s`.
127-
128-
`xpack.security.audit.index.rollover`::
129-
Controls how often to roll over to a new index: `hourly`, `daily`, `weekly`, or
130-
`monthly`. The default value is `daily`.
131-
132-
`xpack.security.audit.index.events.include`::
133-
Specifies the audit events to be indexed. The default value is
134-
`anonymous_access_denied, authentication_failed, realm_authentication_failed, access_granted, access_denied, tampered_request, connection_granted, connection_denied, run_as_granted, run_as_denied`.
135-
See {xpack-ref}/audit-event-types.html[Audit Entry Types] for the
136-
complete list.
137-
138-
`xpack.security.audit.index.events.exclude`::
139-
Excludes the specified auditing events from indexing. By default, no events are
140-
excluded.
141-
142-
`xpack.security.audit.index.events.emit_request_body`::
143-
Specifies whether to include the request body from REST requests on certain
144-
event types such as `authentication_failed`. The default value is `false`.
145-
146-
`xpack.security.audit.index.settings`::
147-
Specifies settings for the indices that the events are stored in. For example,
148-
the following configuration sets the number of shards and replicas to 1 for the
149-
audit indices:
150-
+
151-
--
152-
[source,yaml]
153-
----------------------------
154-
xpack.security.audit.index.settings:
155-
index:
156-
number_of_shards: 1
157-
number_of_replicas: 1
158-
----------------------------
159-
--
160-
+
161-
--
162-
NOTE: These settings apply to the local audit indices, as well as to the
163-
<<remote-audit-settings, remote audit indices>>, but only if the remote cluster
164-
does *not* have {security-features} enabled or the {es} versions are different.
165-
If the remote cluster has {security-features} enabled and the versions coincide,
166-
the settings for the audit indices there will take precedence,
167-
even if they are unspecified (i.e. left to defaults).
168-
--
169-
170-
[[remote-audit-settings]]
171-
==== Remote Audit Log Indexing Configuration Settings
172-
173-
To index audit events to a remote {es} cluster, you configure the following
174-
`xpack.security.audit.index.client` settings:
175-
176-
`xpack.security.audit.index.client.hosts`::
177-
Specifies a comma-separated list of `host:port` pairs. These hosts should be
178-
nodes in the remote cluster. If you are using default values for the
179-
<<common-network-settings,`transport.port`>> setting, you can omit the
180-
`port` value. Otherwise, it must match the `transport.port` setting.
181-
182-
`xpack.security.audit.index.client.cluster.name`::
183-
Specifies the name of the remote cluster.
184-
185-
`xpack.security.audit.index.client.xpack.security.user`::
186-
Specifies the `username:password` pair that is used to authenticate with the
187-
remote cluster. This user must have authority to create the `.security-audit`
188-
index on the remote cluster.
189-
190-
If the remote {es} cluster has Transport Layer Security (TLS/SSL) enabled, you
191-
must set the following setting to `true`:
192-
193-
`xpack.security.audit.index.client.xpack.security.transport.ssl.enabled`::
194-
Used to enable or disable TLS/SSL for the transport client that forwards audit
195-
logs to the remote cluster. The default is `false`.
196-
197-
You must also specify the information necessary to access certificates. See
198-
<<auditing-tls-ssl-settings>>.
199-
200-
You can pass additional settings to the remote client by specifying them in the
201-
`xpack.security.audit.index.client` namespace. For example, you can add
202-
<<modules-transport,transport settings>> and
203-
<<tcp-settings,advanced TCP settings>> in that namespace. To allow the remote
204-
client to discover all of the nodes in the remote cluster you can specify the
205-
`client.transport.sniff` setting:
206-
207-
[source,yaml]
208-
----------------------------
209-
xpack.security.audit.index.client.transport.sniff: true
210-
----------------------------

docs/reference/settings/security-settings.asciidoc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,16 +1303,6 @@ transport profile, use the prefix `transport.profiles.$PROFILE.xpack.security.`
13031303
append the portion of the setting after `xpack.security.transport.`. For the key
13041304
setting, this would be `transport.profiles.$PROFILE.xpack.security.ssl.key`.
13051305

1306-
[[auditing-tls-ssl-settings]]
1307-
:ssl-prefix: xpack.security.audit.index.client.xpack.security.transport
1308-
:component: Auditing
1309-
:client-auth-default!:
1310-
:server!:
1311-
1312-
include::ssl-settings.asciidoc[]
1313-
1314-
See also <<remote-audit-settings>>.
1315-
13161306
[float]
13171307
[[ip-filtering-settings]]
13181308
==== IP filtering settings

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

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,13 @@ Search queries are contained inside HTTP request bodies, however, and some
1313
audit events that are generated by the REST layer can be toggled to output
1414
the request body to the audit log.
1515

16-
To make certain audit events include the request body, edit the following
17-
settings in the `elasticsearch.yml` file:
16+
To make certain audit events include the request body, edit the following
17+
setting in the `elasticsearch.yml` file:
1818

19-
* For the `logfile` audit output:
20-
+
21-
--
2219
[source,yaml]
2320
----------------------------
2421
xpack.security.audit.logfile.events.emit_request_body: true
2522
----------------------------
26-
--
27-
28-
* For the `index` output:
29-
+
30-
--
31-
[source,yaml]
32-
----------------------------
33-
xpack.security.audit.index.events.emit_request_body: true
34-
----------------------------
35-
--
3623

3724
IMPORTANT: No filtering is performed when auditing, so sensitive data might be
3825
audited in plain text when audit events include the request body. Also, the
@@ -44,10 +31,8 @@ generated in the REST layer and can access the request body. Most of them are no
4431
included by default.
4532

4633
A good practical piece of advice is to add `authentication_success` to the event
47-
types that are audited. Add it to the list in the
48-
`xpack.security.audit.logfile.events.include` or
49-
`xpack.security.audit.index.events.include` settings. This type is not audited
50-
by default.
34+
types that are audited (add it to the list in the `xpack.security.audit.logfile.events.include`),
35+
as this event type is not audited by default.
5136

5237
NOTE: Typically, the include list contains other event types as well, such as
5338
`access_granted` or `access_denied`.

x-pack/docs/en/security/auditing/event-types.asciidoc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,7 @@ that have been previously described:
210210
=== Audit event attributes for the deprecated formats
211211

212212
The following table shows the common attributes that can be associated with
213-
every event, when it is output to the `<clustername>_access.log` file or to the
214-
<<audit-index, index>>.
213+
every event, when it is output to the `<clustername>_access.log` file.
215214

216215
.Common attributes
217216
[cols="2,7",options="header"]
@@ -229,10 +228,8 @@ every event, when it is output to the `<clustername>_access.log` file or to the
229228
`run_as_denied`, `run_as_granted`.
230229
|======
231230

232-
For an event in the <<audit-log-output,audit log file output>>, these are
233-
positional attributes, which are printed at the beginning of each log line and
234-
are not adjoined by the attribute name. As a matter of course, the names are
235-
present for each attribute when the event is forwarded to the <<audit-index, index audit output>>.
231+
These are positional attributes, which are printed at the beginning of each log line and
232+
are not adjoined by the attribute name.
236233

237234
The attribute `origin_address` is also common to every audit event. It is always
238235
named, that is, it is not positional. It denotes the source IP address of the

x-pack/docs/en/security/auditing/forwarding-logs.asciidoc

Lines changed: 0 additions & 99 deletions
This file was deleted.

x-pack/docs/en/security/auditing/index.asciidoc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,5 @@ include::event-types.asciidoc[]
88
:edit_url: https://github.com/elastic/elasticsearch/edit/{branch}/x-pack/docs/en/security/auditing/output-logfile.asciidoc
99
include::output-logfile.asciidoc[]
1010

11-
:edit_url: https://github.com/elastic/elasticsearch/edit/{branch}/x-pack/docs/en/security/auditing/output-index.asciidoc
12-
include::output-index.asciidoc[]
13-
1411
:edit_url: https://github.com/elastic/elasticsearch/edit/{branch}/x-pack/docs/en/security/auditing/auditing-search-queries.asciidoc
1512
include::auditing-search-queries.asciidoc[]
16-
17-
:edit_url: https://github.com/elastic/elasticsearch/edit/{branch}/x-pack/docs/en/security/auditing/forwarding-logs.asciidoc
18-
include::forwarding-logs.asciidoc[]

0 commit comments

Comments
 (0)