Enrich with Threat Intel
Tenzir has a powerful enrichment framework for real-time contextualization. The heart of the framework is a *context—a stateful object that can be managed and used with pipelines.
Setup a context
Prior to enriching, you need to populate a context with data. First, let's a
create a context called threatfox
that uses a lookup table, i.e., a key-value
mapping where a key is used to perform the lookup and the value can be any
structured additional data.
After creating a context, we load data into the context. In our example, we load data from the ThreatFox API:
That is, 57 entries have been added successfully to the threatfox
context.
Example data for context updating
If we replace context::update
in the above pipeline with head 5
, we get
output similar to the following, depending on the current state of the API:
Enrich with a context
Now that we loaded IoCs into the context, we can enrich with it in other pipelines. Since we previously imported only domains, we would look for fields in the data of that type.
The following pipeline subscribes to the import feed of all data arriving at the
node via export live=true
and applies the threatfox
context to Suricata DNS
requests in field dns.rrname
via
context::enrich
.
Here is a sample of an event that the above pipeline yields:
The sub-record threatfox
holds the enrichment details. The field key
contains the matching key. The field context
is the row from the lookup table
at key bza.fartit.com
. The field timestamp
is the time when the enrichment
occurred.
Make sure to read our detailed explanation of enrichemnt to unlock the full potential of Tenzir's contextualization framework.