Skip to main content

MISP

MISP is where many teams keep and share their threat intelligence: events, attributes, objects, galaxies and the analysts' notes and opinions on them. Connect your MISP to Huntbase once and that one connection does two things:

  • Ingest. Huntbase polls MISP and brings its attributes into your organisation's private intel store as indicators, so they are matched against your telemetry. See Ingest MISP indicators.
  • Query in place. You, your hunts and Scout search MISP where it is, in MispQL, the SQL-like language from the MISP project. Nothing is copied out of MISP to answer a query, and Huntbase never changes anything in MISP.

Both use the same server URL and auth key. Querying needs api mode: a published MISP feed (feed mode) can be ingested but not queried.

Before you start​

You need:

  • a MISP server whose web API Huntbase can reach over HTTPS;
  • a MISP user for Huntbase that can see the events you want to hunt in;
  • an auth key for that user that can only read.

MISP answers every query as the key's user, so Huntbase sees exactly what that user may see, and never more. Huntbase only ever searches: it never creates, edits or deletes anything in MISP.

tip

Give Huntbase its own MISP user rather than reusing an analyst's key, so you can see its activity in MISP's logs and revoke it on its own.

How you make the key read-only depends on your MISP version.

MISP 2.4 and 2.5: a read-only key​

  1. Sign in to MISP as the user Huntbase will act as.
  2. Open Administration › List Auth Keys and select Add authentication key.
  3. Tick Read only. Optionally, restrict the key to the IP addresses Huntbase connects from.
  4. Copy the key. MISP shows it only once.

Huntbase queries these servers with classic search; see Which MISP versions.

MISP 3.0: a read-only role with Complex query​

For the full MispQL language, the key's role needs the Complex query permission. MISP turns it off for every role until an administrator turns it on, and it doesn't apply to keys marked Read only. So on MISP 3.0, make the role read-only instead of the key:

  1. As a site administrator, open Administration › List Roles and add a role for Huntbase, or edit the one its user has.
  2. Set its permission level to Read Only and tick Complex query. Save.
  3. Give Huntbase's user that role.
  4. Sign in as that user, open Administration › List Auth Keys and select Add authentication key. Leave Read only unticked, and optionally restrict the key to the IP addresses Huntbase connects from.
  5. Copy the key. MISP shows it only once.

The role keeps the key read-only. A key marked Read only still works on MISP 3.0, but only in classic mode, and the connection check says so. Don't use a site administrator's key: a read-only role with this one extra permission is enough.

Connect MISP​

  1. Go to Connections, click Add connection and pick MISP Threat Intelligence. You can also start from Threat intel › Threats & indicators › Feeds with Add feed › MISP feed.
  2. On Details, choose the Owner and name the connection.
  3. On Connect, set Mode to API (ingest and query), enter the MISP URL, such as https://misp.example.org, choose the Auth Key method and paste the key.
  4. Under Advanced, leave Query Mode at Automatic unless you have a reason to change it.
  5. On Verify, click Create & check.

Settings​

FieldNotes
MISP URLThe server's base URL in api mode, such as https://misp.example.org. In feed mode, the feed URL that serves manifest.json.
ModeAPI (ingest and query) ingests and queries with an auth key. Feed (ingest only) reads a published MISP feed, needs no credentials, and can't be queried.
Verify TLSOn by default. Turn it off only for a server with a self-signed certificate.
Query ModeUnder Advanced. How Huntbase runs MispQL: Automatic (the default), Classic or Complex. See Query mode.
Tag Filter, Published Events Only, Minimum Threat Level, Poll IntervalWhat ingestion brings in and how often. They don't filter queries.

The connection check​

Create & check, and Check again on the connection page later, sign in to MISP with the key and ask it three read-only questions: which version it runs, whose key it is, and whether that key may run complex queries. The result says which version and query mode the connection uses, and why:

The check saysWhat it means
MISP 3.0.1 (role Read Only, Example Org): complex mode, full MispQL.The full MispQL language is available.
MISP 3.0.1 (…): classic mode. The key's role lacks the Complex query permission: give the role that permission for full MispQL.MISP 3.0, but the role can't run complex queries yet. Give it the permission, then Check again.
MISP 3.0.1 (…): classic mode. This key is marked read-only, and MISP 3.0 then disables complex queries: use a normal key on a read-only role for full MispQL.Make a new key with Read only unticked, for a user on a read-only role with Complex query. See MISP 3.0.
MISP 2.5.53 (…): classic mode. Full MispQL needs MISP 3.0.The subset of MispQL that maps to classic search is available. See Which MISP versions.
MISP 3.0.1 (…): Query Mode is set to Complex, but MISP does not run complex queries for this key (…). Statements with a WHERE will fail: set Query Mode to Automatic or Classic.Query Mode is Complex, but the server or key can't run complex queries.
MISP rejected the auth key.Check the key, that it hasn't expired or been disabled, and that its IP restriction allows Huntbase.
This URL does not answer like a MISP server …Check the MISP URL: use the server's base URL, such as https://misp.example.org.
MISP did not answer in time. / Could not reach MISP.Check the URL, the port and Verify TLS, and that your firewall lets Huntbase in.
MISP 2.5.53 (…): classic mode (set on the connection).Query Mode is Classic.
Querying MISP needs api mode …The connection is in Feed (ingest only) mode. Ingestion still works; to query, set Mode to API (ingest and query) and add an auth key.

