-
Notifications
You must be signed in to change notification settings - Fork 156
Monitoring audit logging #352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 19 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
6a1979e
audit logging initial changes
eedugon d870029
elasticsearch audit events prepared to be moved to reference
eedugon 07e5dec
work in progress, applying shaina's suggestions
eedugon 460db8e
audit logging updated
eedugon 838bf49
audit logging more updates
eedugon c559ba0
extra changes for a draft PR
eedugon 94f9220
refining changes and removing migration comments
eedugon 9cf349f
small update
eedugon 6e9e46c
toc and titles updated
eedugon dc389b4
enable audit log simplified a bit
eedugon 3bc8233
added serverless unavailble tags
eedugon c4347ef
link fixed
eedugon 8f298ee
Merge branch 'main' into monitoring_audit_logging
eedugon 2c2517d
renaming again with tool to fix links
eedugon b4d38b7
links fixed due to kibana audit logs file deleted
eedugon d4491dd
subscription feature note updated
eedugon fee0d0a
fixing conflicts
eedugon 7e86fe4
fixed link in get-started/introduction.md file
eedugon 1b4dd3f
Update manage-data/ingest/ingesting-data-from-applications/ingest-dat…
eedugon 542f5a5
Update manage-data/ingest/ingesting-data-from-applications/ingest-dat…
eedugon e852bd4
changes applied per psanz suggestions
eedugon b206e7f
resolved small conflicts
eedugon 433fdbc
fixing links
eedugon a107e95
correlating events updated
eedugon 55db7cb
audit request body updated
eedugon f801787
minor changes, ready for review
eedugon 6e4bb9a
Merge branch 'main' into monitoring_audit_logging
eedugon df94d2c
Apply suggestions from code review
eedugon 79e6760
Update deploy-manage/monitor/logging-configuration/correlating-kibana…
eedugon 24d1154
changes post Shaina's review
eedugon 664a9fe
elasticsearch audit details removed and asciidocalypse temp links added
eedugon e19962a
fixing conflicts
eedugon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
357 changes: 3 additions & 354 deletions
357
...ge/monitor/logging-configuration/correlating-kibana-elasticsearch-audit-logs.md
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 0 additions & 24 deletions
24
...onitor/logging-configuration/enabling-audit-logs-in-orchestrated-deployments.md
This file was deleted.
Oops, something went wrong.
218 changes: 218 additions & 0 deletions
218
deploy-manage/monitor/logging-configuration/enabling-audit-logs.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,218 @@ | ||
--- | ||
mapped_pages: | ||
- https://www.elastic.co/guide/en/elasticsearch/reference/current/enable-audit-logging.html | ||
- https://www.elastic.co/guide/en/kibana/current/xpack-security-audit-logging.html | ||
- https://www.elastic.co/guide/en/cloud-enterprise/current/ece-enable-auditing.html | ||
- https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s_audit_logging.html | ||
- https://www.elastic.co/guide/en/cloud/current/ec-enable-logging-and-monitoring.html#ec-enable-audit-logs | ||
applies: | ||
hosted: all | ||
ece: all | ||
eck: all | ||
stack: all | ||
serverless: unavailable | ||
--- | ||
|
||
# Enable audit logging [enable-audit-logging] | ||
|
||
You can log security-related events such as authentication failures and refused connections to monitor your cluster for suspicious activity (including data access authorization and user security configuration changes). Audit logging can be enabled independently for {{es}} and {{kib}}. | ||
|
||
::::{important} | ||
Audit logs are only available on certain [subscription levels](https://www.elastic.co/subscriptions). | ||
:::: | ||
|
||
::::{note} | ||
Audit logs are **disabled** by default and must be explicitly enabled. | ||
:::: | ||
eedugon marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
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). | ||
eedugon marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
% consider removing this sentence as maybe it doesn't add any benefit | ||
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. | ||
|
||
% consider removing this sentence as maybe it doesn't add any benefit | ||
The only difference lies in how the configuration is applied: | ||
* In self-managed clusters, settings are added directly to the `elasticsearch.yml` and `kibana.yml` configuration files, and you will have to perform a [rolling restart of the cluster](/deploy-manage/maintenance/start-stop-services/full-cluster-restart-rolling-restart-procedures.md) when applying changes to `static` settings (such as `xpack.security.audit.enabled`). | ||
* In orchestrated deployments (Elastic Cloud Hosted, ECE or ECK), the configuration is applied using the appropriate mechanisms provided by the orchestrator, and the restart will be applied automatically. Refer to [](/deploy-manage/deploy.md) for more information about the different orchestrators and deployment configuration mechanisms. | ||
|
||
## Enabling procedure [enable-audit-logging-procedure] | ||
|
||
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 deployment types: | ||
|
||
::::::{tab-set} | ||
|
||
:::::{tab-item} Self-managed | ||
|
||
**To enable audit logging in {{es}}**: | ||
|
||
1. Set `xpack.security.audit.enabled` to `true` in `elasticsearch.yml`. | ||
2. Restart {{es}}. | ||
|
||
When audit logging is enabled, security events are persisted to a dedicated `<clustername>_audit.json` file on the host’s file system, on every cluster node. For more information, refer to [{{es}} logfile audit output](logfile-audit-output.md). | ||
|
||
You can configure additional options to control what events are logged and what information is included in the audit log. For more information, refer to [](#audit-logging-configuration). | ||
|
||
**To enable audit logging in {{kib}}**: | ||
|
||
1. Set `xpack.security.audit.enabled` to `true` in `kibana.yml` | ||
eedugon marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
2. Restart {{kib}} | ||
eedugon marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
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). | ||
eedugon marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
|
||
::::: | ||
|
||
:::::{tab-item} Elastic Cloud Hosted | ||
|
||
::::{important} | ||
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). | ||
:::: | ||
eedugon marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
To enable audit logging in an Elastic Cloud Hosted deployment: | ||
|
||
1. Log in to the [Elasticsearch Service Console](https://cloud.elastic.co?page=docs&placement=docs-body). | ||
eedugon marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
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. | ||
eedugon marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
3. From your deployment menu, go to the **Edit** page. | ||
|
||
4. To enable auditing for Elasticsearch: | ||
* 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. | ||
eedugon marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
* Add the setting `xpack.security.audit.enabled: true`. | ||
|
||
5. To enable auditing for Kibana: | ||
* 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. | ||
* Add the setting `xpack.security.audit.enabled: true`. | ||
|
||
6. Select **Save changes**. | ||
* A plan change will run on your deployment. When it finishes, **audit logs will be delivered to your monitoring deployment**. | ||
eedugon marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
::::: | ||
|
||
:::::{tab-item} ECE | ||
|
||
::::{important} | ||
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). | ||
:::: | ||
eedugon marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
To enable audit logging in an ECE deployment: | ||
|
||
1. [Log into the Cloud UI](../../deploy/cloud-enterprise/log-into-cloud-ui.md). | ||
eedugon marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
2. On the **Deployments** page, select your deployment. | ||
|
||
3. From your deployment menu, go to the **Edit** page. | ||
|
||
4. To enable auditing for {{es}}: | ||
* In the **Elasticsearch** section, select **Edit user settings and plugins**. For deployments with existing user settings, you may have to expand the **Edit elasticsearch.yml** caret for the first node instead. | ||
* Add the setting `xpack.security.audit.enabled: true`. | ||
|
||
5. To enable auditing for {{kib}}: | ||
* 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. | ||
* Add the setting `xpack.security.audit.enabled: true`. | ||
* If your Elastic Stack version is below 7.6.0, add the setting `logging.quiet: false`. | ||
|
||
6. Select **Save**. | ||
* A plan change will run on your deployment. When it finishes, **audit logs will be delivered to your monitoring deployment**. | ||
eedugon marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
::::: | ||
|
||
:::::{tab-item} ECK | ||
|
||
::::{important} | ||
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). | ||
:::: | ||
eedugon marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
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: | ||
eedugon marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
```yaml | ||
apiVersion: elasticsearch.k8s.elastic.co/v1 | ||
kind: Elasticsearch | ||
spec: | ||
monitoring: | ||
metrics: | ||
elasticsearchRefs: | ||
- name: monitoring | ||
namespace: observability | ||
logs: | ||
elasticsearchRefs: | ||
- name: monitoring | ||
namespace: observability | ||
nodeSets: | ||
- name: default | ||
config: | ||
# https://www.elastic.co/guide/en/elasticsearch/reference/current/enable-audit-logging.html | ||
xpack.security.audit.enabled: true | ||
--- | ||
apiVersion: kibana.k8s.elastic.co/v1 | ||
kind: Kibana | ||
spec: | ||
monitoring: | ||
metrics: | ||
elasticsearchRefs: | ||
- name: monitoring | ||
namespace: observability | ||
logs: | ||
elasticsearchRefs: | ||
- name: monitoring | ||
namespace: observability | ||
config: | ||
# https://www.elastic.co/guide/en/kibana/current/xpack-security-audit-logging.html | ||
xpack.security.audit.enabled: true | ||
``` | ||
|
||
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. | ||
eedugon marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
::::: | ||
|
||
:::::: | ||
|
||
## Advanced Configuration [audit-logging-configuration] | ||
|
||
{{es}} and {{kib}} audit logging frameworks offer several configuration mechanisms to control what events are logged and what information is included in the audit log. For more information, refer to: | ||
|
||
### Elasticsearch auditing configuration | ||
|
||
**{{es}} configuration** options include: | ||
|
||
* [{{es}} audited events settings](https://www.elastic.co/guide/en/elasticsearch/reference/current/auditing-settings.html#event-audit-settings) | ||
* [{{es}} node information settings](https://www.elastic.co/guide/en/elasticsearch/reference/current/auditing-settings.html#node-audit-settings) | ||
* [{{es}} ignore policies settings](https://www.elastic.co/guide/en/elasticsearch/reference/current/auditing-settings.html#audit-event-ignore-policies) | ||
|
||
::::{tip} | ||
In {{es}}, all auditing settings except `xpack.security.audit.enabled` are **dynamic**, which means you can configure them using the [cluster update settings API](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html) as a faster and more convenient method that applies changes without requiring a restart. | ||
:::: | ||
|
||
For more information about event details and format, refer to: | ||
* [{{es}} audit events details and schema](/deploy-manage/monitor/logging-configuration/elasticsearch-audit-events.md). | ||
* [{{es}} logentry output format](/deploy-manage/monitor/logging-configuration/logfile-audit-output.md#audit-log-entry-format) | ||
|
||
* Elastic Cloud Hosted deployments provide its own subset of supported settings for auditing configuration: | ||
* [Elasticsearch audit settings on Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-add-user-settings.html#ec_audit_settings) | ||
|
||
### Kibana auditing configuration | ||
|
||
**{{kib}} configuration** options include: | ||
|
||
* [{{kib}} ignore filters](https://www.elastic.co/guide/en/kibana/current/security-settings-kb.html#audit-logging-ignore-filters) | ||
|
||
::::{tip} | ||
To configure {{kib}} settings, follow the same [procedure](#enable-audit-logging-procedure) as when enabling {{kib}} audit logs, but apply the relevant settings instead. | ||
:::: | ||
|
||
For a complete description of auditing event details, such as `category`, `type`, or `action`, refer to: | ||
* [{{kib}} audit events](https://www.elastic.co/guide/en/kibana/current/xpack-security-audit-logging.html#xpack-security-ecs-audit-logging) | ||
|
||
* Elastic Cloud Hosted deployments provide its own subset of supported settings for auditing configuration: | ||
* [Kibana audit settings on Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-manage-kibana-settings.html#ec_logging_and_audit_settings) | ||
|
||
### Configuration suggestions | ||
|
||
* Consider starting with [`xpack.security.audit.logfile.events.include`](https://www.elastic.co/guide/en/elasticsearch/reference/current/auditing-settings.html#xpack-sa-lf-events-include) or the corresponding `exclude` setting to specify the type of events you want to include or exclude in the {{es}} auditing output. | ||
|
||
* If you need a more granular control, refer to [{{es}} audit events ignore policies](./logfile-audit-events-ignore-policies.md) for a better understanding how ignore policies work and when they are beneficial. | ||
|
||
* Refer to [auditing search queries](./auditing-search-queries.md) for details on logging request bodies in the {{es}} audit logs. | ||
|
||
::::{important} | ||
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. | ||
:::: | ||
|
||
* 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. |
35 changes: 0 additions & 35 deletions
35
deploy-manage/monitor/logging-configuration/enabling-elasticsearch-audit-logs.md
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.