Add session metadata
Stack
The add_session_metadata processor enriches process events with additional information that users can see using the Session View tool in the Elastic Security platform.
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.
auditbeat.modules:
- module: auditd
processors:
- add_session_metadata:
backend: "auto"
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 Session View tool in the Elastic Security platform, offering users deeper insights for analysis and investigation.
The add_session_metadata processor operates using various backend options.
autois the recommended setting. It attempts to usekernel_tracingfirst, falling back toprocfsif necessary, ensuring compatibility even on systems withoutkernel_tracingsupport.kernel_tracinggathers information about processes using either eBPF or kprobes. It will use eBPF if available, but if not, it will fall back to kprobes. eBPF requires a system with kernel support for eBPF enabled, support for eBPF ring buffer, and auditbeat running as superuser. Kprobe support requires Linux kernel 3.10.0 or above, and auditbeat running as a superuser.procfscollects 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 theSYS_PTRACEcapability.
If you are running Auditbeat in a container, the container must run in the host’s PID namespace. With the auto or kernel_tracing backend, these host directories must also be mounted to the same path within the container: /sys/kernel/debug, /sys/fs/bpf.
To configure and enable Session View functionality, you’ll:
- Add the
add_sessions_metadataprocessor to yourauditbeat.ymlfile. - Configure audit rules in your
auditbeat.ymlfile. - Restart Auditbeat.
We’ll walk you through these steps in more detail.
Edit your
auditbeat.ymlfile and add this info to the modules configuration section:auditbeat.modules: - module: auditd processors: - add_session_metadata: backend: "auto"Add audit rules in the modules configuration section of
auditbeat.ymlor theaudit.rules.dconfig file, depending on your configuration: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 setsidSave your configuration changes.
Restart Auditbeat:
sudo systemctl restart auditbeat