Hi, assuming you followed some guide to add a custom active response and you configured correctly the script, you should check the active response is being called, maybe the configuration to trigger the active response script is not configured correctly.
1. Increase the verbosity of execd daemon.
Edit the local_internal_options.conf with:
execd.debug=2
VERY IMPORTANT is that once you don't need it, deactivate it, since it generates a high amount of data and can occupy a large part of your storage space, even bringing problems in the future.
2. Restart the Wazuh server/agent you changed the internal option in the previous step.
3. Force the action that should trigger the active response.
4. Ensure the script is executed reviewing the logs of the Wazuh server/agent that runs the active response ( logs/ossec.log ).
For example:
2024/07/22 08:05:22 wazuh-execd[6623] execd.c:256 at ExecdRun(): DEBUG: Executing command 'active-response/bin/custom-ar.py {"version":1,"origin":{"name":"node01","module":"wazuh-execd"},"command":"add","parameters":{"extra_args":[],"alert":{"timestamp":"2024-07-22T08:05:22.650+0000","rule":{"level":5,"description":"File added to the system.","id":"554","firedtimes":1,"mail":false,"groups":["ossec","syscheck","syscheck_entry_added","syscheck_file"],"pci_dss":["11.5"],"gpg13":["4.11"],"gdpr":["II_5.1.f"],"hipaa":["164.312.c.1","164.312.c.2"],"nist_800_53":["SI.7"],"tsc":["PI1.4","PI1.5","CC6.1","CC6.8","CC7.2","CC7.3"]},"agent":{"id":"000","name":"wazuh.manager"},"manager":{"name":"wazuh.manager"},"id":"1721635522.2784","full_log":"File '/tmp/test3' added\nMode: realtime\n","syscheck":{"path":"/tmp/test3","mode":"realtime","size_after":"0","perm_after":"rw-r--r--","uid_after":"0","gid_after":"0","md5_after":"d41d8cd98f00b204e9800998ecf8427e","sha1_after":"da39a3ee5e6b4b0d3255bfef95601890afd80709","sha256_after":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","uname_after":"root","gname_after":"root","mtime_after":"2024-07-22T08:05:22","inode_after":8677611,"event":"added"},"decoder":{"name":"syscheck_new_entry"},"location":"syscheck"},"program":"active-response/bin/custom-ar.py"}}'
Remember to cover all sensitive information in the information you share.
References: