Locating IP Addresses

Security Splunk

Google Earth Through SplunkIn one of my old blog posts I talked about how to do a lookup of IP addresses to map them to a geo location. That time, I was showing how it is done on the command line and totally outside of Splunk. However, what I really wanted is a way to lookup the locations within Splunk whenever an IP address is shown in an event.

A lookup should take the IP address, figure out its coordinates and then plot the result on a map. What better to use than Google Earth and Google Maps. This is what my Google add-on does. The problem that I had to overcome was the mapping of the IP address to a location. I could have used some python library and put a python script into the add-on to actually do the translation. I found an easier solution by using a Web service to do the lookup for me. In addition to just translating the IP address to a geo location, the service even generates KML for me, which is the file format to describe for Google Earth where the IP address is located. The only thing I had to do is building a simple field action associated with IP addresses. After the add-on is installed, you click on the field action of an IP address. A new menu entry is then shown, which calls an external Web service that returns the KML file. This file you then open up in Google Earth. For your reference, here is the field action from the bundle:

[googleearth-1]
metaKeys=ip
uri=http://www.someservice.com/index.php/iptokml?ip={$ip}&comment={$ip}
label=Locate in Google Earth

Simple, isn’t it?

By Raffael Marty

Related Articles

Boss of the SOC 2.0 Dataset, Questions and Answers Open-Sourced and Ready for Download
Security
2 Minute Read

Boss of the SOC 2.0 Dataset, Questions and Answers Open-Sourced and Ready for Download

You asked, we delivered – Boss of the SOC 2.0 has been open sourced, including dataset, questions, answers and even a scoring server update!
Log4Shell - Detecting Log4j 2 RCE Using Splunk
Security
9 Minute Read

Log4Shell - Detecting Log4j 2 RCE Using Splunk

A serious remote code execution (RCE) vulnerability (CVE-2021-44228) in the popular open source Apache Log4j logging library poses a threat to thousands of applications and third-party services that leverage this library. From Splunk SURGe, learn how you can detect Log4j 2 RCE using Splunk.
Defense Against the Dark Arts: Starting Your Security Journey with Splunk Security & The Magic of MITRE ATT&CK
Security
10 Minute Read

Defense Against the Dark Arts: Starting Your Security Journey with Splunk Security & The Magic of MITRE ATT&CK

Data quality equals detection quality and your defensive spells are only as strong as the telemetry feeding them.