Wazuh manager service sandbox
The wazuh-manager systemd unit confines every Wazuh manager daemon it starts. The sandbox limits the files and resources a compromised daemon can access or modify on the host. No daemon runs in a chroot. Each daemon starts as root, then drops privileges to the wazuh-manager user. It retains / as its root directory and uses /var/wazuh-manager as its working directory.
The package installs the unit at /usr/lib/systemd/system/wazuh-manager.service. These protections apply only when you start the Wazuh manager through this unit, for example, with systemctl start wazuh-manager.
Writable directories
The unit makes operating system directories read-only while keeping the two Wazuh manager directories writable.
The daemons write data and configuration files to these directories:
/var/wazuh-manager, the installation directory./etc/wazuh-manager, the configuration directory.
The unit mounts /usr, /boot, /efi, and the rest of /etc as read-only. Attempts to write to these locations fail with a read-only file system error (EROFS). The unit also hides /home, /root, and /run/user.
Other directories, such as /var and /opt, retain their normal file permissions. The daemons access them as the unprivileged wazuh-manager user.
When the Wazuh indexer runs on the same endpoint, the credential resolver (wazuh-manager-resolve-credentials) reads files from /etc/wazuh-indexer/export/. However, it cannot write to this directory.
Protections
Each unit setting removes access that Wazuh manager daemons do not need. Together, these settings limit the actions a compromised daemon can perform on the host.
Setting |
Effect |
|---|---|
|
Mounts |
|
Keeps |
|
Gives the daemons their own |
|
Hides |
|
Prevent changes to kernel settings, loading kernel modules, and reading the kernel log. |
|
Makes the control group hierarchy read-only. |
|
Prevent changes to the system clock and the host name. |
|
Prevent changes to the execution domain, the use of realtime scheduling, and access to namespaces. |
|
Limits the root phase of the start, and
|
|
Allows only system calls of the host's native architecture. |
|
Allows only the system calls of a typical service. A call outside this
set returns |
The unit does not enable NoNewPrivileges because the Wazuh manager API uses wazuh-manager-service-control, a setuid-root program, to restart and reload the Wazuh manager.
Effects on your deployment
The sandbox determines where you can install the Wazuh manager, where its daemons can write files, and how long startup can take.
Installation directory: A Wazuh manager installed under
/home,/root,/run/user,/tmp, or/var/tmpcannot run under the unit. Install it in a directory accessible to the unit, such as the default/var/wazuh-manager.Files outside writable directories: The Wazuh manager cannot write to
/usr,/boot,/efi, or the rest of/etc. Keep files that the Wazuh manager needs to modify, such as configuration files, certificates, and logs, in/var/wazuh-manageror/etc/wazuh-manager.Temporary files: Files that daemons write to
/tmpor/var/tmpare not visible in the host's corresponding directories. Thewazuh-manager-dbdaemon stores its SQLite temporary files in/var/wazuh-manager/tmp.Startup time: Startup can take up to approximately 130 seconds while
wazuh-manager-controlwaits for the Wazuh normalization engine to become ready. The unit allows up to 180 seconds (TimeoutStartSec=180) before reporting a timeout.