UNIXDEV

Wazuh threat intelligence: matching MISP IoCs with CDB lists

Match IPs, domains and hashes in Wazuh against MISP indicators: CDB list format, list lookup rules, feeding from the MISP API, IoC hygiene and testing.

By UNIXDEV Team · 19 min read
Original published · English edition

Diagram of MISP exporting filtered IoCs into CDB lists that Wazuh rules match against IPs, domains and hashes in matching events

Wazuh matches events against indicators of compromise with CDB lists: plain-text lists of IP addresses, domains or hashes that a rule looks up using a field from the decoded event. If MISP is your threat-intelligence platform, the approach that uses only built-in Wazuh features is to export its indicators into CDB lists on a schedule and restart the Wazuh manager so it loads them. The alternative is a custom integration that asks MISP about each alert, which is fresher but depends on MISP being reachable to return a result.

An IoC (indicator of compromise) is an observable value tied to known attacker activity, such as the IP address of a command-and-control (C&C) server, a domain used by malware or the hash of a malicious file. Threat intelligence in this article means indicators of that kind, not vulnerability data such as CVE, CVSS or KEV, which our CVE monitoring and patch management guide covers.

This article is for teams that already run Wazuh. If you are still evaluating it, start with what Wazuh is. Rule-file basics, namely local_rules.xml, the rule ID range reserved for your own rules and restarting after a rule change, are in our Wazuh deployment planning guide. Technical details follow the Wazuh 4.14 documentation (4.14.11, released 25 November 2026), checked on 28 November 2026.

In short: (1) A CDB list is a text file with one key per line, a : separator and an optional value. (2) Register each list under <ruleset> in ossec.conf and look it up from a rule with <list>: address_match_key for IPs, match_key for hashes and domains. (3) Wazuh 4.14 loads CDB lists when the analysis engine starts, so a changed list needs a manager restart. (4) The Wazuh documentation has no MISP integration page; your options are your own MISP export into CDB lists, or a custom integration such as the one the MISP project published. (5) Filter indicators in MISP first: to_ids, published, a publication window, warninglists and decaying models. (6) Test with a documentation-range IP and wazuh-logtest.

What a CDB list is and which IoCs it can hold

A CDB list is a plain-text file in which each line holds a unique key followed by a : and an optional value. The Wazuh documentation describes it as a way to keep lists of users, file hashes, IP addresses and domain names, used as allow or deny lists that rules check decoded event values against.

The format rules on the CDB lists page:

  • Keys must be unique; values may repeat. A line can be key:value or just key:.
  • A key that contains colons must be wrapped in quotation marks; the documentation's example is a MAC address, "a0:a0:a0:a0:a0:a0":. It does not describe IPv6 entries, so test IPv6 keys on your own system before relying on them.
  • IP keys can be truncated to cover a range: 192.168.: covers 192.168.0.0/16, 172.16.19.: covers 172.16.19.0/24 and 10.1.1.1: is a single address.
  • The documentation recommends storing lists in /var/ossec/etc/lists.

For IoC lists we recommend using the value after the colon to record provenance, such as the MISP event number or the source name. When an alert fires, the analyst can trace where that indicator came from.

203.0.113.10:misp-event-1234
198.51.100.:misp-event-1250

The second line covers a whole /24. Use truncated keys only when the source says the entire range belongs to the attacker; if in doubt, list individual addresses.

Writing rules that match IoCs from a CDB list

Matching needs three things: a list registered in ossec.conf, a rule whose <list> names the field and the lookup type, and a manager restart so the list is loaded. The usual mistake is choosing a field that is not actually populated in the event, so the rule never fires.

Registering the list in ossec.conf

The ossec.conf ruleset reference takes one <list> entry per list inside <ruleset>, with the path relative to the Wazuh directory and no file extension. This example keeps one list per IoC type; the file names are ours.

<ruleset>
  <list>etc/lists/ioc-ip</list>
  <list>etc/lists/ioc-domain</list>
  <list>etc/lists/malware-hashes</list>
</ruleset>

Add these lines to the existing <ruleset> block rather than creating a second one.

Choosing the field and lookup type

