Wazuh Client Installation - Pi Ubuntu Server

Raspberry Pis use an ARM CPU architecture. Because of this, the installation process differs slightly for agent installation compared to AMD64-based systems. In this example, Ubuntu Server is running on a Raspberry Pi 4B. However, these steps will be similar across most Raspberry Pi Debian distributions.


Raspberry Pi Steps

Agent Installation

Update your system:

Terminal
sudo apt update && sudo apt upgrade -y

Install the required packages:

Terminal
sudo apt install curl apt-transport-https gnupg -y

Import the repository key:

Terminal
curl -s https://packages.wazuh.com/key/GPG-KEY-WAZUH | \
sudo gpg --dearmor -o /usr/share/keyrings/wazuh.gpg

Add the repository:

Terminal
echo "deb [signed-by=/usr/share/keyrings/wazuh.gpg] https://packages.wazuh.com/4.x/apt/ stable main" | \
sudo tee /etc/apt/sources.list.d/wazuh.list

Update the package list:

Terminal
sudo apt update

Install the agent. Replace "your-wazuh-ip" with the IP address of your Wazuh server:

Terminal
WAZUH_MANAGER="your-wazuh-ip" sudo apt install wazuh-agent -y

Ensure the Wazuh server IP address is set in the configuration file:

Terminal
sudo nano /var/ossec/etc/ossec.conf

Check the section below to ensure your server IP address is listed:

<ossec_config>
  <client>
    <server>
      <address>your-wazuh-ip</address>
      <port>1514</port>
      <protocol>tcp</protocol>

Press CTRL+O to save the file, then press CTRL+X to close.

Refresh the system daemon manager:

Terminal
sudo systemctl daemon-reload

Enable the agent:

Terminal
sudo systemctl enable wazuh-agent

Start the agent:

Terminal
sudo systemctl start wazuh-agent

Confirm the agent is active and running:

Terminal
sudo systemctl status wazuh-agent

Sending Logs

Open the Wazuh configuration file:

Terminal
sudo nano /var/ossec/etc/ossec.conf

Locate the Log Analysis block.

To add SSH logs, add the following:

<localfile>
 <log_format>syslog</log_format>
 <location>/var/log/auth.log</location>
</localfile>

The steps below are only relevant if you followed the Linux Hardening (Ubuntu) guide.

To add Fail2Ban logs, add the following:

<localfile>
  <log_format>syslog</log_format>
  <location>/var/log/fail2ban.log</location>
</localfile>

To add RKHunter logs, add the following:

<localfile>
 <log_format>syslog</log_format>
 <location>/var/log/rkhunter.log</location>
</localfile>

To add ClamAV logs, add the following:

<localfile>
 <log_format>syslog</log_format>
 <location>/var/log/clamav/clamav.log</location>
</localfile>
<localfile>
 <log_format>syslog</log_format>
 <location>/var/log/clamav/freshclam.log</location>
</localfile>

To add Lynis logs, add the following:

<localfile>
  <log_format>syslog</log_format>
  <location>/var/log/lynis.log</location>
</localfile>

Press CTRL+O to save the file, then press CTRL+X to close.

Restart the agent:

Terminal
sudo systemctl restart wazuh-agent

Wazuh Manager Steps

Confirm agent communication:

Log in to the Wazuh Dashboard.

Click on the hamburger menu.

Expand "Agents management."

Tap on "Summary."

You should now see your new agent listed.


Loading...