<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Eusser Darling</title>
    <description>The latest articles on DEV Community by Eusser Darling (@eusser_darling_560b369512).</description>
    <link>https://dev.to/eusser_darling_560b369512</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4251320%2F6d300a24-c660-439f-89e4-1e829acdde1f.png</url>
      <title>DEV Community: Eusser Darling</title>
      <link>https://dev.to/eusser_darling_560b369512</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/eusser_darling_560b369512"/>
    <language>en</language>
    <item>
      <title>From Raw Logs to Brute-Force Detection: Expanding, Hardening, and Testing a Wazuh SIEM Lab</title>
      <dc:creator>Eusser Darling</dc:creator>
      <pubDate>Wed, 18 Nov 2026 07:48:39 +0000</pubDate>
      <link>https://dev.to/eusser_darling_560b369512/from-raw-logs-to-brute-force-detection-expanding-hardening-and-testing-a-wazuh-siem-lab-34c3</link>
      <guid>https://dev.to/eusser_darling_560b369512/from-raw-logs-to-brute-force-detection-expanding-hardening-and-testing-a-wazuh-siem-lab-34c3</guid>
      <description>&lt;ol&gt;
&lt;li&gt;Introduction
Setting up a SIEM looks simple on paper. Then you connect real Linux endpoints, apply a hardening baseline and run a credential attack against them, and things stop going to plan.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This past week I expanded my Wazuh SIEM lab (wazuh-siem). I added an Ubuntu 24.04 server (play-server), set it up to send its daily Logwatch summary into Wazuh, hardened it against the CIS Ubuntu Linux 24.04 LTS Benchmark, and added Google Authenticator MFA to SSH. Then I ran a THC-Hydra brute-force attack against it from my Kali machine.&lt;/p&gt;

&lt;p&gt;I made some mistakes along the way, and those taught me the most. I learned why informational logs never show up on the alerts dashboard, how rounding can hide a CIS fix you actually made, and what happens when pam_faillock locks your own admin account in the middle of a test.&lt;/p&gt;

&lt;p&gt;A little about me: I'm Eusser, and I've spent more than 10 years in facilities and IT operations management, keeping infrastructure, endpoints and everyday systems running. Over time I noticed the part I liked most wasn't keeping things online. It was figuring out how they break, how attackers probe them, and how defenders catch the warning signs early. That led me to earn my CompTIA Security+ and start doing hands-on security work. This is my first technical blog post, and I plan to write more. I hope my troubleshooting detours save someone else time on their own lab.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Setup: Adding a Server and Sending Logwatch Digests to Wazuh
A SIEM can only show you what you send it. My Wazuh manager (wazuh-siem, 10.170.0.99) was already running, so I added a second machine, an Ubuntu 24.04 LTS server called play-server (10.170.0.22), and had it forward its daily Logwatch summary to Wazuh. Syslog gives you every line as it happens, which is noisy. Logwatch gives you one daily summary of disk usage, package changes and login problems, which is much easier for an analyst to scan.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I installed Logwatch on play-server and edited /etc/logwatch/conf/logwatch.conf so it writes a plain-text summary to a file instead of emailing root:&lt;/p&gt;

&lt;p&gt;Output = file&lt;br&gt;
Format = text&lt;br&gt;
Filename = /var/log/logwatch_digest.log&lt;br&gt;
Range = yesterday&lt;br&gt;
Detail = Med&lt;br&gt;
The Wazuh agent doesn't run as root, so it needs permission to read that file. I created /var/log/logwatch_digest.log ahead of time, set the owner to root:adm with 640 permissions, and added a  block to /var/ossec/etc/ossec.conf on play-server:&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
  syslog&lt;br&gt;
  /var/log/logwatch_digest.log&lt;br&gt;
&lt;br&gt;
Mistake #1: The agent was trying to enroll with itself&lt;br&gt;
Next I ran agent-auth on play-server to enroll it with the Wazuh manager, and got this error:&lt;/p&gt;

&lt;p&gt;agent-auth: ERROR: (1208): Unable to connect to enrollment service at '[10.170.0.22]:1515'&lt;br&gt;
Running nc -zv 10.170.0.22 1515 also returned "Connection refused." My first guess was that wazuh-authd had stopped or a firewall on the manager was blocking it. Then I looked at the IP again. 10.170.0.22 is play-server. The manager is 10.170.0.99. When I installed the agent, I had put play-server's own IP in the &lt;/p&gt; field of ossec.conf, so it was trying to enroll with itself on port 1515.

