Splunk Search

How to use a list of allowable IP addresses?

kevinb0011
Explorer

Good morning,

Curious to see if anyone has used a similar dataset in Splunk and/or any suggestions on the best way to create a usable solution.

I have a list of IP addresses, and for each IP address there is a list of allowable systems (IPs) . If any of the IP addresses communicate with systems outside of the allowable list I want to be alerted. I know I can probably create individual alerts for each of these but would like to be able to process these in bulk. For example, if Splunk could periodically cross reference the IP list against the network data to see if there are any violations. Could a lookup table be used for this?

Labels (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @kevinb0011,

you can use a lookup (called e.g. your_lookup.csv) to store the allowed IPs and then run a search:

at first you have to define the fields containing IP to monitor and then run something like this:

index=* 
| eval ip=coalesce(src,src_ip.dest, dst,dest_ip,dst_ip)
| search NOY [ | inputlookup your_lookup.csv | fields ip ]

in this way list all the IP in the choosen fields not listed in the lookup.

Ciao.

Giuseppe

 

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @kevinb0011,

you can use a lookup (called e.g. your_lookup.csv) to store the allowed IPs and then run a search:

at first you have to define the fields containing IP to monitor and then run something like this:

index=* 
| eval ip=coalesce(src,src_ip.dest, dst,dest_ip,dst_ip)
| search NOY [ | inputlookup your_lookup.csv | fields ip ]

in this way list all the IP in the choosen fields not listed in the lookup.

Ciao.

Giuseppe

 

kevinb0011
Explorer

Great thank you for the quick response. I'm going to try this out asap.

Curious as to how much this complicates things, but what if the allow list is unique per IP.  So each IP could have similar or different allowed communicants. Could this be captured in one lookup table?

For example:

Main IP List            Allowed IPs

10.0.0.1                   (10.1.0.0, 10.2.00, 10.3.00)

10.0.0.2                   (10.0.1.0, 10.0.2.0)

10.0.0.3                   (192.168.1.1, 10.1.0.0)

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @kevinb0011,

in the allow list you can use asterisk (10.1.0.*) or subnets (10.1.0.0/24).

The main problem, is to identify all the fields that could contain ip addresses and put them in the coalesce command.

Ciao.

Giuseppe

0 Karma

kevinb0011
Explorer

ok great thanks

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @kevinb0011,

good for you, see next time!

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated 😉

0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...