The check names the key's role and organisation, so you can see which MISP user Huntbase acts as. The key itself is never shown or written to a log.

When the check passes, the result reads Connection verified. followed by the version and mode line, such as Connection verified. MISP 2.5.53 (role Read Only, Example Org): classic mode. Full MispQL needs MISP 3.0.

After the check passes, Huntbase lists the tables the key can query, each with its fields, on the connection page's Data tab and in the query tab's Schema tree. In complex mode they are MISP's own tables and fields, leaving out any the key may not read; in classic mode they are the four classic tables and the fields classic search takes. SHOW TABLES and DESCRIBE in a query tab give the same answer.

Query MISP in MispQL​

In a query tab, pick MispQL and your MISP connection, then ask MISP a question the way you would ask a database:

SELECT id, event_id, type, value, Tag FROM attributes
WHERE type IN ('domain', 'ip-dst') AND tags != 'tlp:red'
LIMIT 100
  • Each record MISP returns is one row, with the columns you selected. Dots reach into nested data, such as Event.info, and Tag is one cell of tag names separated by commas.
  • On attributes, events, objects and event_reports, when the query has no condition on timestamp, the time-range pill's window is added as one. Put a condition on timestamp in the query to set the window yourself, or timestamp >= 0 to search all time.
  • Next to a Tag column, rows also get a tlp column: the most restrictive tlp:* tag, read the same way as ingestion reads it.
  • A query returns at most 10,000 rows. When it stops there, the run says so: narrow the WHERE or add a LIMIT.
  • The connection ships with six templates in Content library › Queries, starting with Look up indicators in MISP. See Starter templates.

The MispQL reference covers tables, fields, operators, relative times, paging, counting and discovery.

Run STIX patterns against MISP​

A MISP connection also answers STIX patterns, so indicator sweeps and searches of every connected tool include your MISP. Huntbase translates each pattern into MispQL on attributes, using the MISP attribute types the MISP project's own STIX converter uses:

