Reload agent labels on agent reload#32838
Merged
Merged
Conversation
8b48837 to
fa20724
Compare
cborla
reviewed
Oct 27, 2025
cborla
approved these changes
Oct 27, 2025
Member
cborla
left a comment
There was a problem hiding this comment.
LGMT
- Code changes reviewed
- Relevant evidence provided
- Tests cover the new functionality
- Configuration changes documented
- Developer documentation reflects the changes
- Meets requirements and/or definition of done
- No unresolved dependencies with other issues
fa20724 to
b28855c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 pull request addresses issue #32817 by ensuring agent labels are reloaded when the agent reloads, alongside the client buffer reload.
Proposed Changes
Results and Evidence
This is the base configuration:
{ "data": { "labels": [ { "value": "Value A", "key": "A", "hidden": "no" } ] }, "error": 0 }After modifying
agent.confthrough the interface (XML):Then the agent log shows a reload event:
A subsequent configuration query returns the expected label information in JSON format:
{ "data": { "labels": [ { "value": "Value A", "key": "A", "hidden": "no" }, { "value": "Value B", "key": "b", "hidden": "no" } ] }, "error": 0 }Additionally, the alerts show the updated labels set:
Alert
{ "_index": "wazuh-alerts-4.x-2025.10.27", "_id": "ike4JZoBnkVPBbkqnR0l", "_version": 1, "_score": null, "_source": { "syscheck": { "uname_after": "root", "mtime_after": "2025-05-07T08:23:19", "size_after": "55", "gid_after": "0", "mode": "realtime", "path": "/root/test/s6/aarch64/command/seekablepipe", "sha1_after": "da39a3ee5e6b4b0d3255bfef95601890afd80709", "gname_after": "root", "uid_after": "0", "perm_after": "rwxrwxrwx", "event": "deleted", "md5_after": "d41d8cd98f00b204e9800998ecf8427e", "sha256_after": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "inode_after": 393964 }, "input": { "type": "log" }, "agent": { "ip": "127.0.0.1", "name": "Rocket-old", "id": "002", "labels": { "A": "Value A", "b": "Value B" } }, "manager": { "name": "wazuh.manager" }, "rule": { "mail": false, "level": 7, "pci_dss": [ "11.5" ], "hipaa": [ "164.312.c.1", "164.312.c.2" ], "tsc": [ "PI1.4", "PI1.5", "CC6.1", "CC6.8", "CC7.2", "CC7.3" ], "description": "File deleted.", "groups": [ "ossec", "syscheck", "syscheck_entry_deleted", "syscheck_file" ], "nist_800_53": [ "SI.7" ], "gdpr": [ "II_5.1.f" ], "firedtimes": 835, "mitre": { "technique": [ "File Deletion", "Data Destruction" ], "id": [ "T1070.004", "T1485" ], "tactic": [ "Defense Evasion", "Impact" ] }, "id": "553", "gpg13": [ "4.11" ] }, "location": "syscheck", "decoder": { "name": "syscheck_deleted" }, "id": "1761569447.2887016", "full_log": "File '/root/test/s6/aarch64/command/seekablepipe' deleted\nMode: realtime\n", "timestamp": "2025-10-27T12:50:47.002+0000" }, "fields": { "syscheck.mtime_after": [ "2025-05-07T08:23:19.000Z" ], "timestamp": [ "2025-10-27T12:50:47.002Z" ] }, "sort": [ 1761569447002 ] }Artifacts Affected
wazuh-agentd(UNIX)wazuh-agent.exe(Windows)Configuration Changes
No configuration changes required.
Documentation Updates
Not applicable.
Tests Introduced
This functionality should be validated through system tests.
Valgrind
Review Checklist