Hello John,
Yes, there is need to create custom rules by modifying the agent's config file in order to collect some special event logs.
If you were to use a Wazuh Agent to collect these events, you would need to set the correct location to your localfile module.
To get the correct location, you need to go to the Windows Event viewer, search for the event you're attempting to ingest, open it and check its Details in XML view. There the field channel contains the location you need to set.
For example, in order to fetch events with eventID = 4672, you would need to set a localfile module with "Security" as location. Check that you have it correctly configured in the windows agent.
On the other hand, check the ossec.log file of the agent that is generating this event to confirm that there is no error when connecting to the security channel.
Finally, to confirm that the event is reaching the manager for correct decoding and correlation with the rule, activate <logall_json>yes</logall_json> in your manager. For this, go to the file /var/ossec/etc/ossec.conf and activate the option:
<ossec_config>
<global>
<jsonout_output>yes</jsonout_output>
<alerts_log>yes</alerts_log>
<logall>no</logall>
<logall_json>yes</logall_json>
. . .
</global>
After this, check if the alerts are generated correctly from the events, if the alerts are not generated you should review the rules, you can test if an alert will be generated using wazuh-logtest
Then, run filebeat test output to see if filebeat is properly sending the alerts to wazuh-indexer.
Then check if the indices in wazuh-indexer are being created correctly:
curl -XGET -k
https://localhost:9200/_cat/indices?pretty -u admin:password
There should be a wazuh-alerts-* index for each day and there must not be red indices.
Also check the health of your wazuh-indexer cluster:
curl -XGET -k
https://localhost:9200/_cluster/health?pretty -u admin:password
If the indices are not showing correctly maybe there is a connection problem between your wazuh-indexer and filebeat, or wazuh-indexer is taking too long indexing the data due to a high volume of alerts and not having enough resources
Also, if everything else seems correct check if wazuh-dashboard cannot retrieve the information from the indexer due to a connection or authentication issue.
Then, restart the manager and check that you get this alert is in your /var/ossec/logs/archives/archives.json file. This way you can confirm that this event has occurred in the agent and has been retrieved by the manager.
Remember to disable the logall option after you are done cause they can use a lot of disk space.
Regards,