<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Wazuh Archives - Hécate Regnier - Neurozone</title>
	<atom:link href="https://hecate.neurozone.fr/tag/wazuh/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>DBA, DevOps &#38; Sysadmin</description>
	<lastBuildDate>Mon, 02 Nov 2026 17:00:30 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.5</generator>

<image>
	<url>https://hecate.neurozone.fr/wp-content/uploads/2026/10/cropped-avatar_Instagram-150x150.webp</url>
	<title>Wazuh Archives - Hécate Regnier - Neurozone</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">258172890</site>	<item>
		<title>How-to: install a Wazuh agent and get something out of it</title>
		<link>https://hecate.neurozone.fr/2026/11/25/how-to-install-a-wazuh-agent-and-get-something-out-of-it/</link>
					<comments>https://hecate.neurozone.fr/2026/11/25/how-to-install-a-wazuh-agent-and-get-something-out-of-it/#respond</comments>
		
		<dc:creator><![CDATA[Hécate Regnier]]></dc:creator>
		<pubDate>Wed, 25 Nov 2026 09:00:00 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Sysadmin notebook]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[Rocky Linux]]></category>
		<category><![CDATA[sécurité]]></category>
		<category><![CDATA[SIEM]]></category>
		<category><![CDATA[Wazuh]]></category>
		<guid isPermaLink="false">https://hecate.neurozone.fr/?p=624</guid>

					<description><![CDATA[<p>Install a Wazuh agent on Rocky Linux, check the connection, then enable file integrity, SCA, vulnerability detection and your own custom rules.</p>
<p>The post <a href="https://hecate.neurozone.fr/2026/11/25/how-to-install-a-wazuh-agent-and-get-something-out-of-it/">How-to: install a Wazuh agent and get something out of it</a> appeared first on <a href="https://hecate.neurozone.fr">Hécate Regnier - Neurozone</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Wazuh is an open-source security monitoring platform: a central manager collects and analyses, agents installed on each machine send logs and observations. A single Wazuh agent does the work of several tools once installed separately: log collection, file integrity monitoring (the job of AIDE or Tripwire), configuration audit (Lynis&#8217;s), package vulnerability detection (Trivy&#8217;s for the system), rootkit hunting.</p>



<p class="wp-block-paragraph">This tutorial assumes a Wazuh 4.x manager is already running. It installs an agent on a Rocky Linux server, enrols it properly, makes it watch what really matters, and shows how to write your first rules: one to silence known noise, one to raise an alert that matters. The goal isn&#8217;t thousands of alerts, but few, and meaningful.</p>



<figure class="wp-block-image size-full"><a href="https://hecate.neurozone.fr/wp-content/uploads/2026/11/how-to-install-a-wazuh-agent-and-get-something-out-of-it_diagram_en.webp"><img fetchpriority="high" decoding="async" width="1720" height="900" src="https://hecate.neurozone.fr/wp-content/uploads/2026/11/how-to-install-a-wazuh-agent-and-get-something-out-of-it_diagram_en.webp" alt="Diagram of a Wazuh agent talking to the manager on ports 1515 and 1514, with watching, rules and upgrade order" class="wp-image-3163" srcset="https://hecate.neurozone.fr/wp-content/uploads/2026/11/how-to-install-a-wazuh-agent-and-get-something-out-of-it_diagram_en.webp 1720w, https://hecate.neurozone.fr/wp-content/uploads/2026/11/how-to-install-a-wazuh-agent-and-get-something-out-of-it_diagram_en-300x157.webp 300w, https://hecate.neurozone.fr/wp-content/uploads/2026/11/how-to-install-a-wazuh-agent-and-get-something-out-of-it_diagram_en-1024x536.webp 1024w, https://hecate.neurozone.fr/wp-content/uploads/2026/11/how-to-install-a-wazuh-agent-and-get-something-out-of-it_diagram_en-768x402.webp 768w, https://hecate.neurozone.fr/wp-content/uploads/2026/11/how-to-install-a-wazuh-agent-and-get-something-out-of-it_diagram_en-1536x804.webp 1536w" sizes="(max-width: 800px) 100vw, 760px" /></a><figcaption class="wp-element-caption">What the agent sends, what the manager does with it, and how to tune it.</figcaption></figure>



<h2 class="wp-block-heading">What a Wazuh agent does</h2>



<figure class="wp-block-table"><table><thead><tr><th>Module</th><th>What it does</th><th>Tuning needed</th></tr></thead><tbody><tr><td>log collection</td><td>sends logs to the manager, which decodes them and applies its rules</td><td>add your application logs</td></tr><tr><td>file integrity (syscheck)</td><td>detects file creations, changes, deletions</td><td>pick directories, enable real time</td></tr><tr><td>SCA</td><td>checks configuration against the distribution&#8217;s CIS benchmark</td><td>none</td></tr><tr><td>inventory (syscollector)</td><td>lists packages, ports, processes, interfaces</td><td>none</td></tr><tr><td>vulnerabilities</td><td>the manager matches the inventory against CVE databases</td><td>none on the agent side</td></tr><tr><td>rootcheck</td><td>looks for known rootkit signs and anomalies</td><td>none</td></tr></tbody></table></figure>



<h2 class="wp-block-heading">Step 1: on the manager, getting ready</h2>



<p class="wp-block-paragraph">The agent talks to the manager on two TCP ports: <strong>1514</strong> for events (encrypted with a key unique to each agent) and <strong>1515</strong> for enrolment, where the agent obtains that key. Open them only to your machines&#8217; addresses:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell">firewall-cmd --permanent --new-zone=wazuh-agents
firewall-cmd --permanent --zone=wazuh-agents --add-source=203.0.113.25/32
firewall-cmd --permanent --zone=wazuh-agents --add-source=203.0.113.40/32
firewall-cmd --permanent --zone=wazuh-agents --add-port=1514/tcp --add-port=1515/tcp
firewall-cmd --reload</pre>



<p class="wp-block-paragraph">Without an enrolment password, anyone who can reach port 1515 can register a fake agent and send fake events. Turn it on:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="xml">&lt;!-- /var/ossec/etc/ossec.conf on the manager --&gt;
&lt;auth&gt;
  &lt;disabled&gt;no&lt;/disabled&gt;
  &lt;port&gt;1515&lt;/port&gt;
  &lt;use_password&gt;yes&lt;/use_password&gt;
  &lt;ssl_verify_host&gt;no&lt;/ssl_verify_host&gt;
  &lt;purge&gt;yes&lt;/purge&gt;
&lt;/auth&gt;</pre>



<pre class="EnlighterJSRAW" data-enlighter-language="shell">openssl rand -base64 24 &gt; /var/ossec/etc/authd.pass
chmod 640 /var/ossec/etc/authd.pass &amp;&amp; chown root:wazuh /var/ossec/etc/authd.pass
systemctl restart wazuh-manager</pre>



<p class="wp-block-paragraph"><code>purge</code> lets a reinstalled machine re-enrol under the same name: the old entry is replaced instead of being refused as a duplicate.</p>



<h2 class="wp-block-heading">Step 2: install the Wazuh agent, in the right version</h2>



<p class="wp-block-paragraph">Absolute rule: <strong>the agent&#8217;s version must never exceed the manager&#8217;s</strong>. A newer agent is refused at connection, with an unhelpful message. Always upgrade the manager first, then the agents, and install a specific version rather than &#8220;the latest&#8221;:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="ini"># /etc/yum.repos.d/wazuh.repo
[wazuh]
name=Wazuh
baseurl=https://packages.wazuh.com/4.x/yum/
gpgcheck=1
gpgkey=https://packages.wazuh.com/key/GPG-KEY-WAZUH
enabled=1</pre>



<pre class="EnlighterJSRAW" data-enlighter-language="shell">rpm --import https://packages.wazuh.com/key/GPG-KEY-WAZUH
WAZUH_MANAGER=&#x27;wazuh.example.org&#x27; \
WAZUH_REGISTRATION_PASSWORD=&#x27;&lt;enrolment password&gt;&#x27; \
WAZUH_AGENT_NAME=&#x27;web1.example.org&#x27; \
  dnf install wazuh-agent-4.14.9
systemctl daemon-reload
systemctl enable --now wazuh-agent</pre>



<p class="wp-block-paragraph">The package reads these environment variables during install, writes the manager&#8217;s address into <code>ossec.conf</code>, puts the password in <code>authd.pass</code> and enrols at first start. To keep a general <code>dnf update</code> from moving the agent ahead of the manager, exclude it from automatic updates (<code>exclude=wazuh-agent</code> in the repository file, or the <code>versionlock</code> plugin) and upgrade it deliberately, after the manager.</p>



<h2 class="wp-block-heading">Step 3: check the Wazuh agent connection</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="shell">grep ^status /var/ossec/var/run/wazuh-agentd.state      # status=&#x27;connected&#x27;
tail -n 20 /var/ossec/logs/ossec.log
# on the manager:
/var/ossec/bin/agent_control -l                        # the agent is &quot;Active&quot;
/var/ossec/bin/agent_control -i 007                    # details: version, last keepalive</pre>



<p class="wp-block-paragraph">If the agent stays &#8220;disconnected&#8221;: firewall (on either side), wrong enrolment password, name already taken, or a version newer than the manager. <code>ossec.log</code> on the agent almost always says which.</p>


<!-- nz-enrich:wazuh-agent-real -->


<h3 class="wp-block-heading">A connected agent, for real</h3>



<p class="wp-block-paragraph">The agent on my web server, 2 November 2026, four hours after a reboot:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell"># /var/ossec/bin/wazuh-control info
WAZUH_VERSION=&quot;v4.14.9&quot;
WAZUH_TYPE=&quot;agent&quot;

# /var/ossec/bin/wazuh-control status
wazuh-modulesd is running...
wazuh-logcollector is running...
wazuh-syscheckd is running...
wazuh-agentd is running...
wazuh-execd is running...

# grep &quot;Connected to the server&quot; /var/ossec/logs/ossec.log | tail -1
2026/11/02 09:06:20 wazuh-agentd: INFO: (4102): Connected to the server ([wazuh.example.org]:1514/tcp).

# grep -E &quot;^(status|last_keepalive|last_ack|msg_count|msg_sent|msg_buffer)&quot; /var/ossec/var/run/wazuh-agentd.state
status=&#x27;connected&#x27;
last_keepalive=&#x27;2026-11-02 13:01:20&#x27;
last_ack=&#x27;2026-11-02 13:01:20&#x27;
msg_count=&#x27;117686&#x27;
msg_sent=&#x27;118393&#x27;
msg_buffer=&#x27;0&#x27;</pre>



<ul class="wp-block-list"><li><strong>Five daemons running</strong>: modulesd (inventory, SCA, vulnerability data), logcollector (reads logs), syscheckd (file integrity), agentd (the connection), execd (active responses). If one is missing, the matching feature is silently off.</li><li><strong>Connected less than a minute after boot</strong> (the machine came up at 09:05:29): the agent starts early and reconnects on its own after a reboot of either side.</li><li><strong>last_keepalive and last_ack</strong> at the same second: the agent sends, and the manager answers. A keepalive without an ack means the agent talks into the void: firewall on the way back, or a key the manager no longer recognises.</li><li><strong>msg_buffer = 0</strong>: nothing waiting to be sent. This buffer fills when the manager is unreachable; if it stays high, events are being delayed, and once full they are dropped.</li><li><strong>117 686 messages in four hours</strong>, about 8 per second for a busy web server: mostly log lines, plus inventory and integrity results. That&#8217;s the order of magnitude to plan for when sizing the manager.</li></ul>



<h2 class="wp-block-heading">Step 4: make it read the right logs</h2>



<p class="wp-block-paragraph">By default the agent reads the classic system logs. Add your services&#8217; logs:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="xml">&lt;!-- /var/ossec/etc/ossec.conf on the agent --&gt;
&lt;localfile&gt;
  &lt;log_format&gt;syslog&lt;/log_format&gt;
  &lt;location&gt;/var/log/nginx/error.log&lt;/location&gt;
&lt;/localfile&gt;
&lt;localfile&gt;
  &lt;log_format&gt;json&lt;/log_format&gt;
  &lt;location&gt;/var/log/suricata/eve.json&lt;/location&gt;
&lt;/localfile&gt;
&lt;localfile&gt;
  &lt;log_format&gt;journald&lt;/log_format&gt;
  &lt;location&gt;journald&lt;/location&gt;
  &lt;filter field=&quot;_SYSTEMD_UNIT&quot;&gt;^sshd\.service$&lt;/filter&gt;
&lt;/localfile&gt;</pre>



<ul class="wp-block-list"><li><strong>syslog</strong>: the classic text format, one line per event, which the manager decodes with its shipped decoders;</li><li><strong>json</strong>: for structured logs (Suricata, many modern applications). Each field becomes searchable in the dashboard and usable in rules;</li><li><strong>journald</strong>: reads the systemd journal directly, filtered by unit. Essential for services that write to no file.</li></ul>



<p class="wp-block-paragraph">Don&#8217;t make the same agent read the same information through two paths (a file and the systemd journal, for example): each event would be counted twice.</p>



<h2 class="wp-block-heading">Step 5: file integrity</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="xml">&lt;syscheck&gt;
  &lt;frequency&gt;43200&lt;/frequency&gt;
  &lt;directories realtime=&quot;yes&quot; check_all=&quot;yes&quot; report_changes=&quot;yes&quot;&gt;/etc/ssh,/etc/sudoers.d,/etc/nginx&lt;/directories&gt;
  &lt;directories realtime=&quot;yes&quot; check_all=&quot;yes&quot;&gt;/etc/passwd,/etc/shadow,/etc/group&lt;/directories&gt;
  &lt;directories check_all=&quot;yes&quot;&gt;/usr/bin,/usr/sbin,/usr/local/bin&lt;/directories&gt;
  &lt;ignore type=&quot;sregex&quot;&gt;\.swp$|~$&lt;/ignore&gt;
  &lt;nodiff&gt;/etc/shadow&lt;/nodiff&gt;
&lt;/syscheck&gt;</pre>



<ul class="wp-block-list"><li><strong>frequency</strong>: a full scan every twelve hours for directories without real-time monitoring;</li><li><strong>realtime</strong>: immediate monitoring through inotify, for files whose change must alert right away (SSH configuration, sudo, accounts);</li><li><strong>report_changes</strong>: attaches the changed file&#8217;s diff to the alert. Precious for configuration; never on secret files, hence <code>nodiff</code> for <code>/etc/shadow</code>;</li><li><strong>binaries</strong> (<code>/usr/bin</code>…): a change outside a package update is a strong sign of compromise. They&#8217;re numerous: no real time, the periodic scan is enough;</li><li><strong>ignore</strong>: editor temporary files, which would raise alerts at every edit.</li></ul>



<p class="wp-block-paragraph">Every package update produces a burst of integrity alerts on binaries: that&#8217;s normal, and the manager ties them to dnf&#8217;s logs. What should worry you is a binary change <strong>without</strong> a matching update.</p>



<h2 class="wp-block-heading">Step 6: SCA and vulnerabilities, for free</h2>



<p class="wp-block-paragraph">Configuration assessment (SCA) applies the distribution&#8217;s CIS benchmark every twelve hours and gives a score, with each failed check&#8217;s rationale and suggested remediation. Don&#8217;t aim for 100%: some checks assume a partitioning scheme or organisation that doesn&#8217;t apply to you. Read the list, fix what makes sense, and note why you ignore the rest.</p>



<p class="wp-block-paragraph">Vulnerability detection relies on the package inventory the agent sends; the manager matches it against published vulnerability databases. It covers installed RPM packages. It doesn&#8217;t see what an application bundles itself: an embedded Node.js, a Python environment, a Go binary built with a vulnerable library. For those, you have to follow each project&#8217;s announcements.</p>



<h2 class="wp-block-heading">Step 7: writing your own rules</h2>



<p class="wp-block-paragraph">The shipped rules cover the essentials, but they need adjusting. Yours go on the manager, in <code>/var/ossec/etc/rules/</code>, in a file of your own that no update will overwrite, with ids from 100000 up:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="xml">&lt;!-- /var/ossec/etc/rules/local_tuning.xml (on the manager) --&gt;
&lt;group name=&quot;local,tuning,&quot;&gt;
  &lt;rule id=&quot;100900&quot; level=&quot;0&quot;&gt;
    &lt;if_sid&gt;550&lt;/if_sid&gt;
    &lt;field name=&quot;file&quot;&gt;^/var/lib/myapp/cache/&lt;/field&gt;
    &lt;description&gt;Known noise: application cache changing all the time&lt;/description&gt;
  &lt;/rule&gt;

  &lt;rule id=&quot;100901&quot; level=&quot;12&quot;&gt;
    &lt;if_sid&gt;550&lt;/if_sid&gt;
    &lt;field name=&quot;file&quot;&gt;^/etc/sudoers&lt;/field&gt;
    &lt;description&gt;sudo configuration changed: $(file)&lt;/description&gt;
    &lt;group&gt;privilege_escalation,&lt;/group&gt;
  &lt;/rule&gt;
&lt;/group&gt;</pre>



<h3 class="wp-block-heading">Silencing known noise</h3>



<p class="wp-block-paragraph">A rule that shouts all the time makes you ignore all the others. Don&#8217;t disable the original rule: add a level-0 <strong>child</strong> rule (<code>if_sid</code>) targeting only the known case. Here rule 550 (&#8220;checksum changed&#8221;) stays active everywhere except for the application&#8217;s cache.</p>



<h3 class="wp-block-heading">Raising what matters</h3>



<p class="wp-block-paragraph">Conversely, a change to the sudo configuration deserves more than the default level: rule 100901 lifts it to level 12, enough to trigger an immediate notification. The <code>privilege_escalation</code> group makes it easy to find in the dashboard.</p>



<h3 class="wp-block-heading">The field name trap</h3>



<p class="wp-block-paragraph">The dashboard and the JSON alerts show the file path as <code>syscheck.path</code>. But in a rule, and in the description&#8217;s <code>$(…)</code> substitution, you must write <code>file</code>. With <code>syscheck.path</code> there&#8217;s no error at load time: the rule simply never fires, and the description shows up blank. I shipped two rule files broken this way before understanding it.</p>



<h3 class="wp-block-heading">Test before reloading</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="shell">/var/ossec/bin/wazuh-analysisd -t          # rule syntax
/var/ossec/bin/wazuh-logtest               # paste a line: which rules apply?
systemctl restart wazuh-manager</pre>



<p class="wp-block-paragraph"><code>wazuh-logtest</code> only simulates logs, not integrity events. For a syscheck rule, the test is real: change a file in the target directory on the agent, and look for the alert in <code>/var/ossec/logs/alerts/alerts.json</code> on the manager.</p>



<h2 class="wp-block-heading">Upgrading the fleet</h2>



<ul class="wp-block-list"><li>the manager first, indexer and dashboard included, following the release notes;</li><li>check that every agent is still &#8220;Active&#8221;;</li><li>then the agents, machine by machine, pinning the same version as the manager;</li><li>after each agent, <code>agent_control -i</code> must show the new version.</li></ul>



<h2 class="wp-block-heading">Going further</h2>



<p class="wp-block-paragraph">&#8220;Active responses&#8221; let the manager trigger an action on the agent in response to a rule (banning an address, for example). If CrowdSec or fail2ban already do that, refrain: two systems each banning on their own make unblocking painful. Wazuh is more useful as memory and as a correlation point than as an enforcer.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p class="wp-block-paragraph"><em>This post is part of a series of sysadmin tutorials (tag &#8220;how-to&#8221;).</em><br>Series &#8220;How-to&#8221;, tutorial 15/77. · <a href="https://hecate.neurozone.fr/?p=623">← Previous tutorial</a> · <span class="link-upcoming">Next tutorial → (coming 30 Nov)</span> · <a href="https://blog.neurozone.fr/?p=2069">Version française</a></p>



<h2 class="wp-block-heading">Related articles</h2>



<ul class="wp-block-list"><li><a href="https://hecate.neurozone.fr/?p=598">Installing CrowdSec without banning yourself</a></li><li><a href="https://hecate.neurozone.fr/?p=599">Suricata as an IPS with NFQUEUE</a></li><li><a href="https://hecate.neurozone.fr/?p=620">A well-tuned fail2ban with progressive bans</a></li></ul>
<p>The post <a href="https://hecate.neurozone.fr/2026/11/25/how-to-install-a-wazuh-agent-and-get-something-out-of-it/">How-to: install a Wazuh agent and get something out of it</a> appeared first on <a href="https://hecate.neurozone.fr">Hécate Regnier - Neurozone</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://hecate.neurozone.fr/2026/11/25/how-to-install-a-wazuh-agent-and-get-something-out-of-it/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">624</post-id>	</item>
	</channel>
</rss>
