Hello John!
I don't know if you have managed to get this to work, but since there is no solution written here and since I have managed to get this to work I will post how I did it.
As was mentioned here before first you need to setup a new localfile path for siem.py results to be collected by log collector. In ossec.conf on manager add:
<localfile>
<location><path_to_result.txt>result.txt</location>
<log_format>json<log_format>
</localfile>
Then I have created a simple rule just to match "blocked due to category" alerts from Sophos to get them logged into alerts.json.
Then you need to create new wodle in ossec.conf to run siem.py. And here is the tricky part. If you will just write <command>/bin/python3.7 <path_to_script>siem.py</command> - it will fail because there are dependent scripts that are being used by siem.py. I assume this is why exit code 1 generates.
So what I did is I have created a simple bash script with following content:
#!/bin/bash
cd <path_to_siem.py> && /bin/pyhton3.7 <path_to_siem.py>siem.py
Then just add "<command>/bin/bash <path_to_bash_script>script.sh</command>" to your wodle and that should work.
Hope this will be helpful for you.
среда, 4 января 2023 г. в 07:16:15 UTC+2, John Carry: