Wazuh Integration
Enrich your Wazuh SIEM alerts with real-time IP threat intelligence from ipinsights.io.
Overview
Wazuh is a free, open-source XDR and SIEM platform used for threat detection, integrity monitoring, incident response and compliance. By integrating ipinsights.io you can automatically enrich source-IP fields in Wazuh alerts with reputation scores, geolocation, ASN data and blocklist membership — giving analysts the context they need without leaving the console.
The integration uses Wazuh's active-response framework to call the ipinsights.io API whenever an alert fires, writing enrichment data back as a local log that Wazuh can decode and correlate with custom rules.
Architecture Overview
The diagram below shows how data flows through the integration:
- A Wazuh agent detects an event (e.g. failed SSH login) and forwards the alert to the manager.
- The manager triggers the active-response enrichment script for qualifying alerts.
- The script extracts the source IP, queries the ipinsights.io API and writes the enriched result as a JSON log.
- Wazuh's custom decoder parses the enrichment log, and custom rules generate secondary alerts based on threat scores.
Prerequisites
- Wazuh 4.x or later (manager + agent deployed)
- An ipinsights.io API key — available on your profile page (or register for free)
curlandjqinstalled on the Wazuh manager- Outbound HTTPS (port 443) access from the manager to
https://ipinsights.io
Step 1 — Create the Enrichment Script
Create the active-response script on the Wazuh manager at
/var/ossec/active-response/bin/ipinsights-enrich.sh:
Make the script executable:
Step 2 — Register the Active-Response Command
Add the following <command> block inside your
/var/ossec/etc/ossec.conf on the manager:
Step 3 — Configure the Active Response
Still in ossec.conf, add an <active-response> block to trigger the
enrichment script on alerts at or above a chosen rule level:
Adjust <level> to control which alerts trigger enrichment. Level 6 covers
most authentication-related events without being too noisy.
Step 4 — Add a Custom Decoder Optional
Create /var/ossec/etc/decoders/ipinsights.xml so Wazuh can parse the enrichment log:
Step 5 — Add Alert Rules Optional
Create /var/ossec/etc/rules/ipinsights_rules.xml to fire alerts based on
enrichment results:
Step 6 — Restart Wazuh Manager
Apply the changes by restarting the Wazuh manager service:
Check /var/ossec/logs/ossec.log for any configuration errors after the restart.
Verification
After restarting, verify the integration is working:
-
Check the enrichment log — trigger an alert (e.g. a failed SSH login) and
look for output:
tail -f /var/ossec/logs/ipinsights-enrichment.log
-
Test the script manually — pipe a mock alert into the script:
echo '{"parameters":{"alert":{"data":{"srcip":"8.8.8.8"}}}}' | \ /var/ossec/active-response/bin/ipinsights-enrich.sh
-
Verify decoder parsing — use the Wazuh log-test utility:
sudo /var/ossec/bin/wazuh-logtestPaste a sample enrichment log line and confirm the fields are decoded correctly.
-
Check Wazuh dashboard — search for
rule.groups:ipinsightsto see enriched alerts in the UI.
Best Practices
-
Cache API responses — the enrichment script above caches results for one hour
in
/var/ossec/tmp/ipinsights_cache/. This avoids redundant API calls and helps you stay within your rate limit. AdjustCACHE_TTLto suit your environment. -
Handle errors gracefully — always check the
curlexit code and thesuccessfield in the API response before extracting data. Log failures to make troubleshooting easier. -
Be aware of rate limits — the default free-tier limit is
600 requests per hour. If you have a high-volume environment,
consider requesting a higher limit using the form below or adjusting the
<level>threshold in your active-response configuration to reduce the number of enrichments triggered. -
Secure your API key — restrict read access to the enrichment script
(
chmod 750) and consider using Wazuh's/var/ossec/etc/local_internal_options.confor environment variables to store the key outside of the script body. -
Rotate cache periodically — set up a cron job to purge stale cache files:
0 * * * * find /var/ossec/tmp/ipinsights_cache/ -type f -mmin +60 -delete
Optional — Contribute Detections Back
Intelligence is more useful when it flows in both directions. If you'd like to help
grow the dataset, drop the following companion script alongside the enrichment one to
POST high-confidence attacker IPs back to
/api/v1/report. Submissions are weighted by your reporter reputation,
which evolves over time as your reports are corroborated by other intelligence
sources. See the API documentation
for the full list of allowed category tags.
Create /var/ossec/active-response/bin/ipinsights-report.sh:
Register it as a second active-response command, scoped to a higher rule level (e.g.
<level>10</level>) so only high-confidence detections are submitted:
Reciprocal uploads are entirely opt-in. The endpoint refuses private/reserved addresses and rate-limits repeated reports of the same IP from the same key.
Troubleshooting
No enrichment log output
- Confirm the script is executable:
ls -l /var/ossec/active-response/bin/ipinsights-enrich.sh - Ensure ownership is
root:wazuh. - Check
/var/ossec/logs/ossec.logfor active-response errors. - Verify the
<level>threshold — if set too high, alerts may not trigger the script.
API request failures
- Test connectivity from the manager:
curl -I https://ipinsights.io - Verify your API key is valid on your profile page.
- Check for HTTP 429 (rate limit) responses — if frequent, consider increasing your limit.
- Inspect the enrichment log for
API request failedmessages.
Decoder not parsing fields
- Validate the decoder XML:
sudo /var/ossec/bin/wazuh-logtest - Ensure the log format written by the script exactly matches the
<regex>in the decoder. - Add
/var/ossec/logs/ipinsights-enrichment.logas a<localfile>inossec.conf:<localfile> <log_format>syslog</log_format> <location>/var/ossec/logs/ipinsights-enrichment.log</location> </localfile>
Custom rules not firing
- Make sure the rule file is loaded — check
/var/ossec/logs/ossec.logfor XML errors. - Verify rule IDs don't conflict with existing rules (use IDs above 100000).
- Use
wazuh-logtestto confirm the rule triggers against a sample log line.
API Key: You can find your API key on your profile page. Don't have an account yet? Register for free.
Request Higher API Limit
Running a high-volume Wazuh deployment? If the default rate limit isn't enough for your environment, submit a request below and we'll review it.