No Log Left Behind: Strengthening Security Visibility with Wazuh SIEM
1. Introduction
1.1 Teaser Overview
Have you ever wondered what might be happening inside a network without anyone noticing?
Before starting this project, I didn't realize how much information could be found in something as simple as a log file. I knew that cybersecurity involved protecting computers, networks, and information, but I was still learning how security analysts actually monitor what happens behind the scenes.
For this project, I got to work with Wazuh, a Security Information and Event Management (SIEM) platform. My goal was to improve the existing monitoring setup and see how Wazuh collected different types of web server activity.
Along the way, I ran into a few unexpected results, learned how important troubleshooting is, and realized that even small changes can make a difference when it comes to security monitoring.
1.2 Introducing Myself to the Cyber Community
Hello, cyber community!
My name is Ductony Nguyen, and I'm currently studying cybersecurity at TripleTen. I became interested in cybersecurity because I've always enjoyed technology, learning how things work, and solving problems. I'm also interested in the career opportunities this field offers and the chance to help protect people and organizations from cyber threats.
I'm still learning, and I know there's a lot more for me to understand. Some of these tools and concepts can be confusing at first, but I enjoy the challenge of figuring things out.
One of my biggest motivations is building a career where I can continue improving my skills and doing something meaningful. I believe every project, mistake, and lesson is helping me become more confident in my abilities.
I'm excited to share one of my first hands-on experiences working with a SIEM!
2. Setup
Adding Apache Web Server Logs to Wazuh
For my Sprint 11 project, I decided to improve the existing Wazuh environment by adding another Apache web server log source.
I worked on the observer machine, which was running Ubuntu 24.04 in our TripleTen Cloudshare lab.
The goal was pretty simple: I wanted Wazuh to collect additional web server activity so I could better understand what was happening on the system.
Step 1: Checking the Environment
Before changing anything, I needed to make sure Apache and the Wazuh agent were already installed and running.
I used these commands:
sudo systemctl status apache2 sudo systemctl status wazuh-agent Both services showed active (running), which meant I could move forward without installing anything new.
Step 2: Finding the Correct Log File
Next, I checked the Apache log directory:
sudo ls -lh /var/log/apache2/ This is where I noticed something interesting.
The normal access.log file was empty, but another file called other_vhosts_access.log had activity in it.
I wanted to see what was inside, so I ran:
sudo tail -n 10 /var/log/apache2/other_vhosts_access.log The output showed HTTP requests being recorded by Apache.
This helped me realize that the active web traffic wasn't necessarily being stored where I first expected it to be.
Step 3: Checking and Backing Up the Wazuh Configuration
After finding the active log, I checked the Wazuh agent configuration.
The configuration file was located at:
/var/ossec/etc/ossec.conf
Wazuh was already set up to monitor Apache's access.log and error.log, but the active virtual-host access log wasn't listed.
Before editing anything, I created a backup:
sudo cp /var/ossec/etc/ossec.conf /var/ossec/etc/ossec.conf.backup I thought this was an important step because I didn't want to accidentally break the existing configuration.
Step 4: Making My Modification
I opened the Wazuh configuration using:
sudo nano /var/ossec/etc/ossec.conf Then I added this configuration inside the existing <ossec_config> section:
<localfile> <log_format>apache</log_format> <location>/var/log/apache2/other_vhosts_access.log</location> </localfile> This tells the Wazuh agent to monitor the additional Apache log file.
After saving my changes, I checked the configuration:
sudo /var/ossec/bin/wazuh-logcollector -t The command finished without reporting any errors.
I restarted the Wazuh agent:
sudo systemctl restart wazuh-agent Then I verified that it was running:
sudo systemctl is-active wazuh-agent The result was active.
Finally, I checked the Wazuh agent logs and saw that it was analyzing the new Apache log file.
Seeing that confirmation was a good feeling because it showed that my modification was being used by Wazuh.
A Mistake During Setup
One mistake I made was assuming that the default Apache access.log file would contain the activity I needed.
When I checked it, the file was empty, which confused me because Apache was clearly running.
After looking through the other log files, I found that the active traffic was actually being recorded in other_vhosts_access.log.
This taught me that I shouldn't assume every system is configured the same way. Sometimes the best thing to do is investigate what's already there before making changes.
3. Experiment Time!
After adding the new Apache log source, I wanted to make sure Wazuh was actually collecting the information.
I ran three experiments to test different types of web server activity.
Experiment #1 — Normal Web Traffic
For my first experiment, I wanted to see whether a normal web request would be recorded by Apache and collected by Wazuh.
On the observer machine, I ran:
curl -I http://127.0.0.1/ The server returned:
HTTP/1.1 302 Found
At first, I wasn't completely familiar with what that meant. After looking at the response, I learned that HTTP 302 means the server is redirecting the request somewhere else.
I checked the Apache log and found the request I had just made.
Then I opened Wazuh Discover and searched the wazuh-archives-* index for the new Apache log source.
I was able to see Apache web traffic being collected and decoded by Wazuh.
What I learned: My new log source was working. I also started to understand how Wazuh collects events even when they don't necessarily generate a security alert.
Experiment #2 — Investigating an HTTP 404 Error
For my second experiment, I wanted to see what would happen if someone tried to visit a webpage that didn't exist.
I requested a test page:
curl -i http://127.0.0.1/tripleten-test-page-not-found-2026 I expected the server to immediately respond with an HTTP 404 error.
Instead, I got:
HTTP/1.1 302 Found
At first, I thought I might have done something wrong.
After examining the response more carefully, I realized the server was redirecting HTTP requests to HTTPS.
To follow the redirect, I changed my command:
curl -k -L -i http://127.0.0.1/tripleten-test-page-not-found-2026 For this controlled lab test, -L followed the redirect, while -k allowed curl to continue despite the lab's untrusted HTTPS certificate.
This time, I received:
HTTP/1.1 404 Not Found
I checked the Apache logs and discovered that the HTTP 302 redirect appeared in other_vhosts_access.log, while the HTTPS 404 response appeared in access.log.
I then searched Wazuh Discover and found the 404 event.
Wazuh identified it using:
- Rule ID: 31101
- Rule description: Web server 400 error code
- Alert level: 5
This experiment was interesting because I learned something unexpected about how the web server handled requests.
I also got to see how Wazuh could recognize an HTTP error and classify it using an existing detection rule.
Experiment #3 — Repeated Web Requests
For my final experiment, I wanted to see whether Wazuh could collect multiple web requests made close together.
I generated five test requests against my local Apache server, with approximately two seconds between them.
I used a command like this:
for i in {1..5}; do curl -s -o /dev/null -w "Request $i: HTTP %{http_code}\n" "http://127.0.0.1/tripleten-repeat-test-$i" sleep 2 done Each request returned HTTP 302.
I then checked other_vhosts_access.log and confirmed that Apache recorded all five requests.
Next, I opened Wazuh Discover and searched for the individual test URLs.
After adjusting my search queries, I was able to find all five matching events in the wazuh-archives-* index.
What I learned: Wazuh was successfully collecting the repeated requests and preserving useful information about each event.
I also learned that just because several requests appear in a log doesn't automatically mean an attack is happening. Security analysts have to understand the context before deciding whether activity is suspicious.
A Mistake I Made During Testing
One of my biggest learning moments happened during Experiment #2.
I originally assumed that requesting a webpage that didn't exist would immediately return an HTTP 404 error.
When Apache returned HTTP 302 instead, I was confused because the result didn't match what I expected.
Rather than stopping there, I looked at the response and realized the server was redirecting the request to HTTPS.
Once I followed the redirect, I received the 404 response I was looking for.
This reminded me that troubleshooting is a huge part of cybersecurity. Sometimes the result isn't wrong; you just need to understand why the system behaved that way.
4. Conclusion
4.1 Summary of My Findings
Overall, this project helped me understand how Wazuh collects and monitors activity from a web server.
My first experiment showed that the additional Apache log source was working and that Wazuh could collect normal web requests.
My second experiment showed how an HTTP request could redirect to HTTPS before returning a 404 error. I also saw how Wazuh detected that error using an existing security rule.
My third experiment confirmed that Wazuh could collect five separate web requests made within a short period.
The biggest thing I learned was that collecting information and detecting threats are not exactly the same thing.
A SIEM can collect many events, but not every event means something suspicious is happening.
4.2 Advice on Avoiding Mistakes
If I could give advice to another student doing this project, I would say to take your time and verify everything before making changes.
One mistake I made was assuming that the default Apache log contained the activity I wanted to monitor. It wasn't until I inspected the other logs that I found the correct file.
I also learned not to assume that a command will always return the result I expect.
During my HTTP 404 experiment, the server initially returned HTTP 302 because it was redirecting the request.
My advice is to read the output carefully, investigate unexpected results, and always back up important configuration files before editing them.
Sometimes learning why something didn't work is more valuable than getting it right on the first try.
5. Final Thoughts
5.1 The Coolest Thing I Learned
The coolest part of this project was seeing the web requests I generated show up inside Wazuh Discover.
It might sound simple, but as someone who is still learning cybersecurity, it was exciting to see how something I did in the Linux terminal could turn into useful information inside a SIEM.
It helped me connect the commands I was learning with what security analysts actually look at when investigating activity.
I also thought it was interesting that not every event generates an alert. I learned that understanding normal activity is just as important as recognizing suspicious activity.
5.2 One Piece of Advice
My advice to anyone starting cybersecurity is to be patient with yourself and keep practicing.
There's a lot of information to learn, and it's easy to get overwhelmed when something doesn't make sense right away.
What helped me was taking things one step at a time, reading the output, and trying to understand what each command was actually doing.
You don't have to know everything at the beginning. What matters is being willing to learn, ask questions, and keep improving.
5.3 My Favorite Resource
One of my favorite resources during this project was the official Wazuh documentation.
Since I'm still learning, having documentation that explains how Wazuh works and how to configure different log sources was really helpful.
It gave me a way to look up unfamiliar settings and understand why certain configuration changes were needed.
I would recommend it to anyone who's learning Wazuh or working on their first SIEM deployment.
Wazuh Documentation: https://documentation.wazuh.com/current/
5.4 Thank You!
First, I want to thank my TripleTen instructors and tutors for providing the learning materials and guidance that helped me work through this project.
I also want to thank my family for supporting me while I continue learning and working toward my cybersecurity career goals.
Balancing everyday responsibilities with school isn't always easy, but having people who believe in me helps me stay motivated.
I'm proud of the progress I've made so far, and I'm excited to keep building my knowledge and confidence as I continue my cybersecurity journey.
6. References
Reference #1 — Wazuh Log Data Collection
Title: Log Data Collection
Author/Organization: Wazuh Documentation Team
Affiliation: Wazuh
Publication Date: Not listed
URL: https://documentation.wazuh.com/current/user-manual/capabilities/log-data-collection/index.html
Why it was useful: This helped me understand how Wazuh collects and processes logs from different endpoints.
Reference #2 — Monitoring Log Files
Title: Configuration for Monitoring Log Files
Author/Organization: Wazuh Documentation Team
Affiliation: Wazuh
Publication Date: Not listed
URL: https://documentation.wazuh.com/current/user-manual/capabilities/log-data-collection/monitoring-log-files.html
Why it was useful: This explained how to configure Wazuh to monitor additional log files and helped me understand the changes I made to the configuration.
Reference #3 — Wazuh Localfile Configuration
Title: Localfile — Local Configuration (ossec.conf)
Author/Organization: Wazuh Documentation Team
Affiliation: Wazuh
Publication Date: Not listed
URL: https://documentation.wazuh.com/current/user-manual/reference/ossec-conf/localfile.html
Why it was useful: This showed me how the <localfile> settings work, including the log format and file location.
Reference #4 — Apache HTTP Server Log Files
Title: Log Files — Apache HTTP Server Version 2.4
Author/Organization: Apache HTTP Server Project
Affiliation: Apache Software Foundation
Publication Date: Not listed
URL: https://httpd.apache.org/docs/2.4/logs.html
Why it was useful: This helped me understand how Apache records web server requests and HTTP response codes.
Reference #5 — curl Documentation
Title: curl — Command-Line Manual
Author/Organization: curl Project
Affiliation: curl Project
Publication Date: Not listed
URL: https://curl.se/docs/manpage.html
Why it was useful: This helped me understand the curl commands I used during testing, especially how to follow HTTP redirects.