To be effective/efficient, the "keep or drop" decision needs to take place on the agent
before collection, and not on the server. If performed on the server, it is already "too late". The endpoint would have been kept very busy forwarding tons of 4658 events that are overwhelmingly useless noise.
Windows generates an incredible volume of 4658 (handle closed) events, which unlike the 4656 (handle open) do not include the object name, only the handle ID.
On the agent, the cycle would be as follows:
- Push the handle ID of 4656 events forwarded to the server into a local dynamic handle ID lookup list (which could be maintained in memory, not on disk).
- For 4658 events, check for the presence of the handle ID in the handle ID lookup list:
- If present, collect the 4658 event, and delete the handle ID from the list.
- If handle ID is not present in the handle ID lookup list, drop the event.
The handle ID is randomly generated on the endpoint. Should the keep/drop decision be made on the server, the list must then include both the Handle ID and the Agent ID or name, as randomness is per endpoint, and not across endpoints.
I know the capability is currently not there, neither on the agent nor on the server.
Question is two-fold:
1.- Is it technically feasible/doable on the Windows agent side?
2.- If the answer to 1 is yes, will Wazuh look into adding it as a feature sometime in the future?