Detection Engineering on Linux: Tetragon, auditd and LAUREL on Ubuntu ARM64

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/vmlinux

Download 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.sh

It ends with Tetragon installed successfully!. Check the service:

sudo systemctl status tetragon

Files: 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 tetragon

Watching events

Raw JSON (what the SIEM reads):

sudo tail -f /var/log/tetragon/tetragon.log

One line per event with tetra:

sudo tetra --server-address "unix:///var/run/tetragon/tetragon.sock" getevents -o compact

Sample 1: ls -l

Testing ls -l in my home directory:

ls -l

Tetragon 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=auto comes from Ubuntu’s default ls alias 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 ran ls (execve).

All five:

LineEventPIDWhat happened
1exit303840 (bash)Short-lived prompt subshell finished
2exit303839 (bash)Its parent subshell finished
3exec303841 (ls)ls -l started
4exit303841 (ls)ls finished, about 5 ms later
5exit303842 (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.8

Tetragon 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 calls execve(). The command didn’t exist, so execve() 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.8

Tetragon 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.
  • uid and auid are both 1001. auid is the login UID. It’s set at login and doesn’t change with sudo.

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

FieldMeaning
exec_idUnique ID for this process. Unlike a PID, it’s never reused.
parent_exec_idThe parent’s exec_id. Follow these to rebuild a process tree reliably.
start_timeWhen the process started, with nanosecond precision
timeWhen the event was emitted
cwdWorking directory at exec time
uid / auidCurrent user / login user. auid survives sudo and su.
flagsexecve clone = a fork followed by an exec
in_init_treeWhether the process descends from a container’s init. false for host shells.
statusExit code. Omitted when 0. 127 = command not found.
node_nameHostname

exec_id is base64 of hostname:kernel-time:pid:

$ echo ZGVtbzozNzQ2NDU4Mzg1MTgyNDA6MzA0MzM5 | base64 -d
demo:374645838518240:304339

Part 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
inactive

So 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        # active

auditd.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 = 2

Changes:

SettingStockFinalWhy
log_formatENRICHEDRAWENRICHED adds name fields after a separator character some parsers choke on. LAUREL adds names anyway.
max_log_file8508 MB fills fast with exec logging
num_logs51010 × 50 MB = 500 MB of history
name_formatNONEHOSTNAMEAdds node=demo to every line
disk_error_actionSUSPENDSYSLOGDon’t stop auditing on one disk error
q_depth20008192Bigger 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 = 2

systemctl restart auditd is refused on Ubuntu and RHEL (the unit blocks manual stops). Use service:

sudo service auditd restart

Rules: 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:

KeyRules lostWhat you stop seeing
unauthedfileaccess8Users failing to open files in /etc, /bin, /var, /home, …
file_access, file_creation, file_modification6Permission-denied file operations
perm_mod2chmod/chown by users
unauthedfileaccess_system2Daemons denied access (e.g. a web shell probing /etc/shadow)
delete1File deletion by users
T1070_006_timestomp1Timestamp tampering
specialfiles1Device 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:

UpstreamTunedWhy
Every connect() and socket() from every processLogged-in users onlyUpstream logs every DNS lookup and every PHP-to-database connection
Watches /var/lib/dockerRemoved (only /etc/docker, /etc/containerd and the binaries)Logged every file write inside every container
Reads of /var/log/audit/ by anyoneHumans onlyUpstream loops with log shippers that read audit.log constantly
Every bpf() callOnly BPF_PROG_LOAD (new program loaded)eBPF agents like Tetragon make bpf() calls constantly
Every adjtimexLogged-in users onlychrony adjusts the clock this way all the time
Every unshare/setnsLogged-in users only (pivot_root still for everyone)runc and systemd services do this all the time
IPC syscalls (shmget, semget, …)RemovedDatabases 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 churnExcluded (the apt/dpkg command is still logged)Thousands of events per upgrade
sudo re-owning the terminalExcludedsudo-rs does it on every call (see below)
About 100 duplicated 32-bit rulesOne 32-bit catch-allAny 32-bit syscall on a 64-bit server is already suspicious
—Added setuid_execFlags 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 --load

Loading 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 0

All 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/ossec before 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/cat
  • 1001: 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” = auid and uid.
  • add_rule lines are from loading the rules, not user activity. They carry the same key.
  • --format text is 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/sudo

Raw 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_mod

My 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/sudo
root@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 WORKS

filetype=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=70696E67002D6331002D573200382E382E382E38

Lines 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.8

auditd 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_4

Same run as the second jq output in sample 3:

Tetragonauditd
pid / ppid308381 / 306182308381 / 306182
Exec time12:19:18.349 UTC12:19:18.349
Command-c1 8.8.8.8a0=ping a1=-c1 a2=8.8.8.8
Whoauid 1001auid=ubuntu uid=root
Where—cwd=/root, tty=pts3, ses=1378
Network—connect to 8.8.8.8 (network_connect_4)
Exit12: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/laurel2audit

The 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 directory

Create it:

sudo install -d -o _laurel -g _laurel -m 750 /var/log/laurel

Stock 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.toml

Packaged /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

SettingStockFinalWhy
size50000005242880050 MiB per file, matching auditd
statusreport-period086400Daily stats line in syslog
execve-argv["array"]["array", "string"]Adds ARGV_STR (full command as a string)
universalfalsetrueSyscall, arch and socket addresses as text
user-dbfalsetrueUser and group names
[label-process]Java/WebLogic/SSM examplesOnly software_mgmtRemoved 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-run validates the config. Key names differ between versions (0.7.3 uses user-db, not userdb).
  • 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 auditdLAUREL
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=0Both 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_PRELOAD and LD_LIBRARY_PATH if 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 -1

Part 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 *at syscalls fail silently. Load once without -i and read the errors.
  • Ubuntu 26.04 sudo and coreutils live under /usr/lib/cargo/bin/. Don’t hard-code /usr/bin/sudo in detections.
  • Don’t run augenrules --load right after service auditd restart.
  • proctitle is 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МΞ

Configure apache to log the real client IP instead of cloudflare IP in http access logs (WordPress)

If you are running a WordPress site and you have cloudflare setup, you may have noticed that the http access logs log the IP of cloudflare instead of the actual client IP. This is a guide to enable logging of the real client IP instead of the cloudflare IP in the apache2 logs. This was tested on a Ubuntu 20.04 machine + apache2 and traffic is proxied from cloudflare.

– Install Prerequisites:

sudo apt-get install apache2-dev libtool git

Git clone the mod_clouflare repo from cloulflare:

cd ~/
git clone https://github.com/cloudflare/mod_cloudflare.git
cd mod_cloudflare

Use the Apache extension tool to convert the .c file into a module:

apxs -a -i -c mod_cloudflare.c

Restart Apache:

sudo apachectl restart

Verify that the module is active:

apache2ctl -M|grep cloudflare

The output should show “cloudflare_module (shared)“

Now your apache logs should show the real client IP instead of the cloudflare IPs.

tail -f /var/log/apache2/access.log

-Below is screenshot of access log that shows the real client IP(right click and open image in new lab for high res image):

access.log screenshot

Sources/Credits/References:

Cloudflare
Noirth Security

How to search for IOCs on a Linux machine using Loki IOC and Yara scanner

This is a quick guide to running Loki APT Scanner to check for IOCs on a Linux machine.

Debian/Ubuntu:

– Run the below commands to setup Loki:

sudo su -
apt-get install libssl-dev -y
apt-get install python3.8-venv -y
git clone https://github.com/Neo23x0/Loki.git
cd Loki
python3 -m venv .
source bin/activate
pip install colorama yara-python psutil rfc5424-logging-handler netaddr
python3 loki-upgrader.py

– Run Loki Scanner as root to check for IOCs, you the below command:

 python3 loki.py

 

– You can also search for IOCs in a particular directory using -p flag . For example:

python3 loki.py -p /var/log/apache2/

 

RHEL/CentOS systems:

On CentOS based system, you can run the below to use find IOCs using APT:

sudo su -
yum install python3 python3-pip python3-devel openssl openssl-devel -y
pip install colorama yara-python psutil rfc5424-logging-handler netaddr
git clone https://github.com/Neo23x0/Loki.git
cd Loki
python3 loki-upgrader.py
python3 loki.py

Credits/Sources/References:
Neo23x0

Hope this helps! Happy Hunting Protectors! 🙂

ΞXΤЯ3МΞ

DFIR – Analyze Windows Event Logs (evtx) from a Linux machine using sigma rules, chainsaw and evtx dump

At work, I had a task to perform a quick compromise assessment for a hacked Windows server and I got a bunch of etvx files from the suspected host for analysis. I run Linux Mint + i3-gaps and its much easier and productive performing forensics from a Linux machine than Windows in my honest opinion. This post is meant for Linux users who want to perform Digital Forensics to find IOCs from Windows artifacts such as event logs / evtx files. Here my setup for forensics analsys for windows from a Linux perspective and the tools that I use.

Here are some tools that will come handy:

apt update && apt install git vim tar jq libxml2-utils source-highlight -y

Sigma Rules:

Get the latest sigma rules:

cd ~/
git clone https://github.com/SigmaHQ/sigma
git clone https://github.com/sbousseaden/EVTX-ATTACK-SAMPLES.git

Chainsaw:

– Install chainsaw:

wget https://github.com/WithSecureLabs/chainsaw/releases/download/v2.9.1-2/chainsaw_x86_64-unknown-linux-gnu.tar.gz -O ~/chainsaw.tar.gz
tar zxvf ~/chainsaw.tar.gz
chmod +x ~/chainsaw/chainsaw

Example: Assume that you have a bunch of evtx files that you want to analyze and you have it in a directory "~/EVTX-ATTACK-SAMPLES/", you can run chainsaw against the directory where the evtx files are stored with the below command:

./chainsaw/chainsaw hunt ~/EVTX-ATTACK-SAMPLES/ -s ~/sigma/ --mapping ~/chainsaw/mappings/sigma-event-logs-all.yml -r ~/sigma/rules

– The above will output the findings in stdout.

Now, let say you want to output these in csv for reporting or further analysis, you can run the below:

./chainsaw/chainsaw hunt ~/EVTX-ATTACK-SAMPLES/ -s ~/sigma/ --mapping ~/chainsaw/mappings/sigma-event-logs-all.yml -r ~/sigma/rules/ --csv --output csv-outputs

Alternatively, chainsaw also has the option to output in json file. This comes handy if you want to injest into a SIEM tool like Wazuh/Opensearch/ES/Spunk.

/chainsaw/chainsaw hunt ~/EVTX-ATTACK-SAMPLES/ -s ~/sigma/ --mapping ~/chainsaw/mappings/sigma-event-logs-all.yml -r ~/sigma/rules/ --json --output json-output

Chainsaw filters and advanced searching:

– Chainsaw has options to search for specific event ids. For example, to search for Login Failures (Windows Event ID = 4625), you use the below command:

./chainsaw search -t 'Event.System.EventID: =4625' windows-log.evtx

– To search for specific strings such as to search for lssas dumps:

./chainsaw search -e "lsass" -i windows-log.evtx

– You can also search an entire directory of evtx files as well:

./chainsaw search -e "lsass" -i  ~/EVTX-ATTACK-SAMPLES/

– To search for events between two timeframes:

./chainsaw/chainsaw hunt ~/EVTX-ATTACK-SAMPLES/ -s ~/sigma/ --mapping ~/chainsaw/mappings/sigma-event-logs-all.yml -r ~/sigma/rules/ --from "2021-11-01T07:01:00" --to "2022-01-01T07:01:00"

– Below is screenshot for reference. (Right click image and open in new tab for better visual)

Evtx Dump:

If you like to dump all the events in a Windows event file for further analysis, there is an awesome opensource tool that allows you to just do that.

wget https://github.com/omerbenamram/evtx/releases/download/v0.8.2/evtx_dump-v0.8.2-x86_64-unknown-linux-gnu -O ~/evtx_dump
chmod +x ~/evtx_dump

–  To use the dump (Events will be separated with string “Event <count>” in the output file). This is handy when using vim/less by searching for “^Event ” and then using “n” to go the next event.

./evtx_dump-v0.8.2-x86_64-unknown-linux-gnu \
EVTX-ATTACK-SAMPLES/Discovery/4799_remote_local_groups_enumeration.evtx -f 4799_remote_local_groups_enumeration.parsed.xml


- Another method is to print to stdout and redirect to file:

./evtx_dump-v0.8.2-x86_64-unknown-linux-gnu \
EVTX-ATTACK-SAMPLES/Discovery/4799_remote_local_groups_enumeration.evtx > 4799_remote_local_groups_enumeration.parsed.xml
  • To generate the dump without the event separators in xml format:
./evtx_dump-v0.8.2-x86_64-unknown-linux-gnu \
--dont-show-record-number \
EVTX-ATTACK-SAMPLES/Discovery/4799_remote_local_groups_enumeration.evtx  -f 4799_remote_local_groups_enumeration.parsed.xml
– With this xml format, you can open this inside vim or use source-highlight to make it more readable.
cat 4799_remote_local_groups_enumeration.parsed.xml | xmllint --format - | source-highlight -s xml -f esc | less -R
  • To generate in json format:
./evtx_dump-v0.8.2-x86_64-unknown-linux-gnu \
EVTX-ATTACK-SAMPLES/Discovery/4799_remote_local_groups_enumeration.evtx -o json -f 4799_remote_local_groups_enumeration.parsed.json

./evtx_dump-v0.8.2-x86_64-unknown-linux-gnu \
--dont-show-record-number \
EVTX-ATTACK-SAMPLES/Discovery/4799_remote_local_groups_enumeration.evtx -o json -f 4799_remote_local_groups_enumeration.parsed.json

- For jsonl format, you the below:

./evtx_dump-v0.8.2-x86_64-unknown-linux-gnu \
EVTX-ATTACK-SAMPLES/Discovery/4799_remote_local_groups_enumeration.evtx -o jsonl -f 4799_remote_local_groups_enumeration.parsed.json
  • Here is CLI usage:
./evtx_dump-v0.8.2-x86_64-unknown-linux-gnu -h

Credits/References:

Chainsaw github
EVTX-ATTACK-SAMPLES
izzyboop

Hope this helps. Happy Hunting Defenders! 🙂

ΞXΤЯ3МΞ

Increase OS Disk Size of an Azure Linux VM

If you try to expand the disk without stopping/de-allocating the VM, depending on disk config it may not allow your to change the size and a banner with message “Changes to the disk size can be made only when the disk is unattached or the managing virtual machine(s) are deallocated.” would be displayed. To increase the disk size of a Linux VM, you can perform the following:

In my environment, the VM OS disk size was smaller than 4TB and could not be resized using the online method that could be done without downtime(it requires some special configuration which I didnt really get deep into). This method will involve shutting down the VM, de-allocating the VM, increasing the disk and then bringing the disk back online. So, there would be some downtime.
Another thing:

Note: Replace text in blue with your environment specific values.

1. Stop the VM:

az vm stop –resource-group Resource-Group-Name –name VM-NAME –subscription SUBSCRIPTION-ID

2. De-allocate the VM: (This may take a few minutes)

az vm deallocate –resource-group Resource-Group-Name –name VM-NAME –subscription SUBSCRIPTION-ID

3. Increase the Disk (from the UI):

-Navigate to the VM in Azure. Click on “Disks”

 

-Select the disk that you need to resize.

 

Click on “Size + performance” and select the disk size to which you want to increase to and then click on “Save”

4. Start the VM:

az vm start –resource-group Resource-Group-Name –name VM-NAME –subscription SUBSCRIPTION-ID

My Azure VM was based on Ubuntu 20.04.x and did not need additional changes in the OS. After the VM booted backup, it did automatically expand to the new allocated size.

Some of my thoughts on Azure Naming and resizing:
For some wierd reason, Azure does not make things easy for resizing disks. Ideally, you should be able to shutdown the VM and increase the disk, BUT Azure needs you to de-allocate the VM before you can make any changes to the disk. Another strange thing Azure decided to do is to label “de-allocate VM” instead of some sane label as at first it sound as if going to delete the VM and all its data when when in reality it does not.

Sources/References:
https://learn.microsoft.com/en-us/azure/virtual-machines/linux/expand-disks?tabs=ubuntu

If you have any queries/feedback regarding this, feel free to leave a comment below and will get back to you as soon as I can.

Install MacOS Ventura on Proxmox 8.x

This is a guide on how to configure and install MacOS Ventura on Promox 8.x.x. (This was tested in my lab which runs Proxmox 8.0.3 and 8.0.4. It should work for other versions as well)

Requirements:

  1. Proxmox 8.x.x
  2. Opencore ISO [ Link: https://github.com/thenickdude/KVM-Opencore/releases . https://github.com/thenickdude/KVM-Opencore/releases/tag/v20]
  3. MacOS Ventura ISO (You can get this from archive.org)
  4. Root access to Proxmox to edit config

Steps to configure:

Download the OpenCore-v20.iso.gz  from KVM-Opencore and extract it. [Link: https://github.com/thenickdude/KVM-Opencore/releases/tag/v20 ].

Create a VM in Proxmox with the below settings:

  • Select ISO Image as Opencore iso
  • Set Guest OS type to “Other”
  • Set Graphics card as “Vmware compatible”, Machine type “q35“
  • Set BIOS to OMVF UEFI, add EFI Disk and select disk. Un-select Pre-enroll keys. Select SCSI Controller to “VirtIO SCSI”
  • Set hard disk as “VirtIO Block” , size = 64GB, cache = Write back unsafe
  • CPU: Set 1 Socket, 4 Cores, Type as “Host”
  • 4GB Min RAM
  • Set NIC to Vmware vmxnet3
  • Then add second cd, select Bus/Device as defaults(IDE) and add MAC OS ISO.
  • Change boot order so that opencore is first and then second is macos

Minor Changes needed for it to work:

  • SSH into the Proxmox host and edit the VM config: (the VM ID = 100 for my newly created VM. It may be different in yours)

/vim /etc/pve/qemu-server/100.conf

  • If your Proxmox server is running on an Intel CPU, then below line in top of the file:


args: -device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" -smbios type=2 -device usb-kbd,bus=ehci.0,port=2 -global nec-usb-xhci.msi=off -global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off -cpu host,vendor=GenuineIntel,+invtsc,+hypervisor,kvm=on,vmware-cpuid-freq=on

  • If your Proxmox host is running on an AMD CPU, use the below line instead:


args: -device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" -smbios type=2 -device usb-kbd,bus=ehci.0,port=2 -global nec-usb-xhci.msi=off -global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off -cpu Haswell-noTSX,vendor=GenuineIntel,+invtsc,+hypervisor,kvm=on,vmware-cpuid-freq=on

Now, change the media=cdrom to cache=unsafe. Here is a sed command to do so:


sed -i 's/media=cdrom/cache=unsafe/g' /etc/pve/qemu-server/100.conf

Below is my config for reference (/etc/pve/qemu-server/100.conf):


args: -device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" -smbios type=2 -device usb-kbd,bus=ehci.0,port=2 -global nec-usb-xhci.msi=off -global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off -cpu host,vendor=GenuineIntel,+invtsc,+hypervisor,kvm=on,vmware-cpuid-freq=on
balloon: 0
bios: ovmf
boot: order=ide2;ide0;virtio0;net0
cores: 4
cpu: host
efidisk0: local-lvm:vm-100-disk-0,efitype=4m,size=4M
ide0: local:iso/macOS Ventura 13.0.1.iso,cache=unsafe,size=13073658K
ide2: local:iso/OpenCore-v20.iso,cache=unsafe,size=150M
machine: q35
memory: 8096
meta: creation-qemu=8.0.2,ctime=1690969304
name: MAC-OS
net0: vmxnet3=D6:41:D1:8F:B5:49,bridge=vmbr0,firewall=1
numa: 0
ostype: other
scsihw: virtio-scsi-pci
smbios1: uuid=57a6ce4a-a710-483a-8577-28c1feae47d4
sockets: 1
vga: vmware
virtio0: local-lvm:vm-100-disk-1,cache=unsafe,iothread=1,size=64G
vmgenid: a9dee6c6-376d-48b9-bc20-3c586856ffb4

Here is a screenshot for reference of the settings page in Proxmox for the MacOS VM:

 

Proxmox MacOS Ventura Settings

– Here is a screenshot of the boot order settings:

– Now Boot the MacOS VM, and select UEFI boot when prompted.
– At boot prompt, run the below:


System\Library\CoreServices\Boot.efi

Installation:

– Open Disk Utility
– Click “View” => Show All Devices.
– Select the First option that shows 64GB disk and click on “Erase”. Once done, close disk utility and click option to start installer.
– Select the disk and continue the install on it

The rest of the installation is pretty straightforward. It did take a very long time for the install to complete along with a few restarts. But, at the end you should be able to boot into the Proxmox VM.

-Here is a screenshot of my VM post install.

MacOS VM login screen after installaton

 

Hope this helps! Cheers

Credits/References:
https://github.com/thenickdude/KVM-Opencore/releases/tag/v20
https://i12bretro.github.io/tutorials/0775.html

Enable promiscuous mode in VMware Workstation

Below are the steps to enable promiscuous mode for a VM in Vmware Workstation.

Shutdown the VM and edit the .vmx file. This is in the directory where your VM’s hard disks were configured to be sure.

vim /home/extr3me/vmware/pfsense/pfsense.vmx

Tip:
You can right click on the VM and select option “Open VM Directory” that will take you to the directory where the .vmx file is located.

Add the below line to the file:

ethernet0.noPromisc = "FALSE"

-If you have multiple interfaces, then add another line and replace the value 0 with 1 etc. Below is an example for two interfaces:

ethernet0.noPromisc = "FALSE"
ethernet1.noPromisc = "FALSE"

Source/Credits/Reference:

https://superuser.com/questions/1209497/how-do-you-enable-promiscuous-mode-in-vmware-workstation#1270695

‎ | LINUX | Tech | Security |