&lt;p&gt;The fix was three commands: correct the address, enroll again against the right IP, and restart the agent.&lt;/p&gt;

&lt;p&gt;sudo sed -i 's/&lt;/p&gt;10.170.0.22&amp;lt;\/address&amp;gt;/10.170.0.99&amp;lt;\/address&amp;gt;/' /var/ossec/etc/ossec.conf&lt;br&gt;
sudo /var/ossec/bin/agent-auth -m 10.170.0.99 -A play-server&lt;br&gt;
sudo systemctl restart wazuh-agent&lt;br&gt;
This time I got "Valid key received," and play-server showed up in the dashboard as Agent 004.

&lt;ol&gt;
&lt;li&gt;The Experiments
Experiment #1: Checking that Logwatch data reaches Wazuh
Goal: Confirm that /var/log/logwatch_digest.log gets from play-server to wazuh-siem, and see how Wazuh's default decoders handle it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I generated a new Logwatch digest on play-server, opened the Wazuh dashboard (Threat Hunting → Events), and filtered on agent.name: "play-server" and the log file path. Nothing came up. In Explore → Discover, the index list only had wazuh-alerts-. There was no wazuh-archives- index at all.&lt;/p&gt;

&lt;p&gt;That's when I learned how the pipeline works. The wazuh-alerts-* index only stores events that match a rule at level 3 or higher. Logwatch lines like "--- Disk Space Begin ---" or "Logwatch 7.7" go through the generic syslog decoder and land at level 0. The manager reads them and then drops them. They never get indexed unless you turn on full archiving.&lt;/p&gt;

&lt;p&gt;To prove the data was arriving without filling up my VM's disk, I turned archiving on just for the test. I changed no to yes on wazuh-siem, restarted wazuh-manager, ran Logwatch again on play-server, and searched the archive file on the manager:&lt;/p&gt;

&lt;p&gt;sudo grep '"location":"/var/log/logwatch_digest.log"' /var/ossec/logs/archives/archives.json | tail -n 3&lt;br&gt;
The records were there, showing "agent":{"id":"004","name":"play-server","ip":"10.170.0.22"} and "location":"/var/log/logwatch_digest.log". Once I'd confirmed it, I set logall_json back to no and cleared archives.json to free up the space.&lt;/p&gt;

&lt;p&gt;Experiment #2: CIS hardening and File Integrity Monitoring&lt;br&gt;
Goal: Get a Security Configuration Assessment (SCA) baseline for play-server against the CIS Ubuntu Linux 24.04 LTS Benchmark v1.0.0, fix some failed checks, and confirm both the score change and the File Integrity Monitoring (FIM) alerts.&lt;/p&gt;

&lt;p&gt;The first SCA scan of play-server scored 50%: 119 passed, 118 failed and 42 not applicable. I expected to find ASLR (kernel.randomize_va_space) and the /etc/passwd and /etc/shadow permissions on the failed list, but they weren't there. Ubuntu 24.04 already passes those out of the box (checks 35542, 35761 and 35765). What did fail included check 35543 (core dumps restricted), apport.service (35545) and the login warning banner (35547).&lt;/p&gt;

&lt;p&gt;I ran these on play-server:&lt;/p&gt;

&lt;p&gt;echo "* hard core 0" | sudo tee -a /etc/security/limits.conf&lt;br&gt;
printf "fs.suid_dumpable = 0\nkernel.randomize_va_space = 2\n" | sudo tee /etc/sysctl.d/99-cis.conf&lt;br&gt;
sudo sysctl -p /etc/sysctl.d/99-cis.conf&lt;br&gt;
sudo chown root:root /etc/passwd /etc/shadow &amp;amp;&amp;amp; sudo chmod 644 /etc/passwd &amp;amp;&amp;amp; sudo chmod 640 /etc/shadow&lt;br&gt;
sudo systemctl disable --now apport.service 2&amp;gt;/dev/null&lt;br&gt;
echo "Authorized access only. All activity may be monitored and reported." | sudo tee /etc/issue&lt;br&gt;
sudo systemctl restart wazuh-agent&lt;br&gt;
After the rescan, check 35543 changed to Passed, but the score on the dashboard still said 50%. The math explains it: going from 119/237 (50.21%) to 120/237 (50.63%) still rounds down to 50%. The score won't move until more checks pass.&lt;/p&gt;

