Threat Feed Lookup
Now we need to add the compromised IP info to our data. This lookup is a little different than a regular CSV-based lookup. In most cases, you're looking for a specific value in one field of the CSV, in order to return one or more result fields from the same line as the match.
This compromised-ips.csv
file has just a single field – it's basically just a list of IP addresses, and we only want to check if the field value we're passing in exists somewhere in the file. Instead of using a Lookup
Function, we're going to use an Eval
Function with a C.Lookup().match()
expression.
- Click the
Cribl
upper tab. - If you're not alreadly there, select
Manage
from Stream's top nav, then selectProcessing
>Pipelines
from the submenu. - Find and click the
firewall_enrich
Pipeline. - If you need to refresh your events' display in Stream's right pane: Again click
Simple
(at the lower right, to the right of thepan_firewall_traffic_conditioned.log
sample file), and then click theOUT
button at the top of the right pane. - Click the
Add Function
button near the top of the left pane. TypeEval
into the search box, and click theEval
link to add this Function. - Scroll the left pane to the bottom, and click into the new
Eval
Function. - Under
Evaluate Fields
, click+ Add Field
. Putcompromised
in theName
field, and copy/paste the following into theValue Expression
field:C.Lookup('compromised-ips.csv').match(src_ip) ? true : false
- Click
Save
.
This C.Lookup().match()
Function checks if the IP address contained in src_ip
is present in the lookup file. It returns true if so, false if not. The result is that a new compromised
field will show up in every record, with a value of either true
or false
.
Let's take a look at the results...
- Click the
Kibana - Events
upper tab, and hitRefresh
to see the most recent events. If you expand the first event, you should see a new field namedcompromised
. - Click the
Kibana - Map
upper tab, and hitRefresh
to map the most recent events.
You should now see a red border appear around any country that is sending traffic from a compromised IP address. The thickness of the border reflects how many events from compromised IP's are coming from that country. It will look similar to the image below (with some variation, due to the variability of the data).