Hello Sau,
Thank you for posting in the community.
It seems that your configurations are correctly applied.
Active-Response, passes to the script in a JSON line which contains the entire alert. Having said that, when you write an Active-Response Script you need to extract the desired information from the alert in order to execute your custom actions.
Writing Active-Response scripts for Windows agents could be tricky because it does not accept PowerShell scripts natively. This can be an issue since Powershell is more flexible and it has a lot of features that can be useful in these cases.
The good news is that we can “embed” a PowerShell code into a cmd batch file.
You can see more discussion about this issue here: Wazuh Issue
To help you accomplish this, I wrote this Active-Response script that will disable (or enable if it is a rollback action) Windows Local accounts: disable-account-win.cmd
<command> <name>disable-account-win</name> <executable>disable-account-win.cmd</executable> <timeout_allowed>yes</timeout_allowed> </command> <active-response> <command>disable-account-win</command> <location>local</location> <rules_id>100002</rules_id> <timeout>600</timeout> </active-response>With this configuration, the local user will be disabled when a 100002 alert is raised and it will be enabled again after 600 seconds.
I hope this information could be helpful.
Hi,
I’d like to revisit this topic. Has anyone managed to create an Active Response that blocks a user in AD?