Advanced
Searching inInstall guides
How to search
  • Paste an error message in quotes, e.g. "permission denied", to find the fix table that explains it.
  • Choose an area and a part of the guide (install, first settings, daily use, security, fixes) to go straight to the right step.
  • "two words" finds the exact phrase.
  • Plain words find names, texts and examples.
  • ↑ ↓ to move · Enter to open · Esc to close · / to search
Try:

Guide 70Wazuh · Security

Install and set up Wazuh (open-source SIEM and XDR)

Wazuh is a free, open-source SIEM and XDR platform: agents on your servers and laptops collect security logs, check file integrity, find vulnerable packages, test the configuration against CIS benchmarks, and can block attackers automatically; the server analyses everything with thousands of rules mapped to MITRE ATT&CK and shows it in a dashboard. This guide installs Wazuh all-in-one on one server, adds Linux agents, turns on the most useful modules, and covers tuning, retention and fixes.

  • 9 Lessons
  • 13 Commands

$ run as a normal user# run as root (or with sudo)

70.1

Know it before you install

Three central parts — the indexer (stores alerts, based on OpenSearch), the server/manager (receives agent data, decodes and matches rules, makes alerts) and the dashboard (web UI). Agents run on every monitored host. Rules have levels 0–15; higher = more serious.

ItemValue
Installthe wazuh-install.sh assistant (all-in-one or distributed)
Agent packagewazuh-agent (Linux, Windows, macOS)
Config (manager and agent)/var/ossec/etc/ossec.conf
Local rules/var/ossec/etc/rules/local_rules.xml, decoders in /var/ossec/etc/decoders/
Agent groups/var/ossec/etc/shared/<group>/agent.conf
Ports1514/tcp (agent data), 1515/tcp (enrollment), 55000/tcp (API), 9200/tcp (indexer), 443/tcp (dashboard)
Size (all-in-one)4 vCPU, 8 GB RAM, 50+ GB disk for a small lab (more with many agents and long retention)

70.2

Install the central components (RHEL and Ubuntu)

Use the assistant for your Wazuh version (the path contains the version, here 4.13 — take the current one from the Wazuh docs):

curl -sO https://packages.wazuh.com/4.13/wazuh-install.sh
less wazuh-install.sh
bash ./wazuh-install.sh -a
INFO: --- Summary ---
INFO: You can access the web interface https://<wazuh-dashboard-ip>:443
    User: admin
    Password: 9Xq…
INFO: Installation finished.
tar -O -xvf wazuh-install-files.tar wazuh-install-files/wazuh-passwords.txt

-a installs indexer, server and dashboard on this host with self-signed certificates. Save the passwords from the output (and the wazuh-install-files.tar) in your password manager.

Open the firewall:

firewall-cmd --permanent --add-port={443,1514,1515}/tcp
firewall-cmd --reload

Open https://SERVER and log in as admin. Change the default passwords with the password tool (wazuh-passwords-tool.sh) if you did not save them.

70.3

Add Linux agents

On each host, from the Wazuh repository, with the manager address set at install time:

rpm --import https://packages.wazuh.com/key/GPG-KEY-WAZUH
printf '[wazuh]\nname=Wazuh repository\nbaseurl=https://packages.wazuh.com/4.x/yum/\ngpgcheck=1\ngpgkey=https://packages.wazuh.com/key/GPG-KEY-WAZUH\nenabled=1\n' > /etc/yum.repos.d/wazuh.repo
WAZUH_MANAGER="10.0.0.5" WAZUH_AGENT_GROUP="linux-servers" dnf -y install wazuh-agent
systemctl daemon-reload
systemctl enable --now wazuh-agent

On Ubuntu:

curl -fsSL https://packages.wazuh.com/key/GPG-KEY-WAZUH | gpg --dearmor -o /usr/share/keyrings/wazuh.gpg
echo "deb [signed-by=/usr/share/keyrings/wazuh.gpg] https://packages.wazuh.com/4.x/apt/ stable main" > /etc/apt/sources.list.d/wazuh.list
apt-get update
WAZUH_MANAGER="10.0.0.5" WAZUH_AGENT_GROUP="linux-servers" apt-get install -y wazuh-agent
systemctl enable --now wazuh-agent

(The dashboard's Deploy new agent page shows the same commands for every OS.) The agent version must be the same as or older than the manager. Check on the manager:

/var/ossec/bin/agent_control -l
ID: 001, Name: web1, IP: any, Active

70.4

First configuration: the modules that matter

Configure all Linux agents at once in the group file (pushed by the manager):

/var/ossec/etc/shared/linux-servers/agent.conf
<agent_config>
  <syscheck>
    <frequency>43200</frequency>
    <directories realtime="yes" check_all="yes">/etc,/usr/bin,/usr/sbin</directories>
    <directories check_all="yes" report_changes="yes">/var/www</directories>
    <ignore>/etc/mtab</ignore>
  </syscheck>
  <localfile>
    <log_format>journald</log_format>
    <location>journald</location>
  </localfile>
  <localfile>
    <log_format>apache</log_format>
    <location>/var/log/nginx/access.log</location>
  </localfile>
  <sca>
    <enabled>yes</enabled>
    <scan_on_start>yes</scan_on_start>
    <interval>12h</interval>
  </sca>
</agent_config>
ModuleWhat it gives you
syscheck (FIM)Alerts when files in /etc, binaries or the web root change (real time for key folders).
localfileWhich logs to read: journald, Nginx, auth logs, app logs.
scaCIS benchmark checks per OS with a score and fixes.
Vulnerability detectionMatches installed packages against CVE feeds (on by default in the manager).

Active response — block an IP on the host for 10 minutes when an SSH brute force rule (5763) fires; on the manager:

/var/ossec/etc/ossec.conf (manager, inside <ossec_config>)
<active-response>
  <command>firewall-drop</command>
  <location>local</location>
  <rules_id>5763</rules_id>
  <timeout>600</timeout>
</active-response>
/var/ossec/bin/wazuh-control restart

A local rule for your own app, and how to test rules:

/var/ossec/etc/rules/local_rules.xml
<group name="local,shop,">
  <rule id="100100" level="10">
    <if_sid>5716</if_sid>
    <srcip>!10.0.0.0/8</srcip>
    <description>SSH login failure from outside the company network</description>
    <mitre><id>T1110</id></mitre>
  </rule>
</group>
/var/ossec/bin/wazuh-logtest

wazuh-logtest reads a log line you paste and shows which decoder and rule match.

70.5

Daily use: the commands and the real uses

/var/ossec/bin/agent_control -l
/var/ossec/bin/manage_agents -l
/var/ossec/bin/agent_groups -l
tail -f /var/ossec/logs/alerts/alerts.json | jq -r '.rule.level, .rule.description'
tail -f /var/ossec/logs/ossec.log
systemctl status wazuh-manager wazuh-indexer wazuh-dashboard
curl -k -u wazuh-wui:PASSWORD -X POST "https://localhost:55000/security/user/authenticate?raw=true"

In the dashboard: Threat hunting (all alerts), File integrity monitoring, Vulnerability detection, Configuration assessment (CIS), MITRE ATT&CK view, and compliance dashboards (PCI DSS, GDPR, NIST).

Real uses at work:

  • A free SIEM for small and medium companies: central security logs and alerts.
  • File integrity and CIS hardening evidence for audits.
  • Vulnerability overview of all servers and laptops; automatic blocks of brute force.

70.6

Make it safe

Security checklist:

  • Change all default passwords; keep wazuh-install-files.tar secret.
  • Replace the self-signed certificates with your own CA for production.
  • Dashboard (443) only from admin networks/VPN; 1514/1515 only from agent networks.
  • Agent enrollment with a password (authd password) so unknown hosts can not enroll.
  • Retention policy on the indexer (ISM) so the disk does not fill; snapshot backups.
  • Keep manager, indexer, dashboard and agents updated (manager first, then agents).

70.7

Update and remove

Upgrade the central components first (indexer, server, dashboard — follow the Wazuh upgrade guide for your version), then the agents:

dnf -y upgrade wazuh-agent
apt-get install --only-upgrade -y wazuh-agent
dnf -y remove wazuh-agent
bash ./wazuh-install.sh -u

wazuh-install.sh -u uninstalls the central components installed by the assistant.

70.8

Fix common problems

ProblemCauseFix
Agent Never connected / DisconnectedFirewall to 1514/1515, wrong manager IP.tail /var/ossec/logs/ossec.log on the agent; open ports; check <address> in the agent ossec.conf.
Agent version must be lower or equal to manager versionThe agent is newer than the manager.Upgrade the manager first, or install the matching agent version.
Dashboard: "Wazuh dashboard server is not ready yet"The indexer is down or out of memory.systemctl status wazuh-indexer; check RAM and its log.
Disk full on the indexerNo retention.Add an ISM policy to delete old wazuh-alerts-* indices; more disk.
A rule never firesThe decoder does not match your log format.Test with wazuh-logtest; write a decoder.
Too many low-level alertsDefault rules for your environment.Tune in local_rules.xml (lower levels, exceptions); alert on level 10+.

70.9

Next steps

1Which tool shows which decoder and rule match a log line?

/var/ossec/bin/wazuh-logtest.

2Where do you configure all Linux agents at once?

In the group file /var/ossec/etc/shared/<group>/agent.conf on the manager.

All commands in this chapter