Hi Wazuh Team,
I’m facing an issue with custom Active Response on a Windows agent and would appreciate any guidance.
EnvironmentI have configured a custom Active Response to automatically kill suspicious processes.
The custom Active Response does not execute immediately when the rule is triggered. It only executes after I manually restart the Wazuh Agent service on the Windows endpoint.
Active Response Configuration:I also tested the built-in Active Response using restart-wazuh.exe.
It executes immediately whenever the rule is triggered, confirming that the Active Response subsystem is working.
Custom Active Response BehaviorThe problem is that kill_process.cmd itself is not executed immediately.
Because the CMD file is not triggered, kill_process.exe is also not launched.
However, if I manually restart the Wazuh Agent service, the custom Active Response is executed automatically. The CMD file starts, launches the EXE, and the EXE receives the complete JSON payload successfully.
My QuestionHas anyone experienced custom Windows Active Responses only executing after restarting the Wazuh Agent service?
Is there any known issue or additional configuration required for custom Active Response commands on Windows 4.14.6?
Any suggestions or troubleshooting ideas would be greatly appreciated.
Thank you.
Hi Seeta,
I am not familiar with the executable from your example, kill_process.exe, so I would like to understand how it is implemented. Please make sure it follows the documentation:
There are some known cases where the Active Response executable remains running and blocked, typically while waiting to read from STDIN or write to STDOUT. This usually happens when the handshake is not handled correctly or when messages do not end with \n.
Check the active-responses.log file to confirm whether the script runs or not.
If you are seeing this behavior, please check the following:
Verify in Task Manager whether kill_process.exe is still running as a child process of wazuh-agent.exe.
Review the implementation and confirm that it follows the documentation.
Let me know if you need any further assistance on this.
Hi Nazmur,
Thank you for your response.
The kill_process.exe is a custom Active Response executable that I developed by converting a Python script to an executable using PyInstaller, following the Windows custom Active Response approach. The script reads the alert JSON from STDIN, extracts the required fields (such as the process ID), and performs the configured action.
I also reviewed the Active Response documentation you shared.
Regarding the issue, I observed the following behavior:
I also implemented another custom Active Response (quarantine_file.exe) using the same approach, and it exhibits the exact same behavior. This suggests the issue may not be specific to the kill_process.exe implementation.
I will review my implementation once more to ensure it fully complies with the documentation, particularly the STDIN/STDOUT handling and handshake requirements. I will also check whether the executable remains running as a child process of wazuh-agent.exe and review the active-responses.log during the failure.
I'll share my findings after completing these checks.
Thank you for your guidance.
Can you share the update on this?
Can you check if you can run the executable directly using the active response configuration?
<ossec_config>
<command>
<name>windows-custom-ar</name>
<executable>quarantine_file.exe</executable>
<timeout_allowed>yes</timeout_allowed>
</command>
Ref: Windows custom active response configuration
I look forward to your update.
--
You received this message because you are subscribed to the Google Groups "Wazuh | Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wazuh+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/wazuh/9a6e55ec-cbd6-49b8-8e2b-b93c0962fe15n%40googlegroups.com.
Increasing the RAM on the Wazuh server can solve this problem.
It's possible to use large CDB list files, but there are some things you should keep in mind:
The Wazuh manager uses RAM to hold the whole list in memory for quick lookups. Really huge lists can eat a lot of memory.
If the list gets massive, rule checks might slow down a bit, especially if you have lots of events hitting those rules.
Uploading or managing super-large files through the dashboard or API can sometimes fail or time out.
Let me know if you need any further information.