Skip to content

Commit df94d2c

Browse files
Apply suggestions from code review
29 suggestions from Shaina Co-authored-by: shainaraskas <[email protected]>
1 parent 6e4bb9a commit df94d2c

File tree

7 files changed

+45
-43
lines changed

7 files changed

+45
-43
lines changed

deploy-manage/monitor/logging-configuration/auditing-search-queries.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,21 @@ xpack.security.audit.logfile.events.emit_request_body: true
2323
You can apply this setting through [cluster update settings API](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html), as described in [](./configuring-audit-logs.md). Alternatively, you can modify `elasticsearch.yml` in all nodes and restart for the changes to take effect.
2424

2525
::::{important}
26-
No filtering is performed when auditing, so **sensitive data might be audited in plain text when audit events include the request body**. Also, the request body can contain malicious content that can break a parser consuming the audit logs.
26+
No filtering is performed when auditing, so sensitive data might be audited in plain text when audit events include the request body. Also, the request body can contain malicious content that can break a parser consuming the audit logs.
2727
::::
2828

2929
The request body is printed as an escaped JSON string value (RFC 4627) to the `request.body` event attribute.
3030

31-
Not all events contain the `request.body` attribute, even when the above setting is toggled. The ones that do are: `authentication_success`, `authentication_failed`, `realm_authentication_failed`, `tampered_request`, `run_as_denied`, and `anonymous_access_denied`. The `request.body` attribute is printed on the coordinating node only (the node that handles the REST request). Most of these event types are [not included by default](https://www.elastic.co/guide/en/elasticsearch/reference/current/auditing-settings.html#xpack-sa-lf-events-include).
31+
Not all events contain the `request.body` attribute, even when the above setting is toggled. The ones that do are:
32+
33+
* `authentication_success`
34+
* `authentication_failed`
35+
* `realm_authentication_failed`
36+
* `tampered_request`
37+
* `run_as_denied`
38+
* `anonymous_access_denied`
39+
40+
The `request.body` attribute is printed on the coordinating node only (the node that handles the REST request). Most of these event types are [not included by default](https://www.elastic.co/guide/en/elasticsearch/reference/current/auditing-settings.html#xpack-sa-lf-events-include).
3241

3342
A good practical piece of advice is to add `authentication_success` to the event types that are audited (add it to the list in the `xpack.security.audit.logfile.events.include`), as this event type is not audited by default.
3443

deploy-manage/monitor/logging-configuration/configuring-audit-logs.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,22 @@ When auditing security events, a single client request might generate multiple a
2020
* [{{es}} ignore policies settings](https://www.elastic.co/guide/en/elasticsearch/reference/current/auditing-settings.html#audit-event-ignore-policies): Use ignore policies for fine-grained control over which audit events are printed to the log file.
2121

2222
::::{tip}
23-
In {{es}}, all auditing settings except `xpack.security.audit.enabled` are **dynamic**. This means you can configure them using the [cluster update settings API](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html), allowing changes to take effect immediately without requiring a restart. This approach is faster and more convenient than modifying `elasticsearch.yml`.
23+
In {{es}}, all auditing settings except `xpack.security.audit.enabled` are dynamic. This means you can configure them using the [cluster update settings API](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html), allowing changes to take effect immediately without requiring a restart. This approach is faster and more convenient than modifying `elasticsearch.yml`.
2424
::::
2525

26-
Note that {{ech}} deployments provide its own subset of supported settings for auditing configuration:
27-
* [Elasticsearch audit settings for Elastic Cloud Hosted deployments](https://www.elastic.co/guide/en/cloud/current/ec-add-user-settings.html#ec_audit_settings)
2826

29-
For a complete description of event details and format, refer to:
30-
* [{{es}} audit events details and schema](/deploy-manage/monitor/logging-configuration/elasticsearch-audit-events.md).
31-
* [{{es}} logentry output format](/deploy-manage/monitor/logging-configuration/logfile-audit-output.md#audit-log-entry-format)
27+
For a complete description of event details and format, refer to the following resources:
28+
* [{{es}} audit events details and schema](/deploy-manage/monitor/logging-configuration/elasticsearch-audit-events.md)
29+
* [{{es}} log entry output format](/deploy-manage/monitor/logging-configuration/logfile-audit-output.md#audit-log-entry-format)
3230

3331
### Kibana auditing configuration
3432

35-
{{kib}} configuration options include:
36-
37-
* [{{kib}} ignore filters](https://www.elastic.co/guide/en/kibana/current/security-settings-kb.html#audit-logging-ignore-filters): List of filters that determine which events should be excluded from the audit log.
33+
To control the logs that are outputted by Kibana, you can use [{{kib}} ignore filters](https://www.elastic.co/guide/en/kibana/current/security-settings-kb.html#audit-logging-ignore-filters). These are a list of filters that determine which events should be excluded from the audit log.
3834

3935
::::{tip}
4036
To configure {{kib}} settings, follow the same [procedure](./enabling-audit-logs.md#enable-audit-logging-procedure) as when enabling {{kib}} audit logs, but apply the relevant settings instead.
4137
::::
4238

43-
Note that {{ech}} deployments provide its own subset of supported settings for auditing configuration:
44-
* [Kibana audit settings on Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-manage-kibana-settings.html#ec_logging_and_audit_settings)
4539

4640
For a complete description of auditing event details, such as `category`, `type`, or `action`, refer to:
4741
* [{{kib}} audit events](https://www.elastic.co/guide/en/kibana/current/xpack-security-audit-logging.html#xpack-security-ecs-audit-logging)
@@ -55,7 +49,7 @@ For a complete description of auditing event details, such as `category`, `type`
5549
* Refer to [auditing search queries](./auditing-search-queries.md) for details on logging request bodies in the {{es}} audit logs.
5650

5751
::::{important}
58-
Be advised that **sensitive data may be audited in plain text** when including the request body in audit events, even though all the security APIs, such as those that change the user’s password, have the credentials filtered out when audited.
52+
Sensitive data may be audited in plain text when including the request body in audit events, even though all the security APIs, such as those that change the user’s password, have the credentials filtered out when audited.
5953
::::
6054

6155
* Use {{kib}} [ignore filters](https://www.elastic.co/guide/en/kibana/current/security-settings-kb.html#audit-logging-ignore-filters) if you want to filter out certain events from the {{kib}} audit log.

deploy-manage/monitor/logging-configuration/enabling-audit-logs.md

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,18 @@ You can log security-related events such as authentication failures and refused
2424
Use the {{kib}} audit logs in conjunction with {{es}} audit logging to get a holistic view of all security related events. {{kib}} defers to the {{es}} security model for authentication, data index authorization, and features that are driven by cluster-wide privileges.
2525

2626
::::{note}
27-
Audit logs are **disabled** by default and must be explicitly enabled.
27+
Audit logs are disabled by default and must be explicitly enabled.
2828
::::
2929

3030
This section describes how to enable and configure audit logging in both {{es}} and {{kib}} for all supported deployment types, including self-managed clusters, Elastic Cloud Hosted, Elastic Cloud Enterprise (ECE), and Elastic Cloud on Kubernetes (ECK).
3131

32-
## Enabling procedure [enable-audit-logging-procedure]
32+
::::{important}
33+
In orchestrated deployments, audit logs must be shipped to a monitoring deployment; otherwise, they remain at container level and won't be accessible to users. For details on configuring log forwarding in orchestrated environments, refer to [logging configuration](../logging-configuration.md).
34+
::::
35+
36+
## Enable audit logging [enable-audit-logging-procedure]
3337

34-
To enable {{es}} or {{kib}} audit logs, configure `xpack.security.audit.enabled` to `true` in **all {{es}} or {{kib}} nodes**, then restart the nodes to apply the changes. The following provide detailed steps for all supported deployment types:
38+
To enable {{es}} or {{kib}} audit logs, configure `xpack.security.audit.enabled` to `true` in **all {{es}} or {{kib}} nodes**, then restart the nodes to apply the changes. For detailed instructions, select your deployment type:
3539

3640
% content discarded (for review)
3741
% The process of enabling and configuring audit logging is consistent across all supported deployment types, whether self-managed, Elastic Cloud, Elastic Cloud Enterprise (ECE), or Elastic Cloud on Kubernetes (ECK). The same settings apply regardless of the deployment type, ensuring a unified approach to audit logging configuration.
@@ -56,48 +60,43 @@ You can configure additional options to control what events are logged and what
5660

5761
**To enable audit logging in {{kib}}**:
5862

59-
1. Set `xpack.security.audit.enabled` to `true` in `kibana.yml`
60-
2. Restart {{kib}}
63+
1. Set `xpack.security.audit.enabled` to `true` in `kibana.yml`.
64+
2. Restart {{kib}}.
6165

6266
You can optionally configure audit logs location, file/rolling file appenders and ignore filters using [{{kib}} audit logging settings](https://www.elastic.co/guide/en/kibana/current/security-settings-kb.html#audit-logging-settings).
6367

6468
:::::
6569

6670
:::::{tab-item} Elastic Cloud Hosted
6771

68-
::::{important}
69-
In orchestrated deployments, audit logs must be shipped to a monitoring deployment; otherwise, they remain at container level and won't be accessible to users. For details on configuring log forwarding in orchestrated environments, refer to [logging configuration](../logging-configuration.md).
70-
::::
7172

7273
To enable audit logging in an {{ech}} deployment:
7374

74-
1. Log in to the [Elasticsearch Service Console](https://cloud.elastic.co?page=docs&placement=docs-body).
75+
1. Log in to the [{{ecloud}} Console](https://cloud.elastic.co?page=docs&placement=docs-body).
7576

76-
2. Find your deployment on the home page in the Elasticsearch Service card and select **Manage** to access it directly. Or, select **Hosted deployments** to go to the deployments page to view all of your deployments.
77+
2. Find your deployment on the home page in the **Hosted deployments** card and select **Manage** to access it directly. Or, select **Hosted deployments** to go to the deployments page to view all of your deployments.
7778

7879
3. From your deployment menu, go to the **Edit** page.
7980

8081
4. To enable auditing for Elasticsearch:
81-
* In the **Elasticsearch** section select **Manage user settings and extensions**. For deployments with existing user settings, you may have to expand the **Edit elasticsearch.yml** caret for each node instead.
82+
* In the **Elasticsearch** section, select **Manage user settings and extensions**. For deployments with existing user settings, you may have to expand the **Edit elasticsearch.yml** caret for each node instead.
8283
* Add the setting `xpack.security.audit.enabled: true`.
8384

8485
5. To enable auditing for Kibana:
8586
* In the **Kibana** section, select **Edit user settings**. For deployments with existing user settings, you may have to expand the **Edit kibana.yml** caret instead.
8687
* Add the setting `xpack.security.audit.enabled: true`.
8788

8889
6. Select **Save changes**.
89-
* A plan change will run on your deployment. When it finishes, **audit logs will be delivered to your monitoring deployment**.
90+
91+
A plan change will run on your deployment. When it finishes, audit logs will be delivered to your monitoring deployment.
9092
:::::
9193

9294
:::::{tab-item} ECE
9395

94-
::::{important}
95-
In orchestrated deployments, audit logs must be shipped to a monitoring deployment; otherwise, they remain at container level and won't be accessible to users. For details on configuring log forwarding in orchestrated environments, refer to [logging configuration](../logging-configuration.md).
96-
::::
9796

9897
To enable audit logging in an ECE deployment:
9998

100-
1. [Log into the Cloud UI](../../deploy/cloud-enterprise/log-into-cloud-ui.md).
99+
1. [Log in to the Cloud UI](../../deploy/cloud-enterprise/log-into-cloud-ui.md).
101100

102101
2. On the **Deployments** page, select your deployment.
103102

@@ -113,16 +112,16 @@ To enable audit logging in an ECE deployment:
113112
* If your Elastic Stack version is below 7.6.0, add the setting `logging.quiet: false`.
114113

115114
6. Select **Save**.
116-
* A plan change will run on your deployment. When it finishes, **audit logs will be delivered to your monitoring deployment**.
115+
116+
A plan change will run on your deployment. When it finishes, audit logs will be delivered to your monitoring deployment.
117117
:::::
118118

119119
:::::{tab-item} ECK
120120

121-
::::{important}
122-
In orchestrated deployments, audit logs must be shipped to a monitoring deployment; otherwise, they remain at container level and won't be accessible to users. For details on configuring log forwarding in orchestrated environments, refer to [logging configuration](../logging-configuration.md).
123-
::::
124121

125-
To enable audit logging in an ECK-managed cluster, add `xpack.security.audit.enabled: true` to the `config` section of each {{es}} `nodeSet` and to the `config` section of the {{kib}} object's specification. The following example shows this configuration together with logs and metrics delivery towards a remote cluster:
122+
To enable audit logging in an ECK-managed cluster, add `xpack.security.audit.enabled: true` to the `config` section of each {{es}} `nodeSet` and to the `config` section of the {{kib}} object's specification.
123+
124+
The following example shows this configuration, along with together with logs and metrics delivery towards a remote cluster:
126125

127126
```yaml
128127
apiVersion: elasticsearch.k8s.elastic.co/v1
@@ -160,7 +159,7 @@ spec:
160159
xpack.security.audit.enabled: true
161160
```
162161
163-
When enabled, audit logs are collected and shipped to the monitoring cluster referenced in the `monitoring.logs` section. If monitoring is not enabled audit logs will only be visible at container level.
162+
When enabled, audit logs are collected and shipped to the monitoring cluster referenced in the `monitoring.logs` section. If monitoring is not enabled, audit logs will only be visible at container level.
164163
:::::
165164

166165
::::::

deploy-manage/monitor/logging-configuration/logfile-audit-output.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The `logfile` audit output is the only output for auditing. By default, it write
1515

1616
In self-managed clusters, you can configure how the `logfile` is written in the `log4j2.properties` file located in `ES_PATH_CONF` (or check out the relevant portion of the [log4j2.properties in the sources](https://github.com/elastic/elasticsearch/blob/master/x-pack/plugin/core/src/main/config/log4j2.properties)). However, **Elastic strongly recommends using the default Log4j2 configuration**.
1717

18-
Orchestrated deployments (Elastic Cloud, Elastic Cloud Enterprise (ECE), and Elastic Cloud on Kubernetes (ECK)) do not support changes in `log4j2.properties` files of the {{es}} instances.
18+
Orchestrated deployments (ECH, ECE, and ECK) do not support changes in `log4j2.properties` files of the {{es}} instances.
1919

2020
::::{note}
2121
If you overwrite the `log4j2.properties` and do not specify appenders for any of the audit trails, audit events are forwarded to the root appender, which by default points to the `elasticsearch.log` file.

deploy-manage/monitor/logging-configuration/security-event-audit-logging.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ Audit logging also provides forensic evidence in the event of an attack, and can
1818

1919
In this section, you'll learn how to:
2020

21-
1. [](./enabling-audit-logs.md): Activate {{es}} or {{kib}} audit logs for all supported deployment types, including self-managed clusters, {{ech}}, {{ece}} (ECE), and {{eck}} (ECK).
21+
* [](./enabling-audit-logs.md): Activate {{es}} or {{kib}} audit logs for all supported deployment types.
2222

23-
2. [](./configuring-audit-logs.md): Filter and control what security events get logged in the audit log output.
23+
* [](./configuring-audit-logs.md): Filter and control what security events get logged in the audit log output.
2424

25-
3. Optionally, [audit {{es}} search queries](./auditing-search-queries.md): Audit and log search request bodies.
25+
* [Audit {{es}} search queries](./auditing-search-queries.md): Audit and log search request bodies.
2626

27-
4. [Correlate audit events](./correlating-kibana-elasticsearch-audit-logs.md): Explore audit logs and understand how events from the same request are correlated.
27+
* [Correlate audit events](./correlating-kibana-elasticsearch-audit-logs.md): Explore audit logs and understand how events from the same request are correlated.
2828

2929
By following these guidelines, you can effectively audit system activity, enhance security monitoring, and meet compliance requirements.

manage-data/ingest/ingesting-data-from-applications/ingest-data-with-nodejs-on-elasticsearch-service.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ const client = new Client({
290290
})
291291
```
292292

293-
Check [Create API key API](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html) to learn more about API Keys and [Security privileges](../../../deploy-manage/users-roles/cluster-or-deployment-auth/elasticsearch-privileges.md) to understand which privileges are needed. If you are not sure what the right combination of privileges for your custom application is, you can enable [audit logging](../../../deploy-manage/monitor/logging-configuration/enabling-audit-logs.md) on {{es}} to find out what privileges are being used. To learn more about how logging works on {{ech}} or {{ece}}, check [Monitoring Elastic Cloud deployment logs and metrics](https://www.elastic.co/blog/monitoring-elastic-cloud-deployment-logs-and-metrics).
293+
Check [Create API key API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-api-key) to learn more about API Keys and [Security privileges](../../../deploy-manage/users-roles/cluster-or-deployment-auth/elasticsearch-privileges.md) to understand which privileges are needed. If you are not sure what the right combination of privileges for your custom application is, you can enable [audit logging](../../../deploy-manage/monitor/logging-configuration/enabling-audit-logs.md) on {{es}} to find out what privileges are being used. To learn more about how logging works on {{ech}} or {{ece}}, check [Monitoring Elastic Cloud deployment logs and metrics](https://www.elastic.co/blog/monitoring-elastic-cloud-deployment-logs-and-metrics).
294294

295295

296296
### Best practices [ec_best_practices]

manage-data/ingest/ingesting-data-from-applications/ingest-data-with-python-on-elasticsearch-service.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ es = Elasticsearch(
351351
)
352352
```
353353

354-
Check [Create API key API](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html) to learn more about API Keys and [Security privileges](../../../deploy-manage/users-roles/cluster-or-deployment-auth/elasticsearch-privileges.md) to understand which privileges are needed. If you are not sure what the right combination of privileges for your custom application is, you can enable [audit logging](../../../deploy-manage/monitor/logging-configuration/enabling-audit-logs.md) on {{es}} to find out what privileges are being used. To learn more about how logging works on {{ech}} or {{ece}}, check [Monitoring Elastic Cloud deployment logs and metrics](https://www.elastic.co/blog/monitoring-elastic-cloud-deployment-logs-and-metrics).
354+
Check [Create API key API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-api-key) to learn more about API Keys and [Security privileges](../../../deploy-manage/users-roles/cluster-or-deployment-auth/elasticsearch-privileges.md) to understand which privileges are needed. If you are not sure what the right combination of privileges for your custom application is, you can enable [audit logging](../../../deploy-manage/monitor/logging-configuration/enabling-audit-logs.md) on {{es}} to find out what privileges are being used. To learn more about how logging works on {{ech}} or {{ece}}, check [Monitoring Elastic Cloud deployment logs and metrics](https://www.elastic.co/blog/monitoring-elastic-cloud-deployment-logs-and-metrics).
355355

356356
For more information on refreshing an index, searching, updating, and deleting, check the [elasticsearch-py examples](https://www.elastic.co/guide/en/elasticsearch/client/python-api/current/examples.html).
357357

0 commit comments

Comments
 (0)