It’s almost been 2 years since I spent a summer in Seattle interning with the Splunk Security Practice (SecPrax) Team. Damn, time flies! The Splunk Security community is growing everyday, due to the unbelievable amount of flexibility, visibility, insight Splunk Enterprise offers for all data and as I have learned all data is security relevant. Back at Splunk to work with the Security Research team, this is my first blog post and I would like to hear what you people have got to say about it, so please leave a feedback/comment.
While I am doing some research looking for threat intelligence data sets to ingest into Splunk, I realized there can be an operational gap between the attributes offered by threat feeds (which is a boring list of publicly known bad IPs, domains, etc) and how can I effectively leverage that list to improve my security.
The questions to answer are: Do we have any additional context regarding bad IP address? Do we care if the owner of a bad domain is sending us emails? Do you know if those malicious domains are registered with your company’s details? How relevant is the information from the threat feed while performing an incident investigation? The answer to these questions is something that is missing while doing threat intel. A good way to start efficient threat intelligence is to enrich the list of raw IP address with required external context such as…….
…….and to integrate them seamlessly into the detect process to not only make the Threat Intel more actionable, but also to assist in triaging and investigating incidents. So my aim is to generate and enrich threat intel data which essentially is of Splunk, by Splunk and for Splunk-ing – Did I just alter the quote by Mr. Lincoln?
I will walk through the process I learned to generate your own threat dataset with whois information and provide you with use cases on how do we best leverage this custom command for your Splunk instance.
Step 1: Create an app skeleton for custom search commands
(download the code from the git repository :mysplunk_csc)
Refer to the blog, if you are new to custom search commands. Alternatively, you can copy paste the generateblocklist_app in $SPLUNK_HOME/etc/apps directory. As with any Splunk app there is a specific file layout and some configuration files that are required. Use the searchcommands_template in the Splunk SDK for Python which can be found at :
/splunk-sdk-python-1.5.0/examples/searchcommands_template
Edit bin/generateblocklist.py, and app.conf, commands.conf and logging.conf in the default folder.
[kvwhois]
[emergingthreats] external_type = kvstore collection = kvwhois fields_list = _key, _user, asn_registry, asn_country_code, nets,raw, asn_cidr,raw_referral,asn_date,query,referral
By this step, your generateblocklist_app should have the file structure setup and the configurations required to be able to generate data.
Edit the generateblocklist.py to include two main code snippets:
@Configuration() class GenerateBlocklistCommand(GeneratingCommand): url = Option(require=False) delete = Option(require=False, validate=validators.Boolean()) whois = Option(require=False, validate=validators.Boolean())
Well, if you are following the above steps, you should be ready to create a KV store enhanced threat list.
Once we have a KVStore of enriched threat intel, we can use lookups to check what is the new information we now have along with each BadIP
| inputlookup emergingthreats
Oh Splunk! ‘whois’ this new data?
We now have additional information about the raw IP address. Useful information like registrant information, email address used for domain registration, IP range that a certain BadIP belongs to. We can now determine if the hosts in our network are interacting with these bad domains via this additional information, create an alert or create a work flow action in Splunk.
Now that we have this additional information about the IP address like CIDR range, Name, Address and email of the registrant, domain names associated with an IP, we can now make an event or indicator more actionable. This will help the Level 1 SOC analyst and the hunters with more context around an incident
Use this command to:
The blog post gives you a narrow example about how to get whois data around a threat feed however feel free enable the code to interact with other third party sources and tools like VirusTotal, DNSWL.org, PassiveDNS to generate a custom datasets of threat intelligence and create specific use cases (Malware communication, Phish and Spam email, data exfiltration) depending on the threat feed used.
Generating threat intelligence is not only about blocking all the bad IPs, it is more effective when one knows about the characteristics of the bad actors, their interaction with the company’s assets and the seamless integration of that intelligence into the security.
Also, I suggest you read this blog post regarding the IP Reputation app developed by fellow Splunker Matthias Maier, to get more ideas about threat intel using Splunk Enterprise.
Beware of the threats and happy splunking!
Well, if you’re working with IP data, HEAT MAPS are awesome
| inputlookup emergingthreats | iplocation query | geostats count
----------------------------------------------------
Thanks!
Bhavin Patel
The Splunk platform removes the barriers between data and action, empowering observability, IT and security teams to ensure their organizations are secure, resilient and innovative.
Founded in 2003, Splunk is a global company — with over 7,500 employees, Splunkers have received over 1,020 patents to date and availability in 21 regions around the world — and offers an open, extensible data platform that supports shared data across any environment so that all teams in an organization can get end-to-end visibility, with context, for every interaction and business process. Build a strong data foundation with Splunk.