Splunk Search

How to display the source ip which does not fall under cidr range specified in a lookup table?

Pooja_R
Loves-to-Learn Lots

I have a lookup table with allowed CIDR ranges.

allowed_cidr_range      applications

Xyx                                             abc

I need to build a alert whenever source ip does not belong to the allowed cidr range.

Query :

NOT [| lookup cidr_vpc.csv allowed_cidr_range as src_ip output allowed_cidr_range]

|table _time,host,sourcetype,src_ip,dst_ip

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this (assuming the lookup type is defined as being CIDR)

| lookup cidr_vpc.csv allowed_cidr_range as src_ip output applications]
| where isnull(applications)
| table _time,host,sourcetype,src_ip,dst_ip

 

0 Karma

Pooja_R
Loves-to-Learn Lots

Hi

The lookup table looks something  like

allowed_cidr            applications

10.7.0.0/16                 dev

10.16.0.0/26               non_prod_server

I want to consider allowed_cidr as source ip and display the addresses not in  cidrmatch

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Look up the src_ip (make sure the lookup definition says CIDR match)

If the lookup finds a match then the src_ip is allowed, therefore, if there is no match applications will be null

| lookup cidr_vpc.csv allowed_cidr as src_ip OUTPUT applications
| where isnull(applications)
| table _time,host,sourcetype,src_ip,dst_ip
0 Karma
Get Updates on the Splunk Community!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...