&lt;p&gt;Then I went to look for the FIM (syscheck) alerts for the files I'd changed. Searching rule.groups: syscheck returned nothing. The problem was that I was still in the SCA Events tab, which adds rule.groups: sca to every search. When I switched to the File Integrity Monitoring module, the filter went away and the rule.id: 550 (Integrity checksum changed) alerts for play-server showed up.&lt;/p&gt;

&lt;p&gt;Experiment #3: SSH MFA and a THC-Hydra brute-force attack&lt;br&gt;
Goal: Require MFA for SSH on play-server using PAM and Google Authenticator, then compare what Wazuh shows for a single bad code versus a fast THC-Hydra brute-force attack from my Kali workstation.&lt;/p&gt;

&lt;p&gt;I installed libpam-google-authenticator on play-server and set up TOTP for the sysadmin account:&lt;/p&gt;

&lt;p&gt;google-authenticator -t -d -f -r 3 -R 30 -w 3 -e 5&lt;br&gt;
Then I added auth required pam_google_authenticator.so nullok right below &lt;a class="mentioned-user" href="https://dev.to/include"&gt;@include&lt;/a&gt; common-auth in /etc/pam.d/sshd, and set these in /etc/ssh/sshd_config:&lt;/p&gt;

&lt;p&gt;KbdInteractiveAuthentication yes&lt;br&gt;
UsePAM yes&lt;br&gt;
AuthenticationMethods publickey,keyboard-interactive password,keyboard-interactive&lt;br&gt;
First, a single failed MFA login. From Kali I ran ssh &lt;a href="mailto:sysadmin@10.170.0.22"&gt;sysadmin@10.170.0.22&lt;/a&gt;, entered the correct password and a fake code (000000). PAM rejected it and logged "Invalid verification code for sysadmin."&lt;/p&gt;

&lt;p&gt;Next, I ran Hydra from Kali with a list of 8 passwords:&lt;/p&gt;

&lt;p&gt;hydra -l sysadmin -P /tmp/hydra_test.txt -t 4 -vV ssh://10.170.0.22&lt;br&gt;
In Threat Hunting → Events, the two tests looked very different:&lt;/p&gt;

&lt;p&gt;The single bad code and other one-off failures created separate level 5 alerts: Rule 5503 (PAM: User login failed) and Rule 5760 (sshd: authentication failed).&lt;br&gt;
The Hydra run set off Wazuh's correlation rules. The rapid Rule 5760 failures were rolled up into one level 10 alert: Rule 5763 (sshd: brute force trying to get access to the system).&lt;br&gt;
Mistake #2: Locking myself out with pam_faillock&lt;br&gt;
Right after the Hydra run, I tried to SSH into play-server to check /var/log/auth.log. My correct password failed twice, and I never got the verification code prompt. I thought I had broken /etc/pam.d/sshd.&lt;/p&gt;

