Parse the Wazuh agent running configuration, print to stdout as JSON or save to an HTML file.
Project description
Wazuh Agent Configuration Result (wresult)
Overview
wresult provides the running configuration of a Wazuh agent by reconstructing how it applies ossec.conf and agent.conf. This tool is designed to support users for compliance reporting and troubleshooting, ensuring that teams can see the actual settings enforced on an agent.
[!IMPORTANT] While Wazuh supports agents on systems other than Linux and Windows, such as MacOS, Solaris, HP UX, this tool is designed for Windows and Linux only.
Why Use wresult?
The Problem
Wazuh agents dynamically apply configurations:
- ossec.conf is loaded first (local settings).
- agent.conf is fetched from the Wazuh manager and applied sequentially, overriding or appending settings.
- Conditional configurations, aka Options (e.g., OS-specific, profile-based configurations) determine the final applied settings.
- There are internal options that amends the behaviors in an advanced manner. For agents, it is generally just the debug configuration. Since the original file
internal_options.confis overwritten on every update, there is thelocal_internal_options.conffile for overriding default behaviors. This is crucial on troubleshooting. And user needs to be aware of the deviances from the defaults.
As a result:
🔹 Compliance teams struggle to verify if required security policies are applied.
🔹 Security engineers face difficulties troubleshooting unexpected agent behavior.
🔹 Administrators need a way to see the configuration exactly as the agent applies it.
[!NOTE] This is the same issue with Group Policies in Windows environments where multiple policies, including local policies can be applied and there is a non-trivial precedence process to combine them for the expected results. There, the solution is collecting the Resultant Set of Policies (RSoP) via
gpresultcommand. Hence the tool,wresult.
The Solution
✅ Shows the running configuration—not just raw config files.
✅ Resolves conflicts—newer policies override older ones.
✅ Filters out irrelevant settings—only applicable rules are included.
✅ Saves time—eliminates manual inspection of multiple configuration files.
Features
- Accurate Reconstruction – Mirrors how Wazuh agents process configurations.
- Conflict Resolution – Newer settings take precedence; others are appended.
- JSON Output – Machine-readable, structured for automation and jq processing.
- HTML Report – Interactive, easy-to-read configuration report.
- Supports Linux & Windows – Uses standard Wazuh configuration paths.
Installation
wresult is designed for easy installation and execution via pipx.
pipx install https://codeload.github.com/zbalkan/wresult/zip/refs/heads/main
[!IMPORTANT] ⚠️ Due to the Wazuh configuration files' permissions, run as root (Linux) or as an Administrator (Windows). But if you are testing against custom configuration files only using the hidden parameters, you don't need higher privileges.
[!WARNING] ⚠️
pipxdoes not play well withsudo. Therefore, you need to runsudo -i, installwresultviapipx, and use as root. I could not manage to find out a workaround to installwresultas root and use it withsudo, unfortunately. If you find a solution or a workaround, please let me know by creating an issue, PR or dropping an email.
Usage
usage: wresult [-h] [--output OUTPUT]
Parse the Wazuh agent running configuration, print to stdout as JSON or save to an HTML file.
options:
-h, --help show this help message and exit
--output OUTPUT, -o OUTPUT
Output file path
CLI Output (JSON for Automation)
wresult | jq .
🔹 View the exact applied settings in structured JSON, ideal for automation.
Generate a Human-Readable Report
wresult --output report.html
🔹 Generates an interactive HTML report with expandable sections.
🔹 See the collapsed tree of configuration items.
🔹 Click "Show all" to have a broader view.
Hidden Arguments
In order to support testing, the tool has provided hidden parameters that are not visible on the help menu. The users must provide all 3 of them if needed. Otherwise, the tool will fall back to default locations for the undefined paths. This is designed to test and validate configuration changes without breaking the agent.
These arguments are for testing only. They are subject to change and should be treated as an undocumented API.
--agent_conf_path (-ap): Custom path for agent.conf.
--ossec_conf_path (-op): Custom path for ossec.conf.
--client_keys_path (-ck): Custom path for client.keys file.
--local_internal_options_path (-li): Custom path for local_internal_options.conf file.
License
This project is open-source and licensed under the MIT License.
Thanks
I was considering a remake of the gpresult HTML report, but I came up with a better and easier solution thanks to Maxim Maeder. I took his example, and simplified it for my use case, and it worked brilliantly. Kudos to Maxim!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wresult-1.0.1-py3-none-any.whl.
File metadata
- Download URL: wresult-1.0.1-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
742f2192cc2a1cae2c03f3b12f215cc4de1df28936686ec78e64793068bfb3d6
|
|
| MD5 |
14d406b0d80777eb0aa0ff57712f7b7c
|
|
| BLAKE2b-256 |
8c724fa386d3c9f1c2bc845a1f1921ffe574ec6fbdc501c321f95bdcd5c79c0d
|