This post covers process monitoring on an Ubuntu ARM64 VM in my test lab, using eBPF and the Linux audit framework:
- Tetragon (eBPF): logs every process start and exit, with arguments and exit codes, as JSON.
- auditd: logs who did what (login session, sudo, file changes, failed access, network connections). I used a tuned version of the Neo23x0 ruleset.
- LAUREL: an auditd plugin that writes audit events as JSON, which is much easier to feed into Wazuh.
The configs below are the stock and final versions from the box, and all output is from demo.
Disclaimer: I tested everything in this post myself, on my own lab VM. I used AI to help edit the write-up.
The host:
root@demo:~# uname -m
aarch64
root@demo:~# cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=26.04
DISTRIB_CODENAME=resolute
DISTRIB_DESCRIPTION="Ubuntu 26.04.1 LTS"
PRETTY_NAME="Ubuntu 26.04.1 LTS"
...ARM64, Ubuntu 26.04.1 LTS, kernel 7.0. The ARM64 part matters later, in the auditd section.
Part 1: Tetragon
What Tetragon is
Tetragon is a Cilium project. It loads eBPF programs into the kernel and reports process activity. Without any policy, it logs two event types for every process:
process_exec: a program started. Binary, arguments, working directory, user and parent process.process_exit: a program finished. Same details plus the exit status.
Each event is one JSON line in /var/log/tetragon/tetragon.log. A normal user can’t clear it like shell history, and it covers anything that calls execve(): scripts, cron jobs, web shells, containers.
Install
Tetragon comes as a tarball that installs a systemd service. Both amd64 and arm64 builds are available. I used v1.8.0.
Check that the kernel has BTF (Ubuntu kernels do):
ls -l /sys/kernel/btf/vmlinuxDownload the tarball for your architecture (aarch64 = arm64):
ARCH=$( [ "$(uname -m)" = "aarch64" ] && echo arm64 || echo amd64 )
cd /tmp
curl -LO https://github.com/cilium/tetragon/releases/download/v1.8.0/tetragon-v1.8.0-${ARCH}.tar.gz
tar -xvf tetragon-v1.8.0-${ARCH}.tar.gz
cd tetragon-v1.8.0-${ARCH}/Review the installer, then run it:
vim install.sh
sudo ./install.shIt ends with Tetragon installed successfully!. Check the service:
sudo systemctl status tetragonFiles: daemon in /usr/local/bin/tetragon, CLI in /usr/local/bin/tetra, default config in /usr/local/lib/tetragon/tetragon.conf.d/.
Configuration
The default config is fine to start with. Events go to /var/log/tetragon/tetragon.log and rotate in the same directory. To override a setting, add a file under /etc/tetragon/tetragon.conf.d/, named after the option, with the value inside. For example, to keep more history:
sudo mkdir -p /etc/tetragon/tetragon.conf.d
echo 50 | sudo tee /etc/tetragon/tetragon.conf.d/export-file-max-size-mb
echo 10 | sudo tee /etc/tetragon/tetragon.conf.d/export-file-max-backups
sudo systemctl restart tetragonWatching events
Raw JSON (what the SIEM reads):
sudo tail -f /var/log/tetragon/tetragon.logOne line per event with tetra:
sudo tetra --server-address "unix:///var/run/tetragon/tetragon.sock" getevents -o compactSample 1: ls -l
Testing ls -l in my home directory:
ls -lTetragon logged five events:
{"process_exit":{"process":{"exec_id":"ZGVtbzozNzQyMTExNzM0MDg1NjA6MzAzODQw", "pid":303840, "uid":1001, "cwd":"/home/ubuntu", "binary":"/bin/bash", "flags":"execve", "start_time":"2026-11-15T11:28:34.847617480Z", "auid":1001, "parent_exec_id":"ZGVtbzozNzQyMTExNzI2NzA2MDA6MzAzODM5", "refcnt":1, "tid":303840, "in_init_tree":false}, "parent":{"exec_id":"ZGVtbzozNzQyMTExNzI2NzA2MDA6MzAzODM5", "pid":303839, "uid":1001, "cwd":"/home/ubuntu", "binary":"/bin/bash", "flags":"execve", "start_time":"2026-11-15T11:28:34.846880280Z", "auid":1001, "parent_exec_id":"ZGVtbzozNzQwNTQ0NDc1Mzc4MDA6MzAzNzgw", "refcnt":1, "tid":303839, "in_init_tree":false}, "time":"2026-11-15T11:28:34.848504800Z"}, "node_name":"demo", "time":"2026-11-15T11:28:34.848504120Z"}
{"process_exit":{"process":{"exec_id":"ZGVtbzozNzQyMTExNzI2NzA2MDA6MzAzODM5", "pid":303839, "uid":1001, "cwd":"/home/ubuntu", "binary":"/bin/bash", "flags":"execve", "start_time":"2026-11-15T11:28:34.846880280Z", "auid":1001, "parent_exec_id":"ZGVtbzozNzQwNTQ0NDc1Mzc4MDA6MzAzNzgw", "refcnt":1, "tid":303839, "in_init_tree":false}, "parent":{"exec_id":"ZGVtbzozNzQwNTQ0NDc1Mzc4MDA6MzAzNzgw", "pid":303780, "uid":1001, "cwd":"/home/ubuntu", "binary":"/bin/bash", "flags":"execve clone", "start_time":"2026-11-15T11:25:58.121747240Z", "auid":1001, "parent_exec_id":"ZGVtbzozNzQwNTQ0MjQ3OTkzNjA6MzAzNzc5", "tid":303780, "in_init_tree":false}, "time":"2026-11-15T11:28:34.848844840Z"}, "node_name":"demo", "time":"2026-11-15T11:28:34.848845Z"}
{"process_exec":{"process":{"exec_id":"ZGVtbzozNzQyMTExNzU4NTgzMjA6MzAzODQx", "pid":303841, "uid":1001, "cwd":"/home/ubuntu", "binary":"/usr/bin/ls", "arguments":"--color=auto -l", "flags":"execve clone", "start_time":"2026-11-15T11:28:34.850068160Z", "auid":1001, "parent_exec_id":"ZGVtbzozNzQwNTQ0NDc1Mzc4MDA6MzAzNzgw", "tid":303841, "in_init_tree":false}, "parent":{"exec_id":"ZGVtbzozNzQwNTQ0NDc1Mzc4MDA6MzAzNzgw", "pid":303780, "uid":1001, "cwd":"/home/ubuntu", "binary":"/bin/bash", "flags":"execve clone", "start_time":"2026-11-15T11:25:58.121747240Z", "auid":1001, "parent_exec_id":"ZGVtbzozNzQwNTQ0MjQ3OTkzNjA6MzAzNzc5", "tid":303780, "in_init_tree":false}}, "node_name":"demo", "time":"2026-11-15T11:28:34.850067160Z"}
{"process_exit":{"process":{"exec_id":"ZGVtbzozNzQyMTExNzU4NTgzMjA6MzAzODQx", "pid":303841, "uid":1001, "cwd":"/home/ubuntu", "binary":"/usr/bin/ls", "arguments":"--color=auto -l", "flags":"execve clone", "start_time":"2026-11-15T11:28:34.850068160Z", "auid":1001, "parent_exec_id":"ZGVtbzozNzQwNTQ0NDc1Mzc4MDA6MzAzNzgw", "tid":303841, "in_init_tree":false}, "parent":{"exec_id":"ZGVtbzozNzQwNTQ0NDc1Mzc4MDA6MzAzNzgw", "pid":303780, "uid":1001, "cwd":"/home/ubuntu", "binary":"/bin/bash", "flags":"execve clone", "start_time":"2026-11-15T11:25:58.121747240Z", "auid":1001, "parent_exec_id":"ZGVtbzozNzQwNTQ0MjQ3OTkzNjA6MzAzNzc5", "tid":303780, "in_init_tree":false}, "time":"2026-11-15T11:28:34.855096440Z"}, "node_name":"demo", "time":"2026-11-15T11:28:34.855094560Z"}
{"process_exit":{"process":{"exec_id":"ZGVtbzozNzQyMTExODEzMDIyNDA6MzAzODQy", "pid":303842, "uid":1001, "cwd":"/home/ubuntu", "binary":"/bin/bash", "flags":"execve", "start_time":"2026-11-15T11:28:34.855511400Z", "auid":1001, "parent_exec_id":"ZGVtbzozNzQwNTQ0NDc1Mzc4MDA6MzAzNzgw", "refcnt":1, "tid":303842, "in_init_tree":false}, "parent":{"exec_id":"ZGVtbzozNzQwNTQ0NDc1Mzc4MDA6MzAzNzgw", "pid":303780, "uid":1001, "cwd":"/home/ubuntu", "binary":"/bin/bash", "flags":"execve clone", "start_time":"2026-11-15T11:25:58.121747240Z", "auid":1001, "parent_exec_id":"ZGVtbzozNzQwNTQ0MjQ3OTkzNjA6MzAzNzc5", "tid":303780, "in_init_tree":false}, "time":"2026-11-15T11:28:34.856368720Z"}, "node_name":"demo", "time":"2026-11-15T11:28:34.856368240Z"}Line 3 is the ls exec:
"binary":"/usr/bin/ls": the program."arguments":"--color=auto -l": I typed-l.--color=autocomes from Ubuntu’s defaultlsalias in~/.bashrc. Tetragon logs what actually ran, after alias expansion."parent": pid 303780, my login shell, started at 11:25:58."cwd": where I ran it."flags":"execve clone": bash forked (clone), then the child ranls(execve).
All five:
| Line | Event | PID | What happened |
|---|---|---|---|
| 1 | exit | 303840 (bash) | Short-lived prompt subshell finished |
| 2 | exit | 303839 (bash) | Its parent subshell finished |
| 3 | exec | 303841 (ls) | ls -l started |
| 4 | exit | 303841 (ls) | ls finished, about 5 ms later |
| 5 | exit | 303842 (bash) | Another prompt subshell finished |
The bash processes in lines 1, 2 and 5 come from the prompt: a $(...) in PS1 or PROMPT_COMMAND forks subshells each time the prompt is drawn. They show up in every capture.
Sample 2: a command that isn’t installed
Testing ping before it was installed:
ping -c1 8.8.8.8Tetragon logged:
{"process_exit":{"process":{"exec_id":"ZGVtbzozNzQ0OTAwNTc0NzQzNjA6MzA0MDA4", "pid":304008, "uid":1001, "cwd":"/home/ubuntu", "binary":"/bin/bash", "flags":"execve", "start_time":"2026-11-15T11:33:13.731683600Z", "auid":1001, "parent_exec_id":"ZGVtbzozNzQ0OTAwNTY3OTUwODA6MzA0MDA3", "refcnt":1, "tid":304008, "in_init_tree":false}, "parent":{"exec_id":"ZGVtbzozNzQ0OTAwNTY3OTUwODA6MzA0MDA3", "pid":304007, "uid":1001, "cwd":"/home/ubuntu", "binary":"/bin/bash", "flags":"execve", "start_time":"2026-11-15T11:33:13.731004600Z", "auid":1001, "parent_exec_id":"ZGVtbzozNzQwNTQ0NDc1Mzc4MDA6MzAzNzgw", "refcnt":1, "tid":304007, "in_init_tree":false}, "time":"2026-11-15T11:33:13.732577080Z"}, "node_name":"demo", "time":"2026-11-15T11:33:13.732576520Z"}
{"process_exit":{"process":{"exec_id":"ZGVtbzozNzQ0OTAwNTY3OTUwODA6MzA0MDA3", "pid":304007, "uid":1001, "cwd":"/home/ubuntu", "binary":"/bin/bash", "flags":"execve", "start_time":"2026-11-15T11:33:13.731004600Z", "auid":1001, "parent_exec_id":"ZGVtbzozNzQwNTQ0NDc1Mzc4MDA6MzAzNzgw", "refcnt":1, "tid":304007, "in_init_tree":false}, "parent":{"exec_id":"ZGVtbzozNzQwNTQ0NDc1Mzc4MDA6MzAzNzgw", "pid":303780, "uid":1001, "cwd":"/home/ubuntu", "binary":"/bin/bash", "flags":"execve clone", "start_time":"2026-11-15T11:25:58.121747240Z", "auid":1001, "parent_exec_id":"ZGVtbzozNzQwNTQ0MjQ3OTkzNjA6MzAzNzc5", "tid":303780, "in_init_tree":false}, "time":"2026-11-15T11:33:13.733170240Z"}, "node_name":"demo", "time":"2026-11-15T11:33:13.733169160Z"}
{"process_exit":{"process":{"exec_id":"ZGVtbzozNzQ0OTAwNjAyNjk2MDA6MzA0MDA5", "pid":304009, "uid":1001, "cwd":"/home/ubuntu", "binary":"/bin/bash", "flags":"execve", "start_time":"2026-11-15T11:33:13.734478880Z", "auid":1001, "parent_exec_id":"ZGVtbzozNzQwNTQ0NDc1Mzc4MDA6MzAzNzgw", "refcnt":1, "tid":304009, "in_init_tree":false}, "parent":{"exec_id":"ZGVtbzozNzQwNTQ0NDc1Mzc4MDA6MzAzNzgw", "pid":303780, "uid":1001, "cwd":"/home/ubuntu", "binary":"/bin/bash", "flags":"execve clone", "start_time":"2026-11-15T11:25:58.121747240Z", "auid":1001, "parent_exec_id":"ZGVtbzozNzQwNTQ0MjQ3OTkzNjA6MzAzNzc5", "tid":303780, "in_init_tree":false}, "status":127, "time":"2026-11-15T11:33:13.735117560Z"}, "node_name":"demo", "time":"2026-11-15T11:33:13.735117760Z"}
{"process_exit":{"process":{"exec_id":"ZGVtbzozNzQ0OTAwNjE3MjA4MDA6MzA0MDEw", "pid":304010, "uid":1001, "cwd":"/home/ubuntu", "binary":"/bin/bash", "flags":"execve", "start_time":"2026-11-15T11:33:13.735930160Z", "auid":1001, "parent_exec_id":"ZGVtbzozNzQwNTQ0NDc1Mzc4MDA6MzAzNzgw", "refcnt":1, "tid":304010, "in_init_tree":false}, "parent":{"exec_id":"ZGVtbzozNzQwNTQ0NDc1Mzc4MDA6MzAzNzgw", "pid":303780, "uid":1001, "cwd":"/home/ubuntu", "binary":"/bin/bash", "flags":"execve clone", "start_time":"2026-11-15T11:25:58.121747240Z", "auid":1001, "parent_exec_id":"ZGVtbzozNzQwNTQ0MjQ3OTkzNjA6MzAzNzc5", "tid":303780, "in_init_tree":false}, "time":"2026-11-15T11:33:13.736711160Z"}, "node_name":"demo", "time":"2026-11-15T11:33:13.736710480Z"}Line 3: "pid":304009, "binary":"/bin/bash", ... "status":127.
- Exit status 127 means “command not found”.
- There’s no
process_exec. Bash forks (pid 304009, still/bin/bash) and then callsexecve(). The command didn’t exist, soexecve()never succeeded and there was no new binary to report. Tetragon only saw the fork exit with 127, so the log doesn’t show what I typed. - Lines 1, 2 and 4 are prompt subshells. Same parent shell, 303780.
For detection: several 127 exits in a row from one shell often means someone is checking which tools exist (wget, curl, nc…).
Sample 3: ping -c1 8.8.8.8
Testing ping:
ping -c1 8.8.8.8Tetragon logged:
{"process_exit":{"process":{"exec_id":"ZGVtbzozNzQ2NDU4MzU3NjcxNjA6MzA0MzM4", "pid":304338, "uid":1001, "cwd":"/home/ubuntu", "binary":"/bin/bash", "flags":"execve", "start_time":"2026-11-15T11:35:49.509976120Z", "auid":1001, "parent_exec_id":"ZGVtbzozNzQ2NDU4MzUwNzQxNjA6MzA0MzM3", "refcnt":1, "tid":304338, "in_init_tree":false}, "parent":{"exec_id":"ZGVtbzozNzQ2NDU4MzUwNzQxNjA6MzA0MzM3", "pid":304337, "uid":1001, "cwd":"/home/ubuntu", "binary":"/bin/bash", "flags":"execve", "start_time":"2026-11-15T11:35:49.509283720Z", "auid":1001, "parent_exec_id":"ZGVtbzozNzQwNTQ0NDc1Mzc4MDA6MzAzNzgw", "refcnt":1, "tid":304337, "in_init_tree":false}, "time":"2026-11-15T11:35:49.510883440Z"}, "node_name":"demo", "time":"2026-11-15T11:35:49.510882920Z"}
{"process_exit":{"process":{"exec_id":"ZGVtbzozNzQ2NDU4MzUwNzQxNjA6MzA0MzM3", "pid":304337, "uid":1001, "cwd":"/home/ubuntu", "binary":"/bin/bash", "flags":"execve", "start_time":"2026-11-15T11:35:49.509283720Z", "auid":1001, "parent_exec_id":"ZGVtbzozNzQwNTQ0NDc1Mzc4MDA6MzAzNzgw", "refcnt":1, "tid":304337, "in_init_tree":false}, "parent":{"exec_id":"ZGVtbzozNzQwNTQ0NDc1Mzc4MDA6MzAzNzgw", "pid":303780, "uid":1001, "cwd":"/home/ubuntu", "binary":"/bin/bash", "flags":"execve clone", "start_time":"2026-11-15T11:25:58.121747240Z", "auid":1001, "parent_exec_id":"ZGVtbzozNzQwNTQ0MjQ3OTkzNjA6MzAzNzc5", "tid":303780, "in_init_tree":false}, "time":"2026-11-15T11:35:49.511385200Z"}, "node_name":"demo", "time":"2026-11-15T11:35:49.511269200Z"}
{"process_exec":{"process":{"exec_id":"ZGVtbzozNzQ2NDU4Mzg1MTgyNDA6MzA0MzM5", "pid":304339, "uid":1001, "cwd":"/home/ubuntu", "binary":"/usr/bin/ping", "arguments":"-c1 8.8.8.8", "flags":"execve clone", "start_time":"2026-11-15T11:35:49.512727720Z", "auid":1001, "parent_exec_id":"ZGVtbzozNzQwNTQ0NDc1Mzc4MDA6MzAzNzgw", "tid":304339, "in_init_tree":false}, "parent":{"exec_id":"ZGVtbzozNzQwNTQ0NDc1Mzc4MDA6MzAzNzgw", "pid":303780, "uid":1001, "cwd":"/home/ubuntu", "binary":"/bin/bash", "flags":"execve clone", "start_time":"2026-11-15T11:25:58.121747240Z", "auid":1001, "parent_exec_id":"ZGVtbzozNzQwNTQ0MjQ3OTkzNjA6MzAzNzc5", "tid":303780, "in_init_tree":false}}, "node_name":"demo", "time":"2026-11-15T11:35:49.512727Z"}Process tree:
bash (303780) <- interactive login shell, started 11:25:58
├── bash (304337) <- prompt subshell
│ └── bash (304338) <- nested prompt subshell
└── ping (304339) <- ping -c1 8.8.8.8- Lines 1 and 2: prompt subshells (304338 inside 304337), each under a millisecond.
- Line 3:
ping -c1 8.8.8.8, parent 303780. uidandauidare both 1001.auidis the login UID. It’s set at login and doesn’t change withsudo.
The exit isn’t there because ping was still waiting for a reply when I copied the log. Second run, filtered with jq:
sudo tail -n 1000 /var/log/tetragon/tetragon.log | jq -c '
select((.process_exec.process.binary // .process_exit.process.binary) == "/usr/bin/ping")
| {event: (if .process_exec then "exec" else "exit" end),
time,
pid: (.process_exec.process.pid // .process_exit.process.pid),
ppid: (.process_exec.parent.pid // .process_exit.parent.pid),
auid: (.process_exec.process.auid // .process_exit.process.auid),
args: (.process_exec.process.arguments // .process_exit.process.arguments),
status: (.process_exit.status // 0)}'PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
--- 8.8.8.8 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
{"event":"exec","time":"2026-11-15T12:19:18.349710040Z","pid":308381,"ppid":306182,"auid":1001,"args":"-c1 8.8.8.8","status":0}
{"event":"exit","time":"2026-11-15T12:19:28.352324800Z","pid":308381,"ppid":306182,"auid":1001,"args":"-c1 8.8.8.8","status":1}Exit came 10 seconds later with status 1: no reply, so ping waited its default timeout and gave up (ICMP is blocked in this lab). Tetragon gives you the result of a command, not only the start.
Tetragon field reference
| Field | Meaning |
|---|---|
exec_id | Unique ID for this process. Unlike a PID, it’s never reused. |
parent_exec_id | The parent’s exec_id. Follow these to rebuild a process tree reliably. |
start_time | When the process started, with nanosecond precision |
time | When the event was emitted |
cwd | Working directory at exec time |
uid / auid | Current user / login user. auid survives sudo and su. |
flags | execve clone = a fork followed by an exec |
in_init_tree | Whether the process descends from a container’s init. false for host shells. |
status | Exit code. Omitted when 0. 127 = command not found. |
node_name | Hostname |
exec_id is base64 of hostname:kernel-time:pid:
$ echo ZGVtbzozNzQ2NDU4Mzg1MTgyNDA6MzA0MzM5 | base64 -d
demo:374645838518240:304339Part 2: auditd
Tetragon shows what ran. auditd adds the login session, file changes and denied access. It wasn’t running on this box:
root@demo:~# systemctl is-active auditd
inactiveSo the commands above are only in Tetragon’s log.
Install
sudo apt update && sudo apt install -y auditd
sudo systemctl enable --now auditd
systemctl is-active auditd # activeauditd.conf: stock vs final
Stock /etc/audit/auditd.conf on Ubuntu 26.04:
#
# This file controls the configuration of the audit daemon
#
local_events = yes
write_logs = yes
log_file = /var/log/audit/audit.log
log_group = adm
log_format = ENRICHED
flush = INCREMENTAL_ASYNC
freq = 50
max_log_file = 8
num_logs = 5
priority_boost = 4
name_format = NONE
##name = mydomain
max_log_file_action = ROTATE
space_left = 75
space_left_action = SYSLOG
verify_email = yes
action_mail_acct = root
admin_space_left = 50
admin_space_left_action = SUSPEND
disk_full_action = SUSPEND
disk_error_action = SUSPEND
report_interval = 0
use_libwrap = yes
##tcp_listen_port = 60
tcp_listen_queue = 5
tcp_max_per_addr = 1
##tcp_client_ports = 1024-65535
tcp_client_max_idle = 0
transport = TCP
krb5_principal = auditd
##krb5_key_file = /etc/audit/audit.key
distribute_network = no
q_depth = 2000
overflow_action = SYSLOG
max_restarts = 10
plugin_dir = /etc/audit/plugins.d
end_of_event_timeout = 2Changes:
| Setting | Stock | Final | Why |
|---|---|---|---|
log_format | ENRICHED | RAW | ENRICHED adds name fields after a separator character some parsers choke on. LAUREL adds names anyway. |
max_log_file | 8 | 50 | 8 MB fills fast with exec logging |
num_logs | 5 | 10 | 10 × 50 MB = 500 MB of history |
name_format | NONE | HOSTNAME | Adds node=demo to every line |
disk_error_action | SUSPEND | SYSLOG | Don’t stop auditing on one disk error |
q_depth | 2000 | 8192 | Bigger plugin queue for LAUREL |
Final /etc/audit/auditd.conf:
#
# auditd.conf - tuned for production servers shipping to Wazuh
#
local_events = yes
write_logs = yes
log_file = /var/log/audit/audit.log
log_group = adm
log_format = RAW
flush = INCREMENTAL_ASYNC
freq = 50
max_log_file = 50
num_logs = 10
priority_boost = 4
name_format = HOSTNAME
##name = mydomain
max_log_file_action = ROTATE
space_left = 75
space_left_action = SYSLOG
verify_email = yes
action_mail_acct = root
admin_space_left = 50
admin_space_left_action = SUSPEND
disk_full_action = SUSPEND
disk_error_action = SYSLOG
report_interval = 0
use_libwrap = yes
##tcp_listen_port = 60
tcp_listen_queue = 5
tcp_max_per_addr = 1
##tcp_client_ports = 1024-65535
tcp_client_max_idle = 0
transport = TCP
krb5_principal = auditd
##krb5_key_file = /etc/audit/audit.key
distribute_network = no
q_depth = 8192
overflow_action = SYSLOG
max_restarts = 10
plugin_dir = /etc/audit/plugins.d
end_of_event_timeout = 2systemctl restart auditd is refused on Ubuntu and RHEL (the unit blocks manual stops). Use service:
sudo service auditd restartRules: Neo23x0, tuned for servers and ARM64
I started from Neo23x0/auditd and checked it against the ARM64 syscall table.
On ARM64, upstream loses 21 rules without any visible error. ARM64 has no legacy syscalls like open, chmod, chown, unlink, rename, mkdir or mknod; only the newer *at versions exist (openat, fchmodat, unlinkat, …). Upstream puts old and new syscalls on the same rule line, for example -S open -S openat. On ARM64, auditctl rejects the whole line, and the -i flag at the top of the file hides the error. These upstream rule keys are lost completely on ARM64:
| Key | Rules lost | What you stop seeing |
|---|---|---|
unauthedfileaccess | 8 | Users failing to open files in /etc, /bin, /var, /home, … |
file_access, file_creation, file_modification | 6 | Permission-denied file operations |
perm_mod | 2 | chmod/chown by users |
unauthedfileaccess_system | 2 | Daemons denied access (e.g. a web shell probing /etc/shadow) |
delete | 1 | File deletion by users |
T1070_006_timestomp | 1 | Timestamp tampering |
specialfiles | 1 | Device node creation |
I split each of these into two lines: one with syscalls that exist on both architectures, one with the x86-only ones. On ARM64 only the x86-only line fails.
Noise reductions:
| Upstream | Tuned | Why |
|---|---|---|
Every connect() and socket() from every process | Logged-in users only | Upstream logs every DNS lookup and every PHP-to-database connection |
Watches /var/lib/docker | Removed (only /etc/docker, /etc/containerd and the binaries) | Logged every file write inside every container |
Reads of /var/log/audit/ by anyone | Humans only | Upstream loops with log shippers that read audit.log constantly |
Every bpf() call | Only BPF_PROG_LOAD (new program loaded) | eBPF agents like Tetragon make bpf() calls constantly |
Every adjtimex | Logged-in users only | chrony adjusts the clock this way all the time |
Every unshare/setns | Logged-in users only (pivot_root still for everyone) | runc and systemd services do this all the time |
IPC syscalls (shmget, semget, …) | Removed | Databases and PHP-FPM |
| Failed opens including “file not found” | Only permission denied (EACCES/EPERM) | Shell tab-completion generates endless “not found” errors |
| dpkg/rpm file churn | Excluded (the apt/dpkg command is still logged) | Thousands of events per upgrade |
| sudo re-owning the terminal | Excluded | sudo-rs does it on every call (see below) |
| About 100 duplicated 32-bit rules | One 32-bit catch-all | Any 32-bit syscall on a 64-bit server is already suspicious |
| — | Added setuid_exec | Flags sudo, su, pkexec and SUID binaries |
The full rules file is in the appendix. It goes in /etc/audit/rules.d/audit.rules:
sudo vim /etc/audit/rules.d/audit.rules # paste the final rules
sudo augenrules --loadLoading the rules
The first load printed about 150 errors like this:
Syscall name unknown: open
There was an error in line 13 of /etc/audit/audit.rules
Error sending add rule data request (No such file or directory)
There was an error in line 16 of /etc/audit/audit.rules
Old style watch rules are slower
Error sending add rule data request (Rule exists)
There was an error in line 19 of /etc/audit/audit.rules
Old style watch rules are slower
Error sending add rule data request (Rule exists)
There was an error in line 20 of /etc/audit/audit.rules
...Rule exists was two loads overlapping. service auditd restart already runs augenrules --load, and I ran it again right after. Nothing was broken. After a rule change, run one or the other, not both.
Clean load:
root@demo:~# sudo auditctl -D
sudo augenrules --load 2>&1 | grep -v 'Old style' | grep -iE 'error|unknown' -A0
sudo auditctl -l | wc -l
sudo auditctl -s | grep -E 'enabled|lost'
No rules
Syscall name unknown: open
There was an error in line 13 of /etc/audit/audit.rules
Syscall name unknown: open
There was an error in line 14 of /etc/audit/audit.rules
Error sending add rule data request (No such file or directory)
There was an error in line 16 of /etc/audit/audit.rules
Syscall name unknown: mknod
There was an error in line 33 of /etc/audit/audit.rules
Error sending add rule data request (No such file or directory)
There was an error in line 136 of /etc/audit/audit.rules
Error sending add rule data request (No such file or directory)
There was an error in line 137 of /etc/audit/audit.rules
Error sending add rule data request (No such file or directory)
There was an error in line 140 of /etc/audit/audit.rules
Error sending add rule data request (No such file or directory)
There was an error in line 141 of /etc/audit/audit.rules
Syscall name unknown: chmod
There was an error in line 144 of /etc/audit/audit.rules
Syscall name unknown: chown
There was an error in line 146 of /etc/audit/audit.rules
Syscall name unknown: unlink
There was an error in line 149 of /etc/audit/audit.rules
Syscall name unknown: utimes
There was an error in line 151 of /etc/audit/audit.rules
Syscall name unknown: open
There was an error in line 154 of /etc/audit/audit.rules
Syscall name unknown: open
There was an error in line 155 of /etc/audit/audit.rules
Syscall name unknown: open
There was an error in line 158 of /etc/audit/audit.rules
Syscall name unknown: open
There was an error in line 159 of /etc/audit/audit.rules
Syscall name unknown: mkdir
There was an error in line 162 of /etc/audit/audit.rules
Syscall name unknown: mkdir
There was an error in line 163 of /etc/audit/audit.rules
Syscall name unknown: rename
There was an error in line 166 of /etc/audit/audit.rules
Syscall name unknown: rename
There was an error in line 167 of /etc/audit/audit.rules
159
enabled 1
lost 0All expected:
- 15 ×
Syscall name unknown: the x86-only half of each split rule. The other half loaded. - 5 ×
No such file or directory: paths that don’t exist here (/var/lock/lvm,/var/ossecbefore the Wazuh agent, two CrowdStrike directories). - 159 rules loaded,
enabled 1,lost 0.
Old style watch rules are slower is just a warning about -w watches.
Testing the ARM64 rules
chmod, delete, and a denied read of /etc/shadow:
root@demo:~# cat /proc/self/loginuid; echo
touch /tmp/t && chmod 600 /tmp/t && rm /tmp/t
sudo -u ubuntu cat /etc/shadow
for k in perm_mod delete file_access; do
echo "== $k"
sudo ausearch -k $k -ts recent --format text 2>/dev/null | grep -v audit-configuration
done
1001
cat: /etc/shadow: Permission denied
== perm_mod
At 12:08:48 11/15/26 system, acting as root, successfully add_rule perm_mod using /usr/sbin/auditctl
...
At 12:12:13 11/15/26 ubuntu, acting as root, successfully changed-file-permissions-of /tmp/t to 0600 using /usr/lib/cargo/bin/coreutils/chmod
At 12:12:14 11/15/26 ubuntu, acting as root, successfully changed-file-ownership-of /dev/pts/4 to 0x3e9 using /usr/lib/cargo/bin/sudo
At 12:12:14 11/15/26 ubuntu, acting as root, successfully changed-file-ownership-of /dev/pts/4 to 0x0 using /usr/lib/cargo/bin/sudo
== delete
At 12:08:48 11/15/26 system, acting as root, successfully add_rule delete using /usr/sbin/auditctl
...
At 12:12:13 11/15/26 ubuntu, acting as root, successfully deleted /tmp/t using /usr/bin/gnurm
== file_access
At 12:08:48 11/15/26 system, acting as root, successfully add_rule file_access using /usr/sbin/auditctl
...
At 12:12:14 11/15/26 ubuntu unsuccessfully opened-file /etc/shadow using /usr/lib/cargo/bin/coreutils/cat1001: my login UID, still set in the root shell.- All three fire on ARM64:
changed-file-permissions-of,deleted,unsuccessfully opened-file. - “ubuntu, acting as root” =
auidanduid. add_rulelines are from loading the rules, not user activity. They carry the same key.--format textis handy for quick checks.
Note the paths. Ubuntu 26.04 uses the Rust coreutils and sudo-rs: /usr/lib/cargo/bin/coreutils/chmod, /usr/lib/cargo/bin/sudo, and rm is /usr/bin/gnurm. Detections matching /usr/bin/sudo or /usr/bin/chmod won’t fire. Match on the key or comm.
The changed-file-ownership-of /dev/pts/4 lines are sudo-rs changing the terminal owner, two events per sudo. First try at excluding them:
-a never,exit -F arch=b64 -S fchown -S fchownat -F dir=/dev/pts/Still there:
root@demo:~# sudo auditctl -l | grep pts
sleep 3; T=$(date +%H:%M:%S); sleep 1
sudo -u ubuntu true
sudo ausearch -k perm_mod -ts $T --format text | grep pts || echo "EXCLUSION WORKS"
-a never,exit -F arch=b64 -S fchownat,fchown -F dir=/dev/pts/
At 12:15:28 11/15/26 ubuntu, acting as root, successfully changed-file-ownership-of /dev/pts/4 to 0x3e9 using /usr/lib/cargo/bin/sudo
At 12:15:28 11/15/26 ubuntu, acting as root, successfully changed-file-ownership-of /dev/pts/4 to 0x0 using /usr/lib/cargo/bin/sudoRaw record:
type=PATH msg=audit(11/15/26 12:15:28.974:1928) : item=0 name=/dev/pts/4 inode=7 dev=00:1d mode=character,600 ouid=root ogid=tty rdev=88:04 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0
type=SYSCALL msg=audit(11/15/26 12:15:28.974:1928) : arch=aarch64 syscall=fchownat success=yes exit=0 a0=AT_FDCWD a1=0xb723948d6c40 a2=0x3e9 a3=0x5 items=1 ppid=306182 pid=308096 auid=ubuntu uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=pts3 ses=1378 comm=sudo exe=/usr/lib/cargo/bin/sudo subj=unconfined key=perm_modMy session is pts3, but the chown is on pts/4: sudo-rs opens a new pty per command, and dir= didn’t match it. Matching on file type (mode=character) works:
-a never,exit -F arch=b64 -S fchown -S fchownat -F filetype=character -F exe=/usr/lib/cargo/bin/sudo
-a never,exit -F arch=b64 -S fchown -S fchownat -F filetype=character -F exe=/usr/bin/sudoroot@demo:~# sudo augenrules --load 2>&1 | grep -c 'Syscall name unknown'
sudo auditctl -l | grep filetype
sleep 3; T=$(date +%H:%M:%S); sleep 1
sudo -u ubuntu true
sudo ausearch -k perm_mod -ts $T --format text | grep pts || echo "EXCLUSION WORKS"
15
-a never,exit -F arch=b64 -S fchownat,fchown -F filetype=8192 -F exe=/usr/lib/cargo/bin/sudo
-a never,exit -F arch=b64 -S fchownat,fchown -F filetype=8192 -F exe=/usr/bin/sudo
<no matches>
EXCLUSION WORKSfiletype=8192 = character device. The sudo command itself is still logged (setuid_exec and USER_CMD).
Adding the hostname
After setting name_format = HOSTNAME:
root@demo:~# sudo service auditd restart
sleep 2
sudo auditctl -l | wc -l
ping -c1 -W2 8.8.8.8 >/dev/null
sudo ausearch -x /usr/bin/ping -ts recent | grep -m1 '^node='
161
node=demo type=PROCTITLE msg=audit(1794745393.432:2971): proctitle=70696E67002D6331002D573200382E382E382E38Lines now start with node=demo, matching Tetragon’s node_name. 161 rules: both filetype lines loaded.
proctitle is the command line in hex, arguments separated by 00:
70696E67 00 2D6331 00 2D5732 00 382E382E382E38
ping ␀ -c1 ␀ -W2 ␀ 8.8.8.8auditd hex-encodes any value with spaces, quotes, control or non-ASCII characters, so commands with arguments end up like this. ausearch -i decodes it. Wazuh’s stock auditd decoder doesn’t, hence LAUREL in Part 3.
The same ping in Tetragon and auditd
root@demo:~# T=$(date +%H:%M:%S); sleep 1
ping -c1 8.8.8.8
sleep 2
echo "=============== AUDITD (summary) ==============="
sudo ausearch -ts $T -x /usr/bin/ping --format text
echo "=============== AUDITD (fields) ==============="
sudo ausearch -ts $T -x /usr/bin/ping -i | grep -E '^type=(SYSCALL|EXECVE|CWD|SOCKADDR)' | sed 's/ a[0-3]=0x[0-9a-f]*//g'
=============== AUDITD (summary) ===============
At 12:19:18 11/15/26 ubuntu, acting as root, successfully executed /usr/bin/ping
At 12:19:18 11/15/26 ubuntu, acting as root, successfully connected-to 8.8.8.8 using /usr/bin/ping
=============== AUDITD (fields) ===============
type=CWD msg=audit(11/15/26 12:19:18.349:2407) : cwd=/root
type=EXECVE msg=audit(11/15/26 12:19:18.349:2407) : argc=3 a0=ping a1=-c1 a2=8.8.8.8
type=SYSCALL msg=audit(11/15/26 12:19:18.349:2407) : arch=aarch64 syscall=execve success=yes exit=0 items=2 ppid=306182 pid=308381 auid=ubuntu uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=pts3 ses=1378 comm=ping exe=/usr/bin/ping subj=unconfined key=process_creation
type=SOCKADDR msg=audit(11/15/26 12:19:18.351:2408) : saddr={ saddr_fam=inet laddr=8.8.8.8 lport=1025 }
type=SYSCALL msg=audit(11/15/26 12:19:18.351:2408) : arch=aarch64 syscall=connect success=yes exit=0 items=0 ppid=306182 pid=308381 auid=ubuntu uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=pts3 ses=1378 comm=ping exe=/usr/bin/ping subj=unconfined key=network_connect_4Same run as the second jq output in sample 3:
| Tetragon | auditd | |
|---|---|---|
| pid / ppid | 308381 / 306182 | 308381 / 306182 |
| Exec time | 12:19:18.349 UTC | 12:19:18.349 |
| Command | -c1 8.8.8.8 | a0=ping a1=-c1 a2=8.8.8.8 |
| Who | auid 1001 | auid=ubuntu uid=root |
| Where | — | cwd=/root, tty=pts3, ses=1378 |
| Network | — | connect to 8.8.8.8 (network_connect_4) |
| Exit | 12:19:28.352, status 1 | — (auditd doesn’t log exits) |
Correlate on pid. auditd has the session, cwd and network call. Tetragon has the exit code and duration.
lport=1025 isn’t real traffic. iputils ping connects a UDP socket only to pick the source IP; no packet is sent. The ICMP itself goes out with sendto(), which isn’t audited here.
Part 3: LAUREL
LAUREL (threathunters-io) is an auditd plugin that writes each audit event as one JSON line. It decodes the hex, adds syscall and user names, and links events to the process that started them. It writes its own file; auditd’s log is unchanged:
kernel --> auditd --> /var/log/audit/audit.log (raw text, for ausearch/aureport)
|
+--> plugin --> laurel --> /var/log/laurel/audit.log (JSON, for the SIEM)Install
It’s in Ubuntu universe, ARM64 included:
...
Setting up laurel (0.7.3-2) ...
Creating group '_laurel' with GID 984.
Creating user '_laurel' (daemon user for laurel) with UID 984
and GID 984.
0.7.3 (generic)
/etc
/etc/audit
/etc/audit/plugins.d
/etc/audit/plugins.d/laurel.conf
/etc/laurel
/etc/laurel/config.toml
/usr/sbin
/usr/sbin/laurel
/usr/sbin/laurel2auditThe package creates the _laurel user, plugin file and config, but not the log directory:
root@demo:~# sudo chown _laurel:_laurel /var/log/laurel
chown: cannot dereference '/var/log/laurel': No such file or directoryCreate it:
sudo install -d -o _laurel -g _laurel -m 750 /var/log/laurelStock config
Plugin file /etc/audit/plugins.d/laurel.conf, left as is:
active = yes
direction = out
type = always
format = string
path = /usr/sbin/laurel
args = --config /etc/laurel/config.tomlPackaged /etc/laurel/config.toml (comments removed):
directory = "/var/log/laurel"
user = "_laurel"
statusreport-period = 0
input = "stdin"
[auditlog]
file = "audit.log"
size = 5000000
generations = 10
[state]
file = "state"
generations = 0
max-age = 60
[transform]
execve-argv = [ "array" ]
[translate]
universal = false
user-db = false
drop-raw = false
[enrich]
pid = true
execve-env = [ "LD_PRELOAD", "LD_LIBRARY_PATH" ]
container = true
container_info = false
systemd = true
script = true
user-groups = true
[label-process]
label-keys = [ "software_mgmt" ]
label-exe.'^/opt/.*/bin/java$' = 'java'
label-exe.'^/usr/lib/jvm/.*/bin/java$' = 'java'
label-exe.'^/snap/amazon-ssm-agent/\d+/' = 'amazon-ssm-agent'
unlabel-exe."bin/php$" = "java"
label-argv."^(?:\\S+/)?java .* -Dweblogic" = "weblogic"
label-argv-count = 32
label-argv-bytes = 4096
label-script."^/root/maint-.*[.]sh$" = "maint"
propagate-labels = [ "software_mgmt", "amazon-ssm-agent" ]
[filter]
filter-null-keys = false
filter-action = "drop"Final config
| Setting | Stock | Final | Why |
|---|---|---|---|
size | 5000000 | 52428800 | 50 MiB per file, matching auditd |
statusreport-period | 0 | 86400 | Daily stats line in syslog |
execve-argv | ["array"] | ["array", "string"] | Adds ARGV_STR (full command as a string) |
universal | false | true | Syscall, arch and socket addresses as text |
user-db | false | true | User and group names |
[label-process] | Java/WebLogic/SSM examples | Only software_mgmt | Removed examples. software_mgmt labels anything touching /etc/apt/ and its children, useful for filtering apt noise. |
Final /etc/laurel/config.toml:
directory = "/var/log/laurel"
user = "_laurel"
statusreport-period = 86400
input = "stdin"
[auditlog]
file = "audit.log"
size = 52428800
generations = 10
[state]
file = "state"
generations = 0
max-age = 60
[transform]
execve-argv = [ "array", "string" ]
[translate]
universal = true
user-db = true
drop-raw = false
[enrich]
pid = true
execve-env = [ "LD_PRELOAD", "LD_LIBRARY_PATH" ]
container = true
container_info = false
systemd = true
script = true
user-groups = true
[label-process]
label-keys = [ "software_mgmt" ]
propagate-labels = [ "software_mgmt" ]
label-argv-count = 32
label-argv-bytes = 4096
[filter]
filter-null-keys = false
filter-action = "drop"Validate and start
root@demo:~# sudo laurel --dry-run --config /etc/laurel/config.toml && echo CONFIG OK
sudo service auditd restart
sleep 2
pgrep -a laurel
ls -l /var/log/laurel/
sudo auditctl -s | grep -E 'enabled|lost'
Laurel 0.7.3 (generic): Config ok.
CONFIG OK
309666 /usr/sbin/laurel --config /etc/laurel/config.toml
total 392
-rw-r----- 1 _laurel _laurel 397715 Nov 15 12:34 audit.log
enabled 1
lost 0--dry-runvalidates the config. Key names differ between versions (0.7.3 usesuser-db, notuserdb).- auditd starts LAUREL, so a restart is needed.
- The log is owned by
_laurel, mode 640.
A ping in LAUREL JSON
root@demo:~# ping -c1 -W2 8.8.8.8 >/dev/null; sleep 1
sudo tail -n 100 /var/log/laurel/audit.log | jq -c 'select(.SYSCALL.exe=="/usr/bin/ping")' | tail -1 | jq .{
"ID": "1794746093.359:4257",
"NODE": "demo",
"SYSCALL": {
"arch": "0xc00000b7",
"syscall": 203,
"success": "yes",
"exit": 0,
"items": 0,
"ppid": 306182,
"pid": 309714,
"auid": 1001,
"uid": 0,
"gid": 0,
"euid": 0,
"suid": 0,
"fsuid": 0,
"egid": 0,
"sgid": 0,
"fsgid": 0,
"tty": "pts3",
"ses": 1378,
"comm": "ping",
"exe": "/usr/bin/ping",
"subj": "unconfined",
"key": "network_connect_4",
"ARGV": [
"0x5",
"0xffffc9100c18",
"0x10",
"0x0"
],
"ARCH": "aarch64",
"SYSCALL": "connect",
"PID": {
"EVENT_ID": "1794746093.356:4256"
},
"PPID": {
"START_TIME": "1794743486.834",
"comm": "bash",
"exe": "/usr/bin/bash",
"ppid": 306180
},
"UID": "root",
"AUID": "ubuntu",
"GID": "root",
"EUID": "root",
"SUID": "root",
"FSUID": "root",
"EGID": "root",
"SGID": "root",
"FSGID": "root",
"UID_GROUPS": [
"root"
]
},
"SOCKADDR": [
{
"SADDR": {
"saddr_fam": "inet",
"addr": "8.8.8.8",
"port": 1025
}
}
],
"PROCTITLE": {
"ARGV": [
"ping",
"-c1",
"-W2",
"8.8.8.8"
]
}
}That’s ping’s connect() event. Compared with raw auditd:
| Raw auditd | LAUREL |
|---|---|
proctitle=70696E67002D6331... | "PROCTITLE": {"ARGV": ["ping","-c1","-W2","8.8.8.8"]} |
saddr= as hex | "SADDR": {"addr": "8.8.8.8", "port": 1025} |
syscall=203 arch=c00000b7 | "SYSCALL": "connect", "ARCH": "aarch64" |
auid=1001 uid=0 | Both numbers kept, plus "AUID": "ubuntu", "UID": "root" |
ppid=306182 | "PPID": {"comm": "bash", "exe": "/usr/bin/bash"} |
node=demo | "NODE": "demo" |
PID.EVENT_ID points to the exec event of the same process:
root@demo:~# sudo grep '"1794746093.356:4256"' /var/log/laurel/audit.log | head -1 | jq '{ID, key: .SYSCALL.key, EXECVE, CWD, PATH: [.PATH[]?.name]}'{
"ID": "1794746093.356:4256",
"key": "process_creation",
"EXECVE": {
"argc": 4,
"ARGV": [
"ping",
"-c1",
"-W2",
"8.8.8.8"
],
"ARGV_STR": "ping -c1 -W2 8.8.8.8",
"ENV": {}
},
"CWD": {
"cwd": "/root"
},
"PATH": [
"/usr/bin/ping",
"/lib/ld-linux-aarch64.so.1"
]
}ARGV_STR: the full command as one string, easy to match in rules.ENV:LD_PRELOADandLD_LIBRARY_PATHif set. Empty here.PATH: the binary and its loader.
Searching with grep
Searching for a ping exec with grep:
root@demo:~# sudo grep '"process_creation"' /var/log/laurel/audit.log | grep '/usr/bin/ping' | tail -1
{"ID":"1794746820.816:4989","NODE":"demo","SYSCALL":{..."comm":"grep","exe":"/usr/bin/grep",..."key":"process_creation",...},"EXECVE":{"argc":3,"ARGV":["grep","--color=auto","/usr/bin/ping"],"ARGV_STR":"grep --color=auto /usr/bin/ping","ENV":{}},...}That’s grep’s own exec, since its arguments contain /usr/bin/ping. Filter on exe instead:
sudo jq -c 'select(.SYSCALL.key=="process_creation" and .SYSCALL.exe=="/usr/bin/ping")' /var/log/laurel/audit.log | tail -1Part 4: Shipping to Wazuh
Agent side (/var/ossec/etc/ossec.conf): collect LAUREL’s JSON instead of the raw audit log, plus Tetragon:
<localfile>
<log_format>json</log_format>
<location>/var/log/laurel/audit.log</location>
</localfile>
<localfile>
<log_format>json</log_format>
<location>/var/log/tetragon/tetragon.log</location>
</localfile>Manager side, /var/ossec/etc/rules/local_rules.xml:
<group name="laurel,audit,">
<rule id="100400" level="3">
<decoded_as>json</decoded_as>
<field name="SYSCALL.key">^process_creation$</field>
<description>Exec by $(SYSCALL.AUID) as $(SYSCALL.UID): $(EXECVE.ARGV_STR)</description>
</rule>
<rule id="100401" level="10">
<decoded_as>json</decoded_as>
<field name="SYSCALL.key">^setuid_exec$|^anon_file_create$|^systemwide_preloads$|^rootkey$|^modules$|^bpf$|^32bit_abi$</field>
<description>High-value audit event [$(SYSCALL.key)] by $(SYSCALL.AUID): $(EXECVE.ARGV_STR)</description>
</rule>
</group>
<group name="tetragon,">
<rule id="100300" level="3">
<decoded_as>json</decoded_as>
<field name="process_exec.process.binary">\.+</field>
<description>Tetragon exec: $(process_exec.process.binary) $(process_exec.process.arguments)</description>
</rule>
</group>Test with wazuh-logtest. After installing the agent, run sudo augenrules --load again so the /var/ossec watches load.
Notes
- Tetragon: what ran, arguments, exit code. auditd: who, which session, what changed or was denied.
- On ARM64, rules mixing legacy and
*atsyscalls fail silently. Load once without-iand read the errors. - Ubuntu 26.04
sudoand coreutils live under/usr/lib/cargo/bin/. Don’t hard-code/usr/bin/sudoin detections. - Don’t run
augenrules --loadright afterservice auditd restart. proctitleis hex. LAUREL decodes it.
Sources
Appendix: final /etc/audit/rules.d/audit.rules
## =============================================================================
## Tuned auditd ruleset for production Linux servers
## Based on Neo23x0/auditd (Nextron Systems, Apache-2.0), upstream commit 6111069
##
## Goals vs upstream:
## - Keep high-value telemetry (process creation, persistence, privilege
## changes, tampering, exploitation primitives)
## - Drop / scope the rules that flood logs on servers running daemons,
## Docker, databases, PHP-FPM, chrony, eBPF agents (Tetragon, Falco)
## - Work correctly on BOTH x86_64 and aarch64 (ARM64)
##
## Install path: /etc/audit/rules.d/audit.rules (then: augenrules --load)
##
## UID_MIN: rules use auid>=1000. Check: awk '/^UID_MIN/{print $2}' /etc/login.defs
## =============================================================================
## Remove any existing rules
-D
## Buffer and backlog
-b 8192
--backlog_wait_time 60000
## Failure mode: 1 = printk (never panic a production box)
-f 1
## Ignore errors so distro-specific paths and arch-specific syscalls
## don't abort the load. To validate strictly, test a copy without this line.
-i
## =============================================================================
## 1. EXCLUSIONS (must come first: auditd is first-match-wins)
## =============================================================================
## Noise from SSH/TLS session key handling on internet-facing servers
-a always,exclude -F msgtype=CRYPTO_KEY_USER
## Cron session noise (LOGIN / USER_START / CRED_* every minute per job)
## SELinux hosts (RHEL):
-a never,user -F subj_type=crond_t
-a never,exit -F subj_type=crond_t
## Hypervisor guest agents
-a never,exit -F arch=b64 -S all -F exe=/usr/bin/vmtoolsd
## Package manager file churn (dpkg/rpm rewriting thousands of files on upgrade).
## Only file-change syscalls are dropped. The execve of apt/dpkg/rpm and every
## maintainer script is still logged by process_creation.
-a never,exit -F arch=b64 -S openat -S renameat -S renameat2 -S unlinkat -S fchmod -S fchmodat -S fchown -S fchownat -S utimensat -S setxattr -S lsetxattr -S fsetxattr -S linkat -S symlinkat -S mkdirat -F exe=/usr/bin/dpkg
-a never,exit -F arch=b64 -S openat -S renameat -S renameat2 -S unlinkat -S fchmod -S fchmodat -S fchown -S fchownat -S utimensat -S setxattr -S lsetxattr -S fsetxattr -S linkat -S symlinkat -S mkdirat -F exe=/usr/bin/rpm
## x86_64-only legacy syscalls for the same (fails harmlessly on aarch64)
-a never,exit -F arch=b64 -S open -S creat -S rename -S unlink -S rmdir -S chmod -S chown -S lchown -S link -S symlink -S mkdir -F exe=/usr/bin/dpkg
-a never,exit -F arch=b64 -S open -S creat -S rename -S unlink -S rmdir -S chmod -S chown -S lchown -S link -S symlink -S mkdir -F exe=/usr/bin/rpm
## sudo/sudo-rs re-owning the terminal device on every call (pure noise).
## Matches by file type, not by dir=/dev/pts/: the dir filter did not match
## sudo-rs's per-call ptys on Ubuntu ARM64. The sudo exec itself is still
## logged (setuid_exec + USER_CMD).
-a never,exit -F arch=b64 -S fchown -S fchownat -F filetype=character -F exe=/usr/lib/cargo/bin/sudo
-a never,exit -F arch=b64 -S fchown -S fchownat -F filetype=character -F exe=/usr/bin/sudo
## High-volume paths
-a never,exit -F arch=b64 -F dir=/dev/shm/ -F key=sharedmemaccess
-a never,exit -F arch=b64 -F dir=/var/lock/lvm/ -F key=locklvm
## --- Site-specific exclusions (uncomment and adapt after reviewing aureport) ---
## Drop all executions by a monitoring account that polls with shell commands:
#-a never,exit -F arch=b64 -S execve -S execveat -F uid=<monitoring_uid>
## Drop executions OF one specific noisy binary (by anyone; use sparingly):
#-a never,exit -F arch=b64 -S execve -S execveat -F exe=/usr/bin/<binary>
## =============================================================================
## 2. SELF-AUDITING
## =============================================================================
## Audit log tampering (writes/attr changes by anyone)
-w /var/log/audit/ -p wa -k auditlog
## Audit log READS only by humans. Upstream watches reads from everyone, which
## loops with log shippers (Wazuh logcollector, Filebeat, Fluent Bit, rsyslog).
-a always,exit -F dir=/var/log/audit/ -F perm=r -F auid>=1000 -F auid!=unset -k auditlog_read
## Audit configuration and tools
-w /etc/audit/ -p wa -k auditconfig
-w /etc/libaudit.conf -p wa -k auditconfig
-w /etc/audisp/ -p wa -k audispconfig
-w /sbin/auditctl -p x -k audittools
-w /sbin/auditd -p x -k audittools
-w /usr/sbin/augenrules -p x -k audittools
## =============================================================================
## 3. KERNEL, BOOT, MODULES, TIME
## =============================================================================
-w /etc/sysctl.conf -p wa -k sysctl
-w /etc/sysctl.d -p wa -k sysctl
-a always,exit -F arch=b64 -S init_module -S finit_module -S delete_module -F auid!=unset -k modules
-w /etc/modprobe.conf -p wa -k modprobe
-w /etc/modprobe.d -p wa -k modprobe
-w /etc/modules-load.d/ -p wa -k modprobe
-a always,exit -F arch=b64 -S kexec_load -S kexec_file_load -k KEXEC
-a always,exit -F arch=b64 -S mknodat -k specialfiles
-a always,exit -F arch=b64 -S mknod -k specialfiles
-a always,exit -F arch=b64 -S mount -S umount2 -S move_mount -S open_tree -S fsopen -S fsconfig -S fsmount -F auid!=unset -k mount
-a always,exit -F arch=b64 -S swapon -S swapoff -F auid!=unset -k swap
## Time changes. Upstream logs every adjtimex call, which chrony and
## systemd-timesyncd make constantly. Daemon slewing (auid unset) is dropped;
## hard clock sets are kept from everyone.
-a always,exit -F arch=b64 -S settimeofday -S clock_settime -k time
-a always,exit -F arch=b64 -S adjtimex -S clock_adjtime -F auid!=unset -k time
-w /etc/localtime -p wa -k localtime
-a always,exit -F arch=b64 -S reboot -k reboot
-a always,exit -F arch=b64 -S acct -k process_accounting
-a always,exit -F arch=b64 -F dir=/boot -F perm=wa -k boot_writes
## =============================================================================
## 4. PERSISTENCE
## =============================================================================
## Cron / at
-w /etc/cron.allow -p wa -k cron
-w /etc/cron.deny -p wa -k cron
-w /etc/cron.d/ -p wa -k cron
-w /etc/cron.daily/ -p wa -k cron
-w /etc/cron.hourly/ -p wa -k cron
-w /etc/cron.monthly/ -p wa -k cron
-w /etc/cron.weekly/ -p wa -k cron
-w /etc/crontab -p wa -k cron
-w /etc/anacrontab -p wa -k cron
-w /etc/at.allow -p wa -k cron
-w /etc/at.deny -p wa -k cron
-w /var/spool/cron/ -p wa -k cron
-w /var/spool/at/ -p wa -k cron
## systemd units and timers
-w /etc/systemd/ -p wa -k systemd
-w /usr/lib/systemd/ -p wa -k systemd
-w /lib/systemd/ -p wa -k systemd
-w /usr/local/lib/systemd/ -p wa -k systemd
## Legacy init
-w /etc/inittab -p wa -k init
-w /etc/init.d/ -p wa -k init
-w /etc/init/ -p wa -k init
-w /etc/rc.local -p wa -k init
## Shell profiles
-w /etc/profile.d/ -p wa -k shell_profiles
-w /etc/profile -p wa -k shell_profiles
-w /etc/shells -p wa -k shell_profiles
-w /etc/bashrc -p wa -k shell_profiles
-w /etc/bash.bashrc -p wa -k shell_profiles
-w /etc/csh.cshrc -p wa -k shell_profiles
-w /etc/csh.login -p wa -k shell_profiles
-w /etc/fish/ -p wa -k shell_profiles
-w /etc/zsh/ -p wa -k shell_profiles
-w /etc/environment -p wa -k environment
## Dynamic linker hijacking
-w /etc/ld.so.conf -p wa -k libpath
-w /etc/ld.so.conf.d -p wa -k libpath
-w /etc/ld.so.preload -p wa -k systemwide_preloads
## udev
-w /etc/udev/rules.d/ -p wa -k udev
## MOTD scripts (run as root on every SSH login)
-w /etc/update-motd.d/ -p wa -k motd
## =============================================================================
## 5. IDENTITY, AUTH, PRIVILEGE
## =============================================================================
-w /etc/group -p wa -k etcgroup
-w /etc/gshadow -p wa -k etcgroup
-w /etc/passwd -p wa -k etcpasswd
-w /etc/shadow -p wa -k etcpasswd
-w /etc/nsswitch.conf -p wa -k etcpasswd
-w /etc/sssd/ -p wa -k etcpasswd
-w /etc/openldap/ -p wa -k etcpasswd
-w /etc/krb5.conf -p wa -k etcpasswd
-w /etc/krb5.conf.d/ -p wa -k etcpasswd
-w /etc/subuid -p wa -k etcpasswd
-w /etc/subgid -p wa -k etcpasswd
-w /etc/pam.d/ -p wa -k pam
-w /etc/security/ -p wa -k pam
-w /etc/polkit-1/ -p wa -k pam
-w /etc/sudoers -p wa -k actions
-w /etc/sudoers.d/ -p wa -k actions
-w /etc/login.defs -p wa -k login
-w /etc/securetty -p wa -k login
-w /var/log/faillog -p wa -k login
-w /var/log/lastlog -p wa -k login
-w /var/log/tallylog -p wa -k login
-w /var/run/utmp -p wa -k session
-w /var/log/btmp -p wa -k session
-w /var/log/wtmp -p wa -k session
## SSH
-w /etc/ssh/ -p wa -k sshd
-w /etc/dropbear/ -p wa -k sshd
-w /root/.ssh -p wa -k rootkey
## Admin browsing other users' home directories
-a always,exit -F dir=/home -F uid=0 -F auid>=1000 -F auid!=unset -C auid!=obj_uid -k power_abuse
## =============================================================================
## 6. NETWORK AND SYSTEM CONFIGURATION
## =============================================================================
-a always,exit -F arch=b64 -S sethostname -S setdomainname -k network_modifications
-w /etc/hosts -p wa -k network_modifications
-w /etc/resolv.conf -p wa -k network_modifications
-w /etc/hostname -p wa -k network_modifications
-w /etc/netplan/ -p wa -k network
-w /etc/network/ -p wa -k network
-w /etc/sysconfig/ -p wa -k sysconfig
-a always,exit -F dir=/etc/NetworkManager/ -F perm=wa -k network_modifications
-w /etc/nftables.conf -p wa -k firewall
-w /etc/iptables/ -p wa -k firewall
-w /etc/ufw/ -p wa -k firewall
-w /etc/issue -p wa -k etcissue
-w /etc/issue.net -p wa -k etcissue
-w /etc/default/ -p wa -k svc_defaults
-w /etc/fstab -p wa -k fstab
-w /etc/aliases -p wa -k mail
-w /etc/postfix/ -p wa -k mail
-w /etc/exim4/ -p wa -k mail
-w /etc/selinux/ -p wa -k mac_policy
-w /etc/apparmor/ -p wa -k mac_policy
-w /etc/apparmor.d/ -p wa -k mac_policy
## Software sources
-w /etc/apt/ -p wa -k software_mgmt
-w /etc/dnf/ -p wa -k software_mgmt
-w /etc/yum.repos.d/ -p wa -k software_mgmt
## Container daemon configuration.
## Upstream watches /var/lib/docker recursively, which logs every write in every
## container's overlay filesystem. Removed; only config and units are watched.
-w /etc/docker/ -p wa -k docker
-w /etc/containers/ -p wa -k containers
-w /etc/containerd/ -p wa -k containers
-w /usr/bin/dockerd -p wa -k docker
-w /usr/bin/containerd -p wa -k containers
-w /usr/bin/runc -p wa -k containers
## Security tooling tampering (keep the ones you run, the rest fail harmlessly)
-w /var/ossec/etc/ -p wa -k wazuh_config
-w /var/ossec/bin/ -p wa -k wazuh_config
-w /etc/tetragon/ -p wa -k tetragon_config
-w /etc/filebeat/ -p wa -k filebeat
-a always,exit -F arch=b64 -F dir=/etc/crowdstrike/ -F perm=wa -F key=falcon_sensor
-a always,exit -F arch=b64 -F dir=/opt/CrowdStrike/ -F perm=wa -F key=falcon_sensor
## System binary tampering. /bin is a symlink to /usr/bin on modern distros,
## so only /usr is watched (upstream double-fires on both). dpkg/rpm writes
## are already excluded in section 1.
-a always,exit -F arch=b64 -F dir=/usr -F perm=wa -k usr_writes
## =============================================================================
## 7. DAC CHANGES, DELETION, TIMESTOMPING (human sessions only)
## Each rule has a common line (x86_64 + aarch64) and a legacy line
## (x86_64-only syscalls). On aarch64 the legacy line fails harmlessly.
## Upstream combines them, so on ARM64 the whole rule is silently dropped.
## =============================================================================
-a always,exit -F arch=b64 -S fchmod -S fchmodat -F auid>=1000 -F auid!=unset -k perm_mod
-a always,exit -F arch=b64 -S chmod -F auid>=1000 -F auid!=unset -k perm_mod
-a always,exit -F arch=b64 -S fchown -S fchownat -F auid>=1000 -F auid!=unset -k perm_mod
-a always,exit -F arch=b64 -S chown -S lchown -F auid>=1000 -F auid!=unset -k perm_mod
-a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=unset -k perm_mod
-a always,exit -F arch=b64 -S unlinkat -S renameat -S renameat2 -F auid>=1000 -F auid!=unset -k delete
-a always,exit -F arch=b64 -S unlink -S rmdir -S rename -F auid>=1000 -F auid!=unset -k delete
-a always,exit -F arch=b64 -S utimensat -F auid>=1000 -F auid!=unset -k T1070_006_timestomp
-a always,exit -F arch=b64 -S utimes -S futimesat -F auid>=1000 -F auid!=unset -k T1070_006_timestomp
## =============================================================================
## 8. FAILED ACCESS (EACCES / EPERM only)
## Upstream also logs success=0 for users in /etc, /bin, /var, /home, /srv,
## which includes ENOENT (file not found) from shell completion and every
## PATH lookup. Those rules are dropped; the EACCES/EPERM rules below cover the
## real "tried to touch something they shouldn't" signal everywhere.
## =============================================================================
## Humans
-a always,exit -F arch=b64 -S openat -S openat2 -S open_by_handle_at -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=unset -k file_access
-a always,exit -F arch=b64 -S openat -S openat2 -S open_by_handle_at -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=unset -k file_access
-a always,exit -F arch=b64 -S open -S creat -F exit=-EACCES -F auid>=1000 -F auid!=unset -k file_access
-a always,exit -F arch=b64 -S open -S creat -F exit=-EPERM -F auid>=1000 -F auid!=unset -k file_access
## Daemons and service accounts (no login session), e.g. a webshell running
## as www-data probing /etc/shadow
-a always,exit -F arch=b64 -S openat -S openat2 -S open_by_handle_at -F exit=-EACCES -F auid=unset -k unauthedfileaccess_system
-a always,exit -F arch=b64 -S openat -S openat2 -S open_by_handle_at -F exit=-EPERM -F auid=unset -k unauthedfileaccess_system
-a always,exit -F arch=b64 -S open -F exit=-EACCES -F auid=unset -k unauthedfileaccess_system
-a always,exit -F arch=b64 -S open -F exit=-EPERM -F auid=unset -k unauthedfileaccess_system
## Failed creation / modification (anyone)
-a always,exit -F arch=b64 -S mkdirat -S linkat -S symlinkat -S mknodat -F exit=-EACCES -k file_creation
-a always,exit -F arch=b64 -S mkdirat -S linkat -S symlinkat -S mknodat -F exit=-EPERM -k file_creation
-a always,exit -F arch=b64 -S mkdir -S creat -S link -S symlink -S mknod -F exit=-EACCES -k file_creation
-a always,exit -F arch=b64 -S mkdir -S creat -S link -S symlink -S mknod -F exit=-EPERM -k file_creation
-a always,exit -F arch=b64 -S renameat -S renameat2 -S truncate -S fchmodat -S setxattr -S lsetxattr -S removexattr -S lremovexattr -F exit=-EACCES -k file_modification
-a always,exit -F arch=b64 -S renameat -S renameat2 -S truncate -S fchmodat -S setxattr -S lsetxattr -S removexattr -S lremovexattr -F exit=-EPERM -k file_modification
-a always,exit -F arch=b64 -S rename -S chmod -F exit=-EACCES -k file_modification
-a always,exit -F arch=b64 -S rename -S chmod -F exit=-EPERM -k file_modification
## =============================================================================
## 9. EXPLOITATION AND EVASION PRIMITIVES
## =============================================================================
-a always,exit -F arch=b64 -S ptrace -k tracing
## Fileless execution (memfd_create + fexecve).
## Note: runc calls this on every container start/exec.
-a always,exit -F arch=b64 -S memfd_create -F key=anon_file_create
## eBPF. Upstream logs every bpf() call, which floods on hosts running
## Tetragon, Falco, Cilium or systemd's BPF features (map lookups are bpf()
## calls too). Only BPF_PROG_LOAD (cmd 5) is kept: a new program in the kernel.
-a always,exit -F arch=b64 -S bpf -F a0=5 -k bpf
## Namespaces. Upstream logs all calls; containerd/runc and systemd
## (PrivateTmp, ProtectSystem, ...) do this constantly. Kept for
## human sessions only; pivot_root is rare enough to keep for everyone.
-a always,exit -F arch=b64 -S unshare -S setns -F auid>=1000 -F auid!=unset -k namespaces
-a always,exit -F arch=b64 -S pivot_root -k namespaces
-a always,exit -F arch=b64 -S process_vm_readv -S process_vm_writev -k process_vm
-a always,exit -F arch=b64 -S io_uring_setup -k io_uring
-a always,exit -F arch=b64 -S userfaultfd -k userfaultfd
## AF_ALG kernel crypto sockets (Copy Fail, CVE-2026-31431)
-a always,exit -F arch=b64 -S socket -F a0=38 -F success=1 -F auid>=1000 -F auid!=unset -k af_alg
-a always,exit -F arch=b64 -S bind -F a2=88 -F success=1 -F auid>=1000 -F auid!=unset -k af_alg
-a always,exit -F arch=b64 -S setsockopt -F a1=279 -F success=1 -F auid>=1000 -F auid!=unset -k af_alg
## Packet sniffing (AF_PACKET raw sockets) and BPF socket filters
-a always,exit -F arch=b64 -S socket -F a0=17 -F a1=3 -k raw_network_socket_created
-a always,exit -F arch=b64 -S setsockopt -F a1=1 -F a2=26 -k socket_bpf_filter_attached
## =============================================================================
## 10. NETWORK CONNECTIONS (human sessions only)
## Upstream logs every successful connect() and every socket() from every
## process. On a server that is every DNS lookup, every DB connection from
## PHP-FPM, every agent heartbeat. Scoped to login sessions here.
## For daemon network telemetry use Tetragon/Zeek/flow logs, not auditd.
## =============================================================================
-a always,exit -F arch=b64 -S connect -F a2=16 -F success=1 -F auid>=1000 -F auid!=unset -F key=network_connect_4
-a always,exit -F arch=b64 -S connect -F a2=28 -F success=1 -F auid>=1000 -F auid!=unset -F key=network_connect_6
## =============================================================================
## 11. PROCESS EXECUTION
## Specific keys first (first match wins), then the generic catch-all.
## =============================================================================
## setuid/setgid-root execution (sudo, su, pkexec, SUID exploits)
-a always,exit -F arch=b64 -S execve -S execveat -C uid!=euid -F euid=0 -k setuid_exec
## Web server account spawning processes (webshell indicator).
## Debian/Ubuntu www-data = 33, RHEL apache = 48, nginx varies: check with `id`.
## Note: this also matches php-fpm/apache restarts by systemd.
#-a always,exit -F arch=b64 -S execve -S execveat -F uid=33 -k webshell_exec
## Everything else
-a always,exit -F arch=b64 -S execve -S execveat -k process_creation
## =============================================================================
## 12. 32-BIT ABI (catch-all)
## A 64-bit server should not be making 32-bit syscalls. Upstream duplicates
## every rule for b32 and then also has this catch-all; the duplicates are
## dropped and this single rule covers all 32-bit activity.
## Comment out if you knowingly run 32-bit binaries.
## =============================================================================
-a always,exit -F arch=b32 -S all -k 32bit_abi
## =============================================================================
## 13. IMMUTABLE (enable only after tuning: rule changes then need a reboot)
## =============================================================================
#-e 2ΞXΤЯ3МΞ