&lt;p&gt;Luckily I still had another SSH session open. From there I found the real cause: Hydra's 8 quick attempts had hit Ubuntu 24.04's pam_faillock limit and locked sysadmin for 10 minutes. PAM was rejecting even my correct password before it got to the MFA step, and each attempt created another Rule 5503 alert in Wazuh. Running sudo faillock --user sysadmin --reset in the open session unlocked the account right away.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Conclusion
4.1 What I found
The three experiments showed me how Wazuh handles three different kinds of Linux security data:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Custom log ingestion (Experiment #1): Plain-text summaries like Logwatch go through the generic syslog decoder at level 0. They only show up in archives.json, and only when logall_json is turned on, unless you write custom rules that raise specific patterns to level 3 or higher.&lt;br&gt;
Configuration assessment and FIM (Experiment #2): The CIS Ubuntu 24.04 scan started at 50% and flagged core-dump restrictions (35543) as failed. After fixing it, I saw the check change in SCA and got Rule 550 integrity alerts for the files I'd changed.&lt;br&gt;
MFA and brute-force detection (Experiment #3): Google Authenticator added a second factor to SSH. Wazuh kept one-off login failures (Rules 5503 and 5760, level 5) separate from the Hydra attack (Rule 5763, level 10).&lt;br&gt;
4.2 How to avoid my mistakes&lt;br&gt;
If you're building a similar lab, these three habits will save you time:&lt;/p&gt;

&lt;p&gt;Check the manager IP in ossec.conf before you enroll. Make sure &lt;/p&gt; points to your Wazuh manager, not to the agent itself. If it's wrong, agent-auth fails with "Connection refused" on port 1515.&lt;br&gt;
Watch for module filters in the Wazuh dashboard. When you open Events inside a module like SCA, it adds a filter such as rule.groups: sca to your search. That hides syscheck and PAM alerts until you switch to a different view.&lt;br&gt;
Keep a second SSH session open when testing PAM or running Hydra. pam_faillock can lock your test account partway through. An open session lets you read auth.log and run faillock --reset without losing access.

&lt;ol&gt;
&lt;li&gt;Final Thoughts
5.1 The coolest thing I learned
The most interesting part was seeing how a SIEM separates collecting logs from raising alerts. Level 0 Logwatch lines went through the manager without adding anything to the alerts dashboard. Meanwhile, a quick burst of level 5 SSH failures (Rule 5760) was automatically rolled up into a level 10 brute-force alert (Rule 5763). Watching that happen taught me more about detection engineering than reading the docs did.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;5.2 One piece of advice&lt;br&gt;
Learn the difference between collecting a log and indexing an alert before you start troubleshooting missing events. When /var/log/logwatch_digest.log didn't show up in wazuh-alerts-*, I assumed the agent wasn't sending it. In fact, Wazuh was receiving and decoding every line, then dropping them because they were level 0. Knowing how to check archives.json (and remembering to turn logall_json off afterward so your disk doesn't fill up) is worth learning early.&lt;/p&gt;

&lt;p&gt;5.3 My favorite resources&lt;br&gt;
I used the official Wazuh documentation the most, especially the Security Configuration Assessment (SCA) guide, along with the Kali Linux documentation for THC-Hydra. The SCA guide explains exactly how Wazuh calculates the compliance percentage and how syscheck intervals differ from on-demand SCA scans. That's how I figured out my score was stuck at 50% because of rounding, even after check 35543 passed.&lt;/p&gt;

&lt;p&gt;5.4 Thanks&lt;br&gt;
Thank you to the Wazuh team and contributors for building a free SIEM, FIM and CIS compliance platform that students and home-lab builders can install and pick apart. Being able to read the actual XML rules, CIS YAML policies and archives.json made it much easier to learn how detection works.&lt;/p&gt;

&lt;p&gt;Thanks also to van Hauser / The Hacker's Choice (THC) and the Kali Linux maintainers for THC-Hydra and its documentation. Running controlled credential attacks in my own lab let me see firsthand how a SIEM tells a typo apart from an automated attack.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Resources
Wazuh Documentation: Log Data Collection (Wazuh, Inc., 2026). Where I got the  syntax and permission requirements for sending /var/log/logwatch_digest.log and /var/log/auth.log from play-server to the manager.
Wazuh Documentation: Security Configuration Assessment (SCA) (Wazuh, Inc., 2026). Explains how Wazuh checks endpoints against the CIS Ubuntu Linux 24.04 LTS Benchmark (cis_ubuntu24-04.yml) and how it calculates the compliance score.
Wazuh Documentation: File Integrity Monitoring (FIM) (Wazuh, Inc., 2026). Helped me confirm the syscheck alerts (Rule 550) after changing /etc/security/limits.conf, /etc/sysctl.d/99-cis.conf and /etc/issue, and showed how to trigger an on-demand scan with agent_control.
Kali Linux Tools: Hydra (OffSec / Kali Linux team, originally by van Hauser / THC, 2026). The command-line options and threading syntax for the SSH brute-force test.
Ubuntu Server Documentation: OpenSSH Server and PAM (Canonical Ltd., 2026). Helped me confirm the ssh service name on Ubuntu 24.04, drop-in config files under /etc/ssh/sshd_config.d/, and how pam_faillock behaves during SSH MFA testing.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>cybersecurity</category>
      <category>linux</category>
      <category>monitoring</category>
      <category>security</category>
    </item>
  </channel>
</rss>
