Hi everyone, First time using github, i'm sorry if not using the right way to communicate in it.
For my 3rd year internship to validate my bachelor's degree, 'm currently working on an integration project between Wazuh and MISP, with the goal of automatically sending a Wazuh alert when a known IOC is detected on a machine (e.g., a ping from a malicious domain). ⚙️ Context:
Problem: Most of the time, no alerts like those found via MISP are returned.
But randomly, sometimes I'm getting an IOC alert based on the domain I pinged, without understanding why or where it's coming from. It's inconsistent and impossible to reproduce.
Here's my setup for the integration:
- The Python integration script: https://github.com/karelumair/MISP-Wazuh-Integration/blob/main/custom-misp.py
- Wazuh configuration (ossec.conf) :
#<!------------------------MISP INTEGRATION------------------------>
<integration>
<name>custom-misp.py</name>
<hook_url>Misp IP server</hook_url>
<api_key>Misp IP Key</api_key>
<group>sysmon_event1,sysmon_event3,sysmon_event6,
sysmon_event7,sysmon_event_15,sysmon_event_22,syscheck</group>
<alert_format>json</alert_format>
</integration>
-Alerts rules for MISP :
<rule id="100620" level="10">
<field name="integration">misp</field>
<match>misp</match>
<description>MISP Events</description>
<options>no_full_log</options>
</rule>
<rule id="100621" level="5">
<field name="misp.error">\.+</field>
<description>MISP - Error connecting to API</description>
<options>no_full_log</options>
<group>misp_error,</group>
</rule>
<rule id="100622" level="12">
<field name="misp.category">\.+</field>
<description>MISP - IoC found in Threat Intel - Category: $(misp.category), Attribute: $(misp.value)</description>
<options>no_full_log</options>
<group>misp_alert,</group>
</rule>
Strange symptoms:
Then tried to get around the problem by going through OpenCTI for this I used this github link : https://socfortress.medium.com/wazuh-siem-opencti-threat-intel-integration-4cb1a3810250 :
But again, it doesn't work. I'm getting this kind of errorr in the logs:
2025/05/21 10:15:15 wazuh-integratord: ERROR: While running custom-opencti.py -> integrations. Output: KeyError: 'queryName'
2025/05/21 10:15:15 wazuh-integratord: ERROR: Exit status was: 1
2025/05/21 10:15:15 wazuh-integratord: ERROR: While running custom-opencti.py -> integrations. Output: KeyError: 'data'
2025/05/21 10:15:15 wazuh-integratord: ERROR: Exit status was: 1
In summary, what I am looking for today: