Port commit from wazuh/wazuh - WMI, WMA APIs Integration for Retrieving Installed Windows Updates #372
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces the integration of the Wazuh agent with both the WMI and WMA APIs to retrieve a comprehensive list of installed Windows updates. The retrieved update data will seamlessly merge into the existing Syscollector inventory to provide a more complete view of system updates.
To avoid the following issue, I have to split the CMake test into two different executables, as you will see in the CMakeLists.txt.
Redefinitions error
Click here for more details
Tests
Package
Workflow package generated: https://github.com/wazuh/wazuh-agent/actions/runs/14421410127
Link to the package: https://github.com/wazuh/wazuh-agent/actions/runs/14421410127/artifacts/2933099653
To test it, I used the mock-server with the following command:
Copy the Wazuh agent configuration to enable connection to the mock-server.
wazuh-agent-windows.yml
Note: Remove any unnecessary fields from the inventory.
Enroll wazuh-agent:
Connect wazuh-agent with the server:
To get hotfixes from the mock server, I capture the output to an
aux.txt
file, and after a while, I filter the hotfixes:Hotfixes windows 10