-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…40511) Co-authored-by: Michael Wolf <[email protected]> Co-authored-by: Nick Alayil <[email protected]> Co-authored-by: DeDe Morton <[email protected]> (cherry picked from commit 57ff337) Co-authored-by: Karen Metts <[email protected]>
- Loading branch information
1 parent
79206dd
commit 9721f20
Showing
9 changed files
with
108 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
97 changes: 95 additions & 2 deletions
97
x-pack/auditbeat/processors/sessionmd/docs/add_session_metadata.asciidoc
This file contains 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 |
---|---|---|
@@ -1,6 +1,99 @@ | ||
[[add-session-metadata]] | ||
=== Add session metadata | ||
=== Add session metadata (Beta) | ||
++++ | ||
<titleabbrev>add_session_metadata</titleabbrev> | ||
++++ | ||
|
||
PLACEHOLDER | ||
beta::[] | ||
|
||
The `add_session_metadata` processor enriches process events with additional | ||
information that users can see using the {security-guide}/session-view.html[Session View] tool in the | ||
{elastic-sec} platform. | ||
|
||
NOTE: The current release of `add_session_metadata` processor for {auditbeat} is limited to virtual machines (VMs) and bare metal environments. | ||
|
||
Here's an example using the `add_session_metadata` processor to enhance process events generated by | ||
the `auditd` module of {auditbeat}. | ||
|
||
[source,yaml] | ||
------------------------------------- | ||
auditbeat.modules: | ||
- module: auditd | ||
processors: | ||
- add_session_metadata: | ||
backend: "auto" | ||
------------------------------------- | ||
|
||
[[add-session-metadata-explained]] | ||
==== How the `add_session_metadata` processor works | ||
|
||
Using the available Linux kernel technology, the processor collects comprehensive information on all running system processes, compiling this data into a process database. | ||
When processing an event (such as those generated by the {auditbeat} `auditd` module), the processor queries this database to retrieve information about related processes, including the parent process, session leader, process group leader, and entry leader. | ||
It then enriches the original event with this metadata, providing a more complete picture of process relationships and system activities. | ||
|
||
This enhanced data enables the powerful {security-guide}/session-view.html[Session View] tool in the | ||
{elastic-sec} platform, offering users deeper insights for analysis and investigation. | ||
|
||
[[add-session-metadata-backends]] | ||
===== Backends | ||
|
||
The `add_session_metadata` processor operates using various backend options. | ||
|
||
* `auto` is the recommended setting. | ||
It attempts to use `ebpf` first, falling back to `procfs` if necessary, ensuring compatibility even on systems without `ebpf` support. | ||
* `ebpf` collects process information with eBPF. | ||
This backend requires a system with Linux kernel 5.10.16 or above, kernel support for eBPF enabled, and auditbeat running as superuser. | ||
* `procfs` collects process information with the proc filesystem. | ||
This is compatible with older systems that may not support ebpf. | ||
To gather complete process info, auditbeat requires permissions to read all process data in procfs; for example, run as a superuser or have the `SYS_PTRACE` capability. | ||
|
||
[[add-session-metadata-containers]] | ||
===== Containers | ||
If you are running {auditbeat} in a container, the container must run in the host's PID namespace. | ||
With the `auto` or `ebpf` backend, these host directories must also be mounted to the same path within the container: `/sys/kernel/debug`, `/sys/fs/bpf`. | ||
|
||
[[add-session-metadata-enable]] | ||
==== Enable and configure Session View in {auditbeat} | ||
|
||
To configure and enable {security-guide}/session-view.html[Session View] functionality, you'll: | ||
|
||
* Add the `add_sessions_metadata` processor to your `auditbeat.yml` file. | ||
* Configure audit rules in your `auditbeat.yml` file. | ||
* Restart {auditbeat}. | ||
|
||
We'll walk you through these steps in more detail. | ||
|
||
. Edit your `auditbeat.yml` file and add this info to the modules configuration section: | ||
+ | ||
[source,yaml] | ||
------------------------------------- | ||
auditbeat.modules: | ||
- module: auditd | ||
processors: | ||
- add_session_metadata: | ||
backend: "auto" | ||
------------------------------------- | ||
+ | ||
. Add audit rules in the modules configuration section of `auditbeat.yml` or the | ||
`audit.rules.d` config file, depending on your configuration: | ||
+ | ||
[source,yaml] | ||
------------------------------------- | ||
auditbeat.modules: | ||
- module: auditd | ||
audit_rules: | | ||
## executions | ||
-a always,exit -F arch=b64 -S execve,execveat -k exec | ||
-a always,exit -F arch=b64 -S exit_group | ||
## set_sid | ||
-a always,exit -F arch=b64 -S setsid | ||
------------------------------------- | ||
+ | ||
. Save your configuration changes. | ||
+ | ||
. Restart {auditbeat}: | ||
+ | ||
[source,sh] | ||
------------------------------------- | ||
sudo systemctl restart auditbeat | ||
------------------------------------- |
This file contains 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