Hello Miran Ul Haq, with some small modifications, the user field can be added to the existing rules, you may check them and add them to your local_rules.xml file to see them in action, here we have both examples:
<rule id="5902" level="8" overwrite="yes">
<match>^new user|^new account added</match>
<description>New user: $(dstuser) added to the system.</description>
<mitre>
<id>T1136</id>
</mitre>
<group>pci_dss_10.2.7,pci_dss_10.2.5,pci_dss_8.1.2,gpg13_4.13,gdpr_IV_35.7.d,gdpr_IV_32.2,hipaa_164.312.b,hipaa_164.312.a.2.I,hipaa_164.312.a.2.II,nist_800_53_AU.14,nist_800_53_AC.7,nist_800_53_AC.2,nist_800_53_IA.4,tsc_CC6.8,tsc_CC7.2,tsc_CC7.3,</group>
</rule>
<rule id="5903" level="3" overwrite="yes">
<match>^delete user|^account deleted|^remove group</match>
<description>Group (or user $(dstuser)) deleted from the system.</description>
<mitre>
<id>T1531</id>
</mitre>
<group>pci_dss_10.2.7,pci_dss_10.2.5,pci_dss_8.1.2,gpg13_4.13,gdpr_IV_35.7.d,gdpr_IV_32.2,hipaa_164.312.b,hipaa_164.312.a.2.I,hipaa_164.312.a.2.II,nist_800_53_AU.14,nist_800_53_AC.7,nist_800_53_AC.2,nist_800_53_IA.4,tsc_CC6.8,tsc_CC7.2,tsc_CC7.3,</group>
</rule>
Keep in mind that overwrite=yes is being used to overwrite the existing rules because these ones add the missing field that you requested, once you add them, you may save the file, restart your manager by typing
systemctl restart wazuh-manager and you'll be ready to use them immediately, for more information on how you can create custom ruleset or modify the existing wazuh ruleset, you may refer to the following article:
https://wazuh.com/blog/creating-decoders-and-rules-from-scratch/
Have a great day!