There is already an issue open regarding this. I believe this will take some time.
https://github.com/wazuh/wazuh/issues/3130For now, as a workaround, you can use the agent name inside the <hostname>Agent_name</hostname> filed in rules to trigger an alert based on the agent name.
Ex:
<group name="test_group,">
<rule id="107101" level="12">
<if_sid>5501</if_sid>
<hostname>ubuntu20</hostname>
<description>Successful login from $(hostname) server.</description>
<group>login_time,pci_dss_10.2.5,pci_dss_10.6.1,gpg13_7.1,gpg13_7.2,gdpr_IV_35.7.d,gdpr_IV_32.2,hipaa_164.312.b,nist_800_53_AU.14,nist_800_53_AC.7,nist_800_53_AU.6,</group>
</rule>
</group>
Using the help of the CDB list you can create a list of agents with agent_name and use this list in your rule to trigger alerts.
<group name="test_group,">
<rule id="107101" level="12">
<if_sid>5501</if_sid>
<list field="hostname">etc/lists/linux-servers</list>
<description>Successful login from $(hostname) server.</description>
<group>login_time,pci_dss_10.2.5,pci_dss_10.6.1,gpg13_7.1,gpg13_7.2,gdpr_IV_35.7.d,gdpr_IV_32.2,hipaa_164.312.b,nist_800_53_AU.14,nist_800_53_AC.7,nist_800_53_AU.6,</group>
</rule>
</group>If you need help creating a CDB list please check this:
https://documentation.wazuh.com/current/user-manual/ruleset/cdb-list.htmlCheck this document to learn more about creating and configuring custom rules:
https://documentation.wazuh.com/current/user-manual/ruleset/rules/custom.htmlhttps://documentation.wazuh.com/current/user-manual/ruleset/ruleset-xml-syntax/rules.htmlLet me know if this works for you.