The rules syntax reference says <list> performs a CDB lookup, CDB being "a fast on-disk database which will always find keys within two seeks of the file". The field attribute accepts the static fields srcip, srcport, dstip, dstport, extra_data, user, url, id, hostname, program_name, status and action, or a dynamic field (one a decoder names after the data).

<list> lookup types in Wazuh 4.14 and the IoC types they suit
lookupMatches when / use for
match_key(default) the field value is a key in the list — hashes, domains, any exact value
not_match_keythe field value is not in the list — allow lists, e.g. alert on users not listed
match_key_valuethe key exists and its stored value matches the check_value regex — one list whose values carry a category
address_match_keythe IP is in the list, including truncated range keys — IP addresses
not_address_match_keythe IP is not in the list — IP allow lists
address_match_key_valuethe IP exists and its value matches check_value — IP lists with categories

Example rule for IP addresses

This example is ours. It is a child of Wazuh rule 5710, which matches sshd logs for login attempts with a non-existent user name. The sshd decoder puts the source address in the srcip field, as Testing decoders and rules shows, so the rule raises the level when that address is on the IoC list.

<group name="threat_intel,">
  <rule id="100510" level="10">
    <if_sid>5710</if_sid>
    <list field="srcip"
      lookup="address_match_key">etc/lists/ioc-ip</list>
    <description>sshd: source IP in IoC list</description>
  </rule>
</group>

In production you attach such rules to every log type that carries external addresses. The Wazuh IP reputation proof of concept, for example, uses <if_group>web|attack|attacks</if_group> for web server logs. Pick the field by direction: srcip for the source, dstip for the destination.

File hashes

The CDB lists and threat intelligence page gives an example that follows FIM (File Integrity Monitoring) rules 554 and 550, which fire when a file is added or modified, and checks the md5 field against a list of md5:malware-name lines.

<rule id="110002" level="13">
  <if_sid>554, 550</if_sid>
  <list field="md5"
    lookup="match_key">etc/lists/malware-hashes</list>
  <description>File with known malware hash detected: $(file)</description>
</rule>

That example uses MD5. If your MISP indicators are SHA256, the rule must check the field that holds SHA256 for that event type, which this page does not name; read the field name from a real alert before writing the rule. Logs that may carry several hashes in one value will not match a one-hash-per-line list until the hash is extracted into its own field, which is decoder work. Sysmon is one such source: its documentation says it can record several hash algorithms at once.

Domains

Domains use match_key against a field that holds only the domain name. The documentation describes match_key as matching when the value is present as a key and says nothing about subdomain or wildcard matching, so treat it as an exact match. To catch subdomains, list each name, and lower-case values during export. Logs that carry a full URL need the domain extracted first. A rule outline, following whichever rule decodes your DNS logs (replace the angle-bracket placeholders):

<rule id="100512" level="10">
  <if_sid><your-DNS-log-rule></if_sid>
  <list field="<field-holding-the-domain>"
    lookup="match_key">etc/lists/ioc-domain</list>
  <description>DNS query for domain in IoC list</description>
</rule>

A CDB list used with Linux command auditing through auditd is shown in our Wazuh ransomware detection guide.

When a changed list takes effect

The Wazuh 4.14 CDB lists page states that "CDB lists are built and loaded automatically when the Wazuh analysis engine starts" and that the manager must be restarted whenever a list is added or modified, with systemctl restart wazuh-manager. Indicator freshness is therefore your export interval plus your restart schedule.

The documentation gives no maximum list size; measure how long your manager takes to restart after a list change.

Older guides, such as a 2017 Wazuh blog post written for Wazuh 2.0, still compile lists with ossec-makelists. That step is not in the 4.14 documentation; the ruleset reference states: "Since Wazuh v3.11.0, Wazuh will build and load the CDB lists automatically when the analysis engine starts."

Exporting MISP indicators into CDB lists on a schedule

This approach pulls filtered indicators from the MISP REST API, turns them into key:value lines, replaces the list file and restarts the manager. Matching happens on the Wazuh server itself, so MISP carries no per-event load, and detection continues against the last list even when MISP is unreachable.

