Skip to content

Commit 8765a31

Browse files
Deprecate index audit output type (#37671)
This PR deprecates the index audit output. 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 9c7b3fc commit 8765a31

File tree

18 files changed

+151
-43
lines changed

18 files changed

+151
-43
lines changed

docs/reference/settings/audit-settings.asciidoc

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,14 @@ Set to `true` to enable auditing on the node. The default value is `false`.
1919
Specifies where audit logs are output. For example: `[ index, logfile ]`. The
2020
default value is `logfile`, which puts the auditing events in a dedicated
2121
file named `<clustername>_audit.log` on each node.
22+
+
2223
You can also specify `index`, which puts the auditing events in an {es} index
2324
that is prefixed with `.security_audit_log`. The index can reside on the same
24-
cluster or a separate cluster.
25+
cluster or a separate cluster. deprecated[6.7.0, The outputs setting will be
26+
removed in 7.0 as there will only be one supported output type (`logfile`).
27+
Users who wish to store their audit information in an Elasticsearch index
28+
should write to the log file output, and a use a file ingestion component to
29+
index it into Elasticsearch.]
2530
+
2631
For backwards compatibility reasons, if you use the logfile output type, a
2732
`<clustername>_access.log` file is also created. It contains the same
@@ -34,6 +39,8 @@ For more information, see <<configuring-logging-levels>>.
3439
TIP: If the index is unavailable, it is possible for auditing events to
3540
be lost. The `index` output type should therefore be used in conjunction with
3641
the `logfile` output type and the latter should be the official record of events.
42+
This unreliability is an important reason for why the `index` output type was
43+
deprecated in 6.7.0 and will be removed in 7.0.
3744

3845
--
3946

@@ -116,37 +123,39 @@ these values. If the event concerns several indices, some of which are
116123

117124
[[index-audit-settings]]
118125
==== Audit Log Indexing Configuration Settings
126+
deprecated[6.7.0, `xpack.security.audit.index` settings namespace refers to the
127+
`index` audit output type which is deprecated and will be removed in 7.0]
119128

120129
`xpack.security.audit.index.bulk_size`::
121130
Controls how many audit events are batched into a single write. The default
122-
value is `1000`.
131+
value is `1000`. deprecated[6.7.0]
123132

124133
`xpack.security.audit.index.flush_interval`::
125134
Controls how often buffered events are flushed to the index. The default value
126-
is `1s`.
135+
is `1s`. deprecated[6.7.0]
127136

128137
`xpack.security.audit.index.rollover`::
129138
Controls how often to roll over to a new index: `hourly`, `daily`, `weekly`, or
130-
`monthly`. The default value is `daily`.
139+
`monthly`. The default value is `daily`. deprecated[6.7.0]
131140

132141
`xpack.security.audit.index.events.include`::
133142
Specifies the audit events to be indexed. The default value is
134143
`anonymous_access_denied, authentication_failed, realm_authentication_failed, access_granted, access_denied, tampered_request, connection_granted, connection_denied, run_as_granted, run_as_denied`.
135144
See {xpack-ref}/audit-event-types.html[Audit Entry Types] for the
136-
complete list.
145+
complete list. deprecated[6.7.0]
137146

138147
`xpack.security.audit.index.events.exclude`::
139148
Excludes the specified auditing events from indexing. By default, no events are
140-
excluded.
149+
excluded. deprecated[6.7.0]
141150

142151
`xpack.security.audit.index.events.emit_request_body`::
143152
Specifies whether to include the request body from REST requests on certain
144-
event types such as `authentication_failed`. The default value is `false`.
153+
event types such as `authentication_failed`. The default value is `false`. deprecated[6.7.0]
145154

146155
`xpack.security.audit.index.settings`::
147156
Specifies settings for the indices that the events are stored in. For example,
148157
the following configuration sets the number of shards and replicas to 1 for the
149-
audit indices:
158+
audit indices: deprecated[6.7.0]
150159
+
151160
--
152161
[source,yaml]
@@ -169,37 +178,39 @@ even if they are unspecified (i.e. left to defaults).
169178

170179
[[remote-audit-settings]]
171180
==== Remote Audit Log Indexing Configuration Settings
181+
deprecated[6.7.0, `xpack.security.audit.index` settings namespace refers to the
182+
`index` audit output type which is deprecated and will be removed in 7.0]
172183

173184
To index audit events to a remote {es} cluster, you configure the following
174185
`xpack.security.audit.index.client` settings:
175186

176187
`xpack.security.audit.index.client.hosts`::
177188
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
189+
nodes in the remote cluster. If you are using default values for the
179190
<<common-network-settings,`transport.port`>> setting, you can omit the
180-
`port` value. Otherwise, it must match the `transport.port` setting.
191+
`port` value. Otherwise, it must match the `transport.port` setting. deprecated[6.7.0]
181192

182193
`xpack.security.audit.index.client.cluster.name`::
183-
Specifies the name of the remote cluster.
194+
Specifies the name of the remote cluster. deprecated[6.7.0]
184195

185196
`xpack.security.audit.index.client.xpack.security.user`::
186197
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.
198+
remote cluster. This user must have authority to create the `.security-audit`
199+
index on the remote cluster. deprecated[6.7.0]
189200

190-
If the remote {es} cluster has Transport Layer Security (TLS/SSL) enabled, you
201+
If the remote {es} cluster has Transport Layer Security (TLS/SSL) enabled, you
191202
must set the following setting to `true`:
192203

193204
`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`.
205+
Used to enable or disable TLS/SSL for the transport client that forwards audit
206+
logs to the remote cluster. The default is `false`. deprecated[6.7.0]
196207

197-
You must also specify the information necessary to access certificates. See
198-
<<auditing-tls-ssl-settings>>.
208+
You must also specify the information necessary to access certificates. See
209+
<<auditing-tls-ssl-settings>>.
199210

200211
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
212+
`xpack.security.audit.index.client` namespace. deprecated[6.7.0] For example,
213+
you can add <<modules-transport,transport settings>> and
203214
<<tcp-settings,advanced TCP settings>> in that namespace. To allow the remote
204215
client to discover all of the nodes in the remote cluster you can specify the
205216
`client.transport.sniff` setting:

docs/reference/settings/security-settings.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,7 @@ setting, this would be `transport.profiles.$PROFILE.xpack.security.ssl.key`.
14551455

14561456
include::ssl-settings.asciidoc[]
14571457

1458-
See also <<remote-audit-settings>>.
1458+
See also <<remote-audit-settings>>.
14591459

14601460
[float]
14611461
[[ip-filtering-settings]]

docs/reference/settings/ssl-settings.asciidoc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11

22
==== {component} TLS/SSL Settings
3+
ifeval::["{component}"=="Auditing"]
4+
deprecated[6.7.0, These settings configure the client used by the index audit
5+
output type which is deprecated and will be removed in 7.0. All the settings
6+
under the `xpack.security.audit.index` namespace are deprecated.]
7+
endif::[]
8+
39
You can configure the following TLS/SSL settings. If the settings are not configured,
410
the {ref}/security-settings.html#ssl-tls-settings[Default TLS/SSL Settings]
511
are used.
@@ -158,4 +164,4 @@ via the following settings:
158164
Set this to `PKCS11` to indicate that the PKCS#11 token should be used as a keystore.
159165

160166
+{ssl-prefix}.truststore.type+::
161-
Set this to `PKCS11` to indicate that the PKCS#11 token should be used as a truststore.
167+
Set this to `PKCS11` to indicate that the PKCS#11 token should be used as a truststore.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ xpack.security.audit.logfile.events.emit_request_body: true
2525
----------------------------
2626
--
2727

28-
* For the `index` output:
28+
* For the `index` output: deprecated[6.7.0]
2929
+
3030
--
3131
[source,yaml]

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[role="xpack"]
22
[[forwarding-audit-logfiles]]
33
=== Forwarding audit logs to a remote cluster
4+
deprecated[6.7.0, Forwarding audit logs is a feature of the index audit output
5+
type which is deprecated and will be removed in 7.0. All settings under the
6+
`xpack.security.audit.index` namespace are deprecated.]
47

58
When you are auditing security events, you can optionally store the logs in an
69
{es} index on a remote cluster. The logs are sent to the remote cluster by
@@ -96,4 +99,4 @@ bin/elasticsearch-keystore add xpack.security.audit.index.client.xpack.ssl.secur
9699
. Restart {es}.
97100

98101
When these steps are complete, your audit logs are stored in {es} rolling
99-
indices on the remote cluster.
102+
indices on the remote cluster.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
[role="xpack"]
22
[[audit-index]]
33
=== Index audit output
4+
deprecated[6.7.0, The index output type is deprecated and will be removed in 7.0.
5+
The sole output for the audit trail will be the <<audit-log-output, logfile>> type.]
46

57
In addition to logging to a file, you can store audit logs in Elasticsearch
68
rolling indices. These indices can be either on the same cluster, or on a

x-pack/docs/en/security/auditing/output-logfile.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ The log entries in the `<clustername>_audit.log` file have the following format:
5555
- A field's value, a request body as well, will be escaped as per the JSON RFC 4627.
5656

5757
There is a list of <<audit-event-types, audit event types>> specifying the
58-
set of fields for each sog entry type.
58+
set of fields for each entry type.
5959

6060
[float]
6161
[[deprecated-audit-log-entry-format]]

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,28 @@ Audit logs are **disabled** by default. To enable this functionality, you
1313
must set `xpack.security.audit.enabled` to `true` in `elasticsearch.yml`.
1414
============================================================================
1515

16-
The {es} {security-features} provide two ways to persist audit logs:
16+
The {es} {security-features} provide two ways to persist audit logs, but only
17+
the first one is recommended and the other is deprecated:
1718

1819
* The <<audit-log-output, `logfile`>> output, which persists events to
1920
a dedicated `<clustername>_audit.log` file on the host's file system.
2021
For backwards compatibility reasons, a file named `<clustername>_access.log`
2122
is also generated.
2223
* The <<audit-index, `index`>> output, which persists events to an Elasticsearch
2324
index. The audit index can reside on the same cluster, or a separate cluster.
25+
deprecated[6.7.0]
2426

2527
By default, only the `logfile` output is used when enabling auditing,
2628
implicitly outputting to both `<clustername>_audit.log` and `<clustername>_access.log`.
2729
To facilitate browsing and analyzing the events, you can also enable
28-
indexing by setting `xpack.security.audit.outputs` in `elasticsearch.yml`:
30+
indexing by setting `xpack.security.audit.outputs` in `elasticsearch.yml`: deprecated[6.7.0]
2931

3032
[source,yaml]
3133
----------------------------
3234
xpack.security.audit.outputs: [ index, logfile ]
3335
----------------------------
3436

3537
TIP: If you choose to enable the `index` output type, we strongly recommend that
36-
you still use the `logfile` output as the official record of events. If the
38+
you still use the `logfile` output as the official record of events. If the
3739
target index is unavailable (for example, during a rolling upgrade), the `index`
38-
output can lose messages.
40+
output can lose messages. This is one reason why this output type has been deprecated.

x-pack/docs/en/security/configuring-es.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ and <<auditing-settings>>.
133133

134134
By default, events are logged to a dedicated `elasticsearch-access.log` file in
135135
`ES_HOME/logs`. You can also store the events in an {es} index for
136-
easier analysis and control what events are logged.
136+
easier analysis and control what events are logged. deprecated[6.7.0]
137137
--
138138

139139
:edit_url: https://github.com/elastic/elasticsearch/edit/{branch}/docs/reference/security/securing-communications/securing-elasticsearch.asciidoc

x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ private DeprecationChecks() {
5050
NodeDeprecationChecks::gcsRepositoryChanges,
5151
NodeDeprecationChecks::fileDiscoveryPluginRemoved,
5252
NodeDeprecationChecks::defaultSSLSettingsRemoved,
53-
NodeDeprecationChecks::watcherNotificationsSecureSettingsCheck
53+
NodeDeprecationChecks::watcherNotificationsSecureSettingsCheck,
54+
NodeDeprecationChecks::auditIndexSettingsCheck
5455
));
5556

5657
static List<Function<IndexMetaData, DeprecationIssue>> INDEX_SETTINGS_CHECKS =

0 commit comments

Comments
 (0)