[ipv4-addr:value = '198.51.100.23'] OR [file:hashes.'SHA-256' = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855']

IP addresses, domains, URLs, email addresses and messages, file names and hashes, certificates, registry keys, mutexes, JA3 hashes and any MISP attribute by its own fields (x-misp-attribute) are covered. See STIX patterns on MISP for the full list of supported types and what is refused.

Which MISP versions​

Huntbase supports MISP 3.0 and the long-term MISP 2.4 and 2.5 releases. What you can ask depends on what the server can answer exactly.

MISPQuery modeWhat you get
3.0 and later, role with Complex queryComplexThe full MispQL language, on every table.
3.0 and later, without the permission or with a key marked Read onlyClassicThe classic subset below, until you grant the permission or replace the key.
2.4 and 2.5ClassicThe classic subset below.

The classic subset​

On classic search, Huntbase turns a MispQL statement into MISP's classic search parameters, and runs it only where the parameters mean exactly the same as the statement. Classic search serves four tables: attributes, events, objects and galaxy_clusters.

You can useNotes
Conditions joined by ANDOne condition per field, apart from time ranges.
= and IN (…)On every field in the table below, apart from to_ids and published, which take = TRUE, = FALSE or !=. a = 'x' OR a = 'y' on the same field counts as a IN ('x', 'y').
!=, NOT IN and NOTWhere MISP supports negation: value, type, category, tags, org, eventinfo and event_id on attributes; id, event_id, uuid, eventinfo, org and tags on events; event_id, org and tags on objects. NOT works around one condition or a same-field OR.
LIKE, NOT LIKEWith % at the start, the end or both, on value and eventinfo of attributes and events (NOT LIKE not on event value), and LIKE on galaxy cluster value and tag_name.
Time ranges>=, <=, >, < and = on timestamp, event_timestamp and publish_timestamp, as Unix times or relative times such as '7d' (relative times take >= and <= only). On events, date takes >= and <= with 'YYYY-MM-DD', or >= with a number of days such as '30d'.
ORDER BY, LIMIT, OFFSET, COUNT(*)As in complex mode. On objects and galaxy clusters, MISP 2.x can't count, so Huntbase counts by paging through, up to 10,000.
SHOW TABLES, DESCRIBEThey list the four classic tables and the fields and operators classic search takes.

The fields each classic table takes:

TableFields
attributesvalue, type, category, tags, org, eventinfo, event_id, uuid, object_relation, threat_level_id, to_ids, published, timestamp, event_timestamp, publish_timestamp
eventsid, event_id, uuid, eventinfo, org, tags, threat_level_id, published, timestamp, event_timestamp, publish_timestamp, date, and value, type and category for events holding a matching attribute
objectsobject_name, object_template_uuid, uuid, event_id, org, tags, published, timestamp, event_timestamp, publish_timestamp, value, type, category
galaxy_clustersid, uuid, galaxy_id, galaxy_uuid, version, distribution, org_id, orgc_id, tag_name, value, type

Refused, never widened​

MISP 2.4 and 2.5 don't refuse a condition they can't read: they ignore it and answer as if it weren't there. So Huntbase checks every statement before sending it in classic mode, and refuses anything classic search can't answer exactly, with a message that points at the part of the query it is about:

Line 1, column 32: OR across different fields needs MISP 3.0 complex queries
SELECT * FROM attributes WHERE type = 'domain' OR value = 'evil.example.com' LIMIT 10
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Huntbase never drops a condition and runs the rest, and never filters rows itself to make up for one. What classic mode refuses:

  • OR across different fields, and OR of anything but = or IN;
  • NOT around an AND group;
  • two values for one field joined by AND, such as tags = 'a' AND tags = 'b';
  • < and > on ids and numbers, and operators a field doesn't take (see above);
  • a value with % at the start or end outside LIKE (anywhere, on galaxy clusters), and a value starting with !, which MISP 2.x would read as a wildcard or a negation;
  • fields classic search has no parameter for, which the message lists;
  • the tables event_reports, notes, opinions, relationships, collections, tags and organisations.

Rewrite the query within the subset, split it into several queries, or move to MISP 3.0 and grant Complex query.

Query mode​

Query ModeBehaviour
AutomaticThe default. Huntbase asks MISP whether it runs complex queries, remembers the answer for ten minutes (Check again asks afresh, for example after an upgrade or a role change), and uses complex mode when it can, classic mode otherwise. If MISP 3.0 refuses a complex query because the role lacks the permission, the query runs in classic mode instead, with a note that says why.
Classic (MISP 2.4 / 2.5 restSearch)Always classic search, even on MISP 3.0. Use it to keep queries within the subset that also runs on your older MISP servers.
Complex (MISP 3.0, full MispQL)Always complex queries. On a server or key that can't run them, the query fails with MISP's error instead of falling back.

When a query runs in classic mode under Automatic, the run shows a note such as Classic mode: this MISP has no complex queries (MISP 3.0 adds them), using classic mode.

Scout and MISP​

When you ask Scout whether you were affected by an IP, domain, URL or hash, it searches every connected tool for them at once. A MISP connection in api mode is one of those tools: during a hunt, Scout checks the values against your MISP live, in MispQL, rather than waiting for the next ingestion poll.

A match in MISP is not a sighting. It means your own intelligence knows the value, and Scout quotes the MISP event and tags as what your intel says about it. Whether the value was seen in your estate comes from your telemetry and your other tools.

This search follows the Scout mode you've chosen, and Scout uses a connection only while its Scout access is on. See The connection page.

Ingest MISP indicators​

Ingestion works the same in api and feed mode. Attributes become indicators (IPs, domains, URLs, file hashes, email addresses, JA3), events become reports, tlp:* tags set the TLP and threat-actor galaxies attach the actor. They land in Intelligence: attributes in Indicators, and the feed, its health and its matching settings in Feeds. On a new feed Huntbase runs a 30-day retro-hunt.

  • Attributes with the IDS flag (to_ids) switched off are still ingested, at lower confidence, so they enrich investigations without driving alerts.
  • Polling is incremental on the attribute timestamp, so the first poll of a large instance takes longest. Use Sync now on Feeds to start it straight away.

Limits​

  • Read-only. Huntbase only calls MISP's search, discovery, version and who-am-I endpoints. It never creates, edits or deletes anything in MISP.
  • MISP's own limits apply. MISP evaluates every query as the key's user, with that user's access, and can cap rows per request by role and limit how large a condition may be. DESCRIBE shows the limits in effect.
  • Feed mode can't be queried. Switch the connection to api mode with an auth key to query it.

Next steps​