The Wazuh 4.14 integrations page covers only Slack, PagerDuty, VirusTotal, Shuffle and Maltiverse, and the Wazuh documentation has no MISP integration page (checked 28 November 2026). The documented basis for this approach is the IP reputation proof of concept: it downloads a public IP list, converts it with Wazuh's iplist-to-cdblist.py script using the Python bundled with Wazuh (/var/ossec/framework/python/bin/python3), sets the owner to wazuh:wazuh, registers the list and restarts the manager. The same steps apply to MISP; only the source differs.

What MISP can export

The MISP automation documentation recommends searching attributes with POST /attributes/restSearch, sending the raw API key in the Authorization header without a Bearer prefix, with Accept: application/json and Content-Type: application/json. The body below is adapted from the documentation's example, switching the output to text and selecting one attribute type at a time.

{
  "returnFormat": "text",
  "type": "ip-dst",
  "published": true,
  "to_ids": true,
  "publish_timestamp": "30d",
  "enforceWarninglist": true,
  "limit": 100,
  "page": 1
}

The "30d" value is shown for readability; a scheduled job should pass a numeric Unix timestamp cutoff, as described in the steps below.

The text format returns bare values, one per line. The MISP OpenAPI specification lists output formats such as json, csv, text, stix2, suricata and snort, but none for Wazuh, so appending the colon and provenance is your own step. To keep event numbers in the value, request json and extract the value and event ID.

Common attribute types in the categories and types reference include ip-src, ip-dst ("A destination IP address of the attacker or C&C server"), domain, hostname, md5, sha1 and sha256. Pair each type with the list and field the rule uses: a list checked against md5 should only receive md5 attributes.

Steps for the scheduled job

  1. Use a MISP account created for this job, with an organisation and role that match the integration's purpose, as MISP advises.
  2. Keep the key in a secret store or a root-only file, never in a URL or a repository, because the OpenAPI specification warns that the key "gives access to the entire database". Keep TLS certificate verification on.
  3. Request every page and merge them before writing. MISP warns that paging over changing data "is not an immutable snapshot", and asks clients to respect rate limits (HTTP 429) and bound retries. Compute the cutoff once at the start of the run as a numeric Unix timestamp and reuse it in publish_timestamp on every page and retry; MISP notes that resolving "30d" per request can shift the selected set between pages.
  4. Convert to value:provenance lines, drop duplicates because keys must be unique, and quote keys that contain colons.
  5. Write to a temporary file, check it is not empty and that its line count is not wildly different from the last run, then move it into /var/ossec/etc/lists/ and set the owner to wazuh:wazuh as the proof of concept does.
  6. Restart the manager in a planned window and keep the previous file for rollback. If the MISP pull fails, keep the existing list and skip the restart.

Rebuild the whole list on every run instead of appending, so indicators that expire or are removed in MISP drop out on their own.

Querying MISP per alert through a custom integration

The other approach has the Wazuh Integrator pass matching alerts to a script that asks MISP whether a value in the alert is a known indicator. New indicators work immediately with no restart, but every alert sent is one API call, and no lookups succeed while MISP is unreachable; a script that queues alerts and retries delivers matches late instead.

Per the Wazuh 4.14 integrations page, the integration name must begin with custom-; the script of the same name lives in /var/ossec/integrations/ with permissions 750 and owner root:wazuh, and its first line declares the interpreter. The script receives the path to the alert JSON file, the api_key and the hook_url as arguments. Alerts can be filtered by rule_id, level, group and event_location; with no filter, "all alerts are sent". Restart the manager after changing the configuration.

The Integrator works on alerts a rule has already produced, not on every raw event. An event no rule matches, or one below the level filter, is never sent to MISP.

The closest example to the source is a MISP project blog post (6 October 2025) using custom-misp_file_hashes.py from the MISP/wazuh-integration repository, adapted from Wazuh's VirusTotal script, to look up file hashes from FIM alerts. Its configuration looks like this:

<integration>
  <name>custom-misp_file_hashes.py</name>
  <hook_url>https://YOUR_MISP_INSTANCE</hook_url>
  <api_key>YOUR_API_KEY</api_key>
  <group>syscheck</group>
  <rule_id>554</rule_id>
  <alert_format>json</alert_format>
</integration>

The post warns that the event holding the hashes must be visible to the user who owns the API key, "otherwise no match will occur", and ships rules for API responses 403, 429 and 500 so a failed lookup is visible rather than silent. Settings such as timeouts, retries or pushing sightings back to MISP are options of that script, not Wazuh features.

The wazuh/integrations repository on GitHub also holds a MISP script whose README credits it as a fork of another user's work and does not say Wazuh supports it. The same README says the script buffers alerts in a local queue while MISP is unreachable. Before using any community script, read whether it verifies TLS certificates and where it keeps the key. The MISP key in <api_key> sits in ossec.conf, so it should belong to an account with the least privilege the job needs.

How the Integrator and alert routing work is covered in the VirusTotal and alert design sections of our Wazuh ransomware detection guide.

Which to choose: scheduled export or per-alert query

If every event that matches a rule should be checked and detection must survive a MISP outage, export to CDB lists. If you only need to ask MISP about significant alerts and want new indicators without a restart, use a custom integration. The two can be combined.

Two ways to feed MISP indicators into Wazuh
AspectExport to CDB listsQuery MISP per alert
Events checkedevery event matching the parent of the <list> ruleonly alerts that pass the Integrator filter
New indicators take effectafter the next export and manager restartas soon as they are in MISP and visible to the account
Load on MISPone set of requests per exportone request per alert sent; may hit 429 rate limits
When MISP is unreachablestill matches against the last listno lookups succeed during the outage; a script that queues alerts and retries delivers matches late instead
What you maintainthe scheduled job, list files and restart windowsthe script, API key permissions and error rules

Set the export interval from how often your indicators change and how often you can restart the manager.

Keeping indicators fresh and avoiding false positives

Indicators age. An address once used by an attacker may be reassigned, and CDN or cloud addresses are shared by many sites. We recommend filtering in MISP before export rather than disabling rules afterwards.

Export only values meant for detection

MISP's to_ids flag means "Whether this occurrence is intended for detection/export", and the categories and types reference adds that a type's default "is a suggestion, not a verdict". The MISP user guide advises leaving it off for reference links, narrative context and values not yet assessed. Export only attributes with to_ids and published set to true. The automation documentation notes that the text format defaults to this when the filters are omitted, but we recommend stating them in the body.

Set an indicator lifetime

publish_timestamp limits results to events published within a window, such as 30d in the example. This filters on when the event was published, not when the indicator was created or observed. MISP warns that republishing an old event brings all of its eligible attributes back into the recent set; for age based on observation, use a decaying model (below).

MISP documents last as a legacy alias for this filter; use publish_timestamp in new clients. The right window is a policy decision for your organisation; no single value fits every system.

A finer tool is MISP's decaying of indicators: each attribute's score falls over time from a base score derived from taxonomy tags until it reaches zero at the end of its lifetime, and a new sighting resets it to the base score. With a model configured, add excludeDecayed to restSearch to "Filter out all expired IOCs" before they reach Wazuh.

Exclude shared infrastructure

MISP warninglists are "lists of well-known indicators that can be associated to potential false positives, errors or mistakes". The false_positive category includes RFC 1918 private ranges and public DNS resolvers; the known category is for when "the value belongs to shared or multi-tenant infrastructure", such as cloud and CDN ranges, URL shorteners and VPN providers.

Add enforceWarninglist to restSearch to drop warninglist hits from the export, but MISP cautions that "A missing match is not a guarantee of safety": a shared-hosting address absent from every warninglist can still cause false alerts. We recommend keeping your own allow list of addresses and domains the organisation uses, such as its regular cloud and SaaS services, and checking exported indicators against it.

Know where every line came from

Keep the event number or source name in each CDB value, as suggested earlier. When an indicator causes false alerts, fix it at the source in MISP, for example by clearing to_ids or adding it to your own warninglist, and let the next export apply the change. Hand edits to the list file on Wazuh are overwritten on the next run.

Testing that a rule matches with wazuh-logtest

Test with an indicator you create from a documentation address range, never with real malicious addresses or files. RFC 5737 reserves 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 for documentation and says they "SHOULD NOT appear on the public Internet", which makes them suitable test indicators that should not match real traffic.

wazuh-logtest tests rules and decoders against sample log lines in a wazuh-analysisd sandbox and reports three phases, pre-decoding, decoding and filtering, the last showing the rule ID, level and whether an alert would be generated. The logtest documentation does not say whether an edited CDB list is picked up without a restart, so restart the manager first and then test. How to read each phase, test decoders and re-test after upgrades is covered in our guide to custom Wazuh decoders and rules for application logs.

  1. Add the line 192.0.2.10:test-ioc to ioc-ip (or to a separate test list) and restart the manager.
  2. Run /var/ossec/bin/wazuh-logtest and paste an sshd line adapted from the example in Testing decoders and rules, with the address replaced by the test IP.
    Oct 15 21:07:00 linux-agent sshd[29205]: Invalid user blimey from 192.0.2.10 port 48928
  3. Check that phase 2 shows the sshd decoder with srcip 192.0.2.10, and that phase 3 now shows rule 100510 at level 10 instead of rule 5710. If it still shows 5710, check the list path in ossec.conf and that the restart happened.
  4. Remove the test line from the production list afterwards, or keep it in a test list recorded in your runbook.

For automated checks in the scheduled job, use -U 100510:10:sshd, which the documentation says returns a zero exit status when the result matches the given rule ID, level and decoder name, and which works with one log line. The -v option shows which rules were evaluated; the documentation calls it "the key option to troubleshoot a rule or decoder problem".

For hashes, the MISP project post tested with hashes of the harmless EICAR test file, so there is no need to download real malware. End-to-end detection testing is covered in our Wazuh ransomware detection guide.

Status as of 2026-11-28: Wazuh and MISP versions

These facts change with releases; check the source pages before relying on them.

Versions and status relevant to IoC matching, checked on 2026-11-28
ItemStatus per the source pageSource
Wazuh4.14.11 released 25 November 2026 (4.14.10 on 5 November 2026); this article cites the 4.14 documentationWazuh release notes
CDB list loadingbuilt and loaded when the analysis engine starts; restart the manager after adding or changing a listCDB lists (4.14)
MISP integration in Wazuh docsno dedicated page; built-in integrations are Slack, PagerDuty, VirusTotal, Shuffle and MaltiverseIntegration with external APIs (4.14)
Wazuh 5.0documentation is still a release-candidate set marked as under development; it describes IoC matching built into the ruleset, fed by Wazuh's CTI service; MISP is not mentioned thereWazuh 5.0-rc — Threat intelligence
MISP2.5.53 released 23 November 2026 (hotfix); the v2.4.221 release notes (17 September 2026) say 2.4 has been end of life since the start of the yearMISP releases · v2.4.221
Wazuh and MISP exampleMISP project post of 6 October 2025: a custom integration that looks up hashes from FIM alertsMISP project blog

This article applies to Wazuh 4.x. If you plan to move to 5.0 once it is released, check its documentation for how existing CDB lists and rules carry over.

Checklist before enabling IoC matching

  • One list per IoC type (IP, domain, each hash algorithm), each paired with a field that is actually populated in the events.
  • Rule IDs in the range reserved for your own rules, per our deployment planning guide.
  • Export only to_ids and published attributes, set a publish_timestamp window from a cutoff computed once per run (it is publication time, not observation time) and enable enforceWarninglist.
  • Provenance in every value; rebuild the whole list on each run.
  • An allow list of the organisation's own addresses and domains, checked before export.
  • A dedicated API key in a root-only file or secret store, with TLS certificate verification on.
  • A planned manager restart after each export, and the previous list kept for rollback.
  • A test with an RFC 5737 address in wazuh-logtest, and -U in the scheduled job.
  • Alert-only first; consider active response only once you have seen that no shared infrastructure slips through.

How UNIXDEV can help

UNIXDEV installs Wazuh, tunes rules to reduce false positives and maintains the system within the agreed maintenance (MA) scope. For this topic that means rule tuning, including CDB lists and IoC rules that fit the logs you send to Wazuh, tested with wazuh-logtest before go-live. Baseline work such as patch cycles and backups sits in our DevOps & SRE Managed Services. Incident response and digital forensics after an incident should go to specialists in that field.

Sources and further reading

Sources checked on 2026-11-28

How we checked: based on the primary sources above, reviewed by the UNIXDEV team

Continue reading