This blog proposes a comprehensive architecture for implementing Disaster Recovery (DR) in Splunk Enterprise running on AWS. This example includes setting up two multi-site SmartStore indexer clusters, and a single search head cluster stretched across two AWS regions. Our SmartStore objects will be s3 buckets in AWS. This 2-region solution ensures uninterrupted search and indexing capabilities in the case that one of the regions become unavailable.
Let’s start with our indexer tier.
For our indexer tier, we have two unique multi-site indexer clusters each belonging to a separate region. For the implementation stage, this means building TWO individual indexer clusters separate from each other. The “sites” will be the availability zones in each region, so region 1 will have 3 sites (AZ 1, AZ 2, and AZ 3) and likewise in region 2. Each cluster will also be SmartStore enabled, having their own external S3 bucket.
Note: Indexers with SmartStore enabled will offload Splunk buckets to S3 once they roll from hot to warm. From there, retention is managed within S3. Before enabling SmartStore, we first need to create an S3 bucket in AWS and ensure read/write capabilities from the splunk indexers. See AWS documentation for details on S3 bucket creation and permissions.
We first need to adjust server.conf on the Cluster Manager node. Because this is a multisite cluster, buckets being migrated need to be able to identify the origin and replicate across all sites. We can accomplish this by setting the following on the Cluster Manager node:
The first stanza [volume:smartstore] contains the configurations to point and authenticate to the S3 bucket. The [default] stanza configs here point the remote path to this SmartStore volume and sets the replication factor to auto to enable replication of Splunk buckets.
The above configuration additions need to happen on BOTH indexer clusters, as they are still technically separate, and unaware of each other. Before configuring the DR piece of the solution, we need to have 2 standalone multi-site indexer clusters with SmartStore enabled, in a healthy state.
Disaster Recovery
The DR solution comes into play by enabling AWS Cross Region Replication from the S3 in region 1 to region 2. Once data is offloaded from the Splunk indexers to the S3 bucket in region 1, AWS then replicates that data to the S3 bucket in region 2.
In region 2, the indexers will utilize S3 for searches that require warm data retrieval during search operations, which will now contain data that has been replicated from region 1 – up to a 15 min delay per AWS SLAs. This allows data to be highly searchable in the case that the indexer cluster and/or S3 bucket in region 1 becomes unavailable.
The idea here is that if region 1 becomes unavailable, users can query the indexers in region 2 and still see data that was indexed in region 1. Splunk SmartStore paired with AWS Cross Region Replication allows for this disaster recovery architecture.
Search Tier
For the search tier, we have a stretched search head cluster across both regions. The reason we want to have this as a single cluster, rather than broken out into 1 per region like the indexers, is to allow for easy replication of knowledge objects. This will ensure that user content created in region 1 is easily accessible in the case that users need to log into region 2.
From a technical standpoint, Splunk does not allow for members of a single search head cluster to have different search peers, the search peers must be consistent across all members. To ensure that search heads in region 1 are only peered to indexers region 1, and likewise for region 2, we can utilize DNS names for the indexers, so that each search head points to the same name but resolves to it’s local indexers per the DNS rules in each region.
This will satisfy the technical need for all Splunk Search Heads to have a consistent list of the same search peers across both regions, but behind the scenes only dispatching searches to the indexers in the same region as the search head.
Architecture
Overall, this is the high-level architecture that can be implemented to ensure HA between both Search Heads and Indexers.
We hope this has provided the overview that will help you build your own disaster recovery architecture. Contact us if you need additional information. Happy Splunking!
Today, Governor John Bel Edwards and LSU President William F. Tate IV cut the ribbon to the LSU and LONI Security Operations Center, or SOC, on the flagship campus in Baton Rouge, opening the doors to a new cybersecurity workforce development and protection model for Louisiana and LSU that is garnering national attention.
“Louisiana is setting a nationwide standard for cybersecurity because of our pioneering and proactive approach rooted in higher education,” said Governor Edwards. “Cyberattacks are becoming more sophisticated and are a constant threat to individuals, businesses and government entities. LSU is harnessing the collective power of our immensely talented students in order to protect citizens from cyber threats while also growing our workforce. Louisiana’s record low unemployment is proof that innovation leads to job creation, and the LSU SOC is exactly the type of forward-thinking project that will keep this momentum going.”
“When we declared our commitment to becoming the foremost cybersecurity program in the nation, we were resolute,” LSU President William F. Tate IV said. “A primary cybersecurity challenge our nation confronts today is the shortage of a skilled workforce. We require more well-trained cyber warriors. Through the SOC, we are enhancing the development of cyber talent while fulfilling our flagship mission to protect and serve our state.”
Through its new SOC, LSU and Louisiana are leading the nation in how to train and graduate students who can actively join the cyber fight and gain real-world, real-time experience working in direct service to the state. In the past three weeks, 94 LSU students have applied to receive training as professional cyber analysts to operate the SOC at the heart of the flagship campus. The students working at the SOC will be responsible for monitoring and analyzing the university’s network traffic as well as identifying and escalating potential threats.
The LSU SOC is the first node in an emerging statewide cybersecurity platform powered by the Louisiana Optical Network Infrastructure, or LONI, the state’s research and development network that connects Louisiana’s universities and community and technical colleges. By extending the SOC through LONI, every institution of higher education will have the ability to establish their own student-operated center and receive additional security services. This new model—educating students to provide services the university critically needs and then extending it into a platform to serve a greater purpose—has the immediate potential to change the security posture of the whole state.
To build its SOC platform, LSU turned to TekStream, an Atlanta-based technology services firm, and Splunk, one of the world’s leading data and security technology companies. TekStream supports SOC management and incident response, while Splunk provides the core analytic and monitoring technology.
Earlier this week, LSU announced $7.5 million in state investment to expand the LSU-LONI SOC model to more than 30 colleges and universities in the state, at no additional cost to each institution. Increased cybersecurity protection across higher education will come with broader impacts for Louisiana, offsetting the state’s need to respond to cyberattacks and limiting key attack vectors. Universities’ diverse data landscapes are often the first to pick up on new cyber threats, which then tend to cascade through critical infrastructure, industry and state and local government.
“The Governor tasked us to both strengthen our statewide cybersecurity and build a homegrown cyber workforce—today, we are doing just that,” Commissioner of Higher Education and Chair of Louisiana’s Cybersecurity Commission Kim Hunter Reed said. “The SOC model means every public institution is positioned to acquire and build the additional cybersecurity defense to meet its unique campus needs. We are grateful for the state, corporate and institutional support that has resulted in this integrated and innovative approach to data protection and student engagement in Louisiana.”
Besides the physical SOC on LSU’s flagship campus in Baton Rouge, LSU Shreveport operates its own. The Shreveport SOC is an extension of the LSUS Cyber Collaboratory and will also work seamlessly with industry partners Splunk as the platform and technology provider and TekStream on service and training.
“LSU is building one of the nation’s strongest whole-of-state plans for cybersecurity, and we’re starting to receive inquiries from all over about the ‘LSU and Louisiana model,’” Splunk Vice President of Public Sector Bill Rowan said. “Usually, we rely on talent to help us innovate, but this SOC flips that on its head: innovating to help produce talent, and Splunk couldn’t be more excited to be a part of this effort with TekStream.”
“Our model was always to provide SOC services by implementing Splunk technology, but we jumped at the opportunity to do something different with LSU,” TekStream CEO Rob Jansen said. “We essentially agreed to work our way out of business by helping to train students to do more and more advanced work. Why? Because we saw all of the amazing upsides of the partnership, since we all struggle to find and hire enough talent. That’s why the LSU-LONI model is groundbreaking; it’s a first in our industry and the number and caliber of talented student applicants we’ve already received is staggering.”
In my view, _time is the best way to filter in Splunk. Using the time picker can eliminate thousands if not millions of events from your results. That elimination can be a good or a bad thing.
So what if you want to see the events that come before and after so you can view the complete process in a dashboard? Well, that exact question was recently asked by a client. With a kicker …they wanted to paste the events timestamp into a field and have it automatically gather the surrounding events. They did not want to use time picker due to taking too long to calculate the surrounding times of the event, then find the correct setting in time picker for the surrounding events. They wanted to copy and paste directly from the original event. Challenge accepted!
First, I add all my inputs. I only need the one text input, but I also am going to show how to change the size of the range you are searching based on two dropdown inputs that allow you to add more time to before or after a search time.
Now let’s add a table to the dashboard and add a query. For this example, I will just use a simple search (index=_internal sourcetype=splunkd).
Now let’s add the additional time items to the search query. I am also using the %Y-%m-%dT%H:%M:%S time format.
Here is what I added to my search: [ | makeresults | eval earliest_time=relative_time(strptime(“$time$”,”%Y-%m-%dT%H:%M:%S”), “-10m”) | return earliest_time ] [ | makeresults | eval latest_time=relative_time(strptime(“$time$”,”%Y-%m-%dT%H:%M:%S”), “+10m”) | return latest_time ]
I use the token of time to fill in the strptime that the commands utilize, and they create a time for earliest and latest times.
Notice how my time is now restricted to 10 minutes after the time I input?
And that’s it! We have successfully restricted the times of the events to a range of 20 minutes around our time input. But, what if we want to use different time ranges?
Let’s add two more inputs that will be our before and after time. I added two dropdowns where we can list the different times we want to use. I called them Earliest and Latest then I used the token names earliest_tok and latest_tok.
Now let’s add the times we want to select from:
And all we have left to do is to replace the time change values in our search with these tokens. Our new search will be
Now you can see that our latest time is set to 15 minutes and our newest event time is 15 minutes after the set time I input.
There you have it! Add this to any search in a dashboard and you can find events from any time range around a certain time just by creating a few inputs. Contact us if you’d like to chat!
By Bryan Bollou, Team Lead, CyberSecurity Engineering
Purpose of TekStream Security Bulletins
With the TekStream Security Bulletin, we are presenting some specific detection use cases using everyone’s favorite SIEM, Splunk. We’ve cherry-picked vulnerabilities that are not only intriguing but also directly impactful for our valued clients. These vulnerabilities were chosen based on a multitude of factors, ranging from the technology in the crosshairs to the specific sectors being targeted. This is not a blog post to fully explain or give recommendations on remediating the vulnerability – this has been discussed at length by various resources. The goal here is to aggregate the detections to maximize your chances of detecting an attempt to exploit these vulnerabilities. A part of that is gathering the list of IOCs scattered in multiple locations on the internet and looking at activity that could point to the vulnerability being exploited. Here at TekStream, we have an amazing team of cybersecurity engineers armed with a deep knowledge of logs and the secrets they hold, ready to fortify your cyber resiliency.
Introduction
Starting from early April 2023, there have been documented instances of intrusions related to Cisco Adaptive Security Appliance (ASA) Virtual Private Networks (VPNs). In May, Sophos was the first to identify that the ransomware group “Akira” exploited default VPN accounts to infiltrate networks lacking MFA protection.
This threat primarily stems from the use of default accounts, weak credentials, and the absence of an additional authentication layer for all users. Typically, after a network intrusion, a ransomware attack follows, as researchers map Akira’s common attack pattern. Addressing this matter is crucial, given that numerous clients rely on CISCO ASA VPNs as their solution, and our utmost priority is to ensure their security.
Threat Overview
The vulnerability has been acknowledged by Cisco and they have suggested various mitigation steps to prevent its exploitation.
These steps include:
Disable default accounts or reset their passwords.
Enforce MFA for all VPN users, minimizing exceptions.
Enable VPN logging, following Cisco’s guidance for ASA and forensic evidence collection.
Monitor VPN logs for unauthorized authentication attempts.
Watch for failed authentications, detecting brute force or password spraying.
Stay up to date with security patches for VPNs, virtual desktop infrastructure, and gateway devices as a best practice.
So far, we have seen many good options and would like to present a few more specific cases using everyone’s favorite SIEM, Splunk.
This is not a blog post to fully explain or give recommendations on remediating the vulnerability, which has been discussed at length by various resources such as Rapid 7.
The goal here is to aggregate the detections to maximize your chances of detecting this critical attack. A part of that is gathering the list of IOCs scattered in multiple locations on the internet and looking at activity that could point to the Cisco ASA VPNs being exploited. Here at TekStream, we have several security engineers who are intimate with cybersecurity knowledge – especially the logs of our clients.
In this blog post, we go through the various steps in Akira’s (and other APTs) Cisco ASA VPN exploitation & detection. With this format, we are providing a more generic data model “tstats” command. This is taking advantage of the data model to quickly find data that may match our IOC list. We then provide examples of a more specific search that will add context to the first find. There will be a wide variety of specific searches as each client has their own specific technologies. To get help building detection for your specific client, fill in the form below and get access to our Splunk/security expertise.
Note: The follow-up of the initial access attack is normally the deployment of various ransomware to infect a victim’s system. Detecting this part is not covered in this blog post. Reach out to TekStream by filling out the form below if you’d like specific guidance on that aspect.
The following detection steps mirror the stages and TTP-related indicators used in the attack:
Connection attempts from malicious IPs to the Cisco ASA VPN
Connection attempts to hit the CISCO ASA VPN URL using a parameter string often seen with brute force attacks
Connection attempts to log in to the CISCO ASA VPN with often-used account names
Process execution of set.bat and nd.exe files to expose more credentials and enable lateral movement of the threat actor
Connection attempt to the domains of AnyDesk or RustDesk as a remote access tool for the threat actor to continue their exploitation of the victim network
Connection attempts to authenticate to/from Windows machines with a specific naming convention (“WIN-*”) on a client’s user VPN network
Threat Implication
Environments utilizing CISCO ASA VPNs become targets of interest for Akira and various APTs seeking unauthorized access. This is especially true for environments lacking MFA enforcement during VPN logins or having MFA exceptions for specific users.
Most adversaries employ tactics such as brute force, password spraying, and credential stuffing to exploit weak or default passwords. Additionally, other threat actors have been observed procuring exposed credentials from illicit online markets.
The APTs under scrutiny include the Akira and LockBit ransomware groups. Both have been noted for concluding their attacks with the deployment of ransomware.
Within the attack lifecycle, Akira and LockBit have leveraged legitimate, open-source remote access tools such as RustDesk and AnyDesk to navigate within compromised environments.
Threat Detection
Step 1 The exploitation of these vulnerability CISCO ASA VPNs has been conducted by known APTs and IP addresses related to them have been captured. The first step in detecting potential exploitation attempts would be connection attempts from these malicious IPs to the Cisco ASA VPN.
Note: This CSV file listing includes all the mentioned usernames, along with other Indicators of Compromise (IOCs), conveniently consolidated for streamlined export into a lookup for notable detections.
| tstats `summariesonly` latest(_time) as _time, sum("All_Traffic.bytes") as bytes, values("All_Traffic.src_port") as src_port, values("All_Traffic.transport") as transport, values("All_Traffic.dest_port") as dest_port from datamodel="Network_Traffic"."All_Traffic" where All_Traffic.src IN ("176.124.201.200","162.35.92.242","161.35.92.242","173.208.205.10","185.157.162.21","185.193.64.226","149.93.239.176","158.255.215.236","95.181.150.173","94.232.44.118","194.28.112.157","5.61.43.231","5.183.253.129","45.80.107.220","193.233.230.161","149.57.12.131","149.57.15.181","193.233.228.183","45.66.209.122","95.181.148.101","193.233.228.86","176.124.201.200","162.35.92.242","144.217.86.109","31.184.236.63","31.184.236.71","31.184.236.79","194.28.112.149","62.233.50.19","194.28.112.156","45.227.255.51","185.92.72.135","80.66.66.175","62.233.50.11","62.233.50.13","194.28.115.124","62.233.50.81","152.89.196.185","91.240.118.9","185.81.68.45","152.89.196.186","185.81.68.46","185.81.68.74","62.233.50.25","62.233.50.17","62.233.50.23","62.233.50.101","62.233.50.102","62.233.50.95","62.233.50.103","92.255.57.202","91.240.118.5","91.240.118.8","91.240.118.7","91.240.118.4","161.35.92.242","45.227.252.237","147.78.47.245","46.161.27.123","94.232.43.143","94.232.43.250","80.66.76.18","94.232.42.109","179.60.147.152","185.81.68.197","185.81.68.75") OR All_Traffic.dest IN "176.124.201.200","162.35.92.242","161.35.92.242","173.208.205.10","185.157.162.21","185.193.64.226","149.93.239.176","158.255.215.236","95.181.150.173","94.232.44.118","194.28.112.157","5.61.43.231","5.183.253.129","45.80.107.220","193.233.230.161","149.57.12.131","149.57.15.181","193.233.228.183","45.66.209.122","95.181.148.101","193.233.228.86","176.124.201.200","162.35.92.242","144.217.86.109","31.184.236.63","31.184.236.71","31.184.236.79","194.28.112.149","62.233.50.19","194.28.112.156","45.227.255.51","185.92.72.135","80.66.66.175","62.233.50.11","62.233.50.13","194.28.115.124","62.233.50.81","152.89.196.185","91.240.118.9","185.81.68.45","152.89.196.186","185.81.68.46","185.81.68.74","62.233.50.25","62.233.50.17","62.233.50.23","62.233.50.101","62.233.50.102","62.233.50.95","62.233.50.103","92.255.57.202","91.240.118.5","91.240.118.8","91.240.118.7","91.240.118.4","161.35.92.242","45.227.252.237","147.78.47.245","46.161.27.123","94.232.43.143","94.232.43.250","80.66.76.18","94.232.42.109","179.60.147.152","185.81.68.197","185.81.68.75") by "All_Traffic.action", "All_Traffic.src", "All_Traffic.dest", "All_Traffic.user"| `drop_dm_object_name("All_Traffic”)| table action, src, src_port, dest, transport, dest_port, user, bytes
Step 2 As observed by multiple researchers, APTs have been seen to make connection attempts to hit the CISCO ASA VPN portals using a specific parameter suited for brute forcing. Detecting the use of this parameter could help uncover an attempt to exploit the CISCO ASA VPN.
Actions to Detect:
Attempts to hit URLs ending in the following; +CSCOE+/logon.htm
SPL - Using Web Datamodel:
| tstats `summariesonly` sum("Web.bytes") as bytes,values("Web.http_content_type") as http_content_type,values("Web.http_method") as http_method,values("Web.http_user_agent") as http_user_agent,values("Web.status") as status from datamodel="Web"."Web" where Web.url = "*+CSCOE+/logon.htm*" by "Web.src", "Web.dest", "Web.user", "Web.url", _time | fields _time src, dest, user, url, http_content_type, http_method, http_user_agent, status, bytes
Step 3 Many attackers utilize strategies like brute force attacks, password spraying, and credential stuffing to exploit vulnerabilities associated with weak or default passwords. Detecting connection attempts to log in to the CISCO ASA VPN with often-used account names could be evidence of attempting exploitation.
Actions to Detect:
Note: This CSV file listing includes all the mentioned usernames, along with other Indicators of Compromise (IOCs), conveniently consolidated for streamlined export into a lookup for notable detections.
| tstats `summariesonly` latest(_time) as _time, values(Authentication.src_user_id) as src_user_id, values(Authentication.src_user_role) as src_user_role, values(Authentication.user_id) as user_id, values(Authentication.user_role) as user_role, values(Authentication.vendor_account) as vendor_account, values(Authentication.authentication_method) as authentication_method from datamodel="Authentication"."Authentication" where Authentication.src_user IN ("TEST","CISCO","SCANUSER","PRINTER","admin","adminadmin","backupadmin","kali","cisco","guest","accounting","developer","ftp user","training","test","printer","echo","security","inspector","test test","snmp") by "Authentication.action", "Authentication.app", "Authentication.src", "Authentication.src_user", "Authentication.dest", "Authentication.user"| `drop_dm_object_name("Authentication")` | fields _time, action, app, src, src_user, src_user_id, src_user_role, dest, user, user_id, user_role, vendor_account, authentication_method
Step 4 Upon successful internal authentication, threat actors deployed “set.bat,” installing and activating AnyDesk with a preset password, “greenday#@!”. They also executed “nd.exe” on some systems to access additional credentials. These actors then moved laterally and executed files on other systems, often concluding with the deployment of Akira or LockBit ransomware.
Actions to Detect: An attempt to execute the following processes; set.bat nd.exe
SPL – Using the Endpoint Data Model:
| tstats `summariesonly` latest(_time) as _time, values(Processes.user) as user, values(Processes.process) as process, latest(Processes.parent_process) as parent_process, latest(Processes.parent_process_exec) as parent_process_exec, latest(Processes.parent_process_guid) as parent_process_guid, latest(Processes.parent_process_id) as parent_process_id, latest(Processes.parent_process_path) as parent_process_path, latest(Processes.process_path) as process_path, latest(Processes.process_exec) as process_exec, latest(Processes.process_guid) as process_guid, latest(Processes.process_id) as process_id, latest(Processes.process_hash) as process_hash from datamodel="Endpoint"."Processes" where Processes. process IN ("set.bat", "nd.exe") by Processes.dest, Processes.process_name, Processes.parent_process_name | fields _time, dest, user, process_name, process, process_hash, process_path, process_exec, process_id, process_guid, parent_process, parent_process_name, parent_process_path, parent_process_exec, parent_process_guid, parent_process_id
Step 5 This step involves detecting outbound connection attempts to anydesk.com and/or rustdesk.com from the client’s environment. Such software is used by the APTs as a foothold in a client’s environment for further exploitation. This is especially important for environments that have strong application policies that don’t allow unapproved applications to be installed. This detection is not as useful if either of these products is used in a client’s environment.
Actions to Detect: Detect outbound connection attempts to the following URLs; anydesk.com rustdesk.com
SPL- Using the Web Data Model:
| tstats `summariesonly` sum("Web.bytes") as bytes,values("Web.http_content_type") as http_content_type,values("Web.http_method") as http_method,values("Web.http_user_agent") as http_user_agent,values("Web.status") as status from datamodel="Web"."Web" by "Web.src", "Web.dest", "Web.user", "Web.http_referrer", "Web.url", _time | `drop_dm_object_name("Web")` | where match(url, "(?i)(anydesk.com)|(rustdesk.com") | fields _time src, dest, user, http_referrer, url, http_content_type, http_method, http_user_agent, status, bytes | eval ip_pair = src . " - " . dest | stats values(_time) as Time values(ip_pair) AS src_dest, values(user) as user, values(http_referrer) as http_referrer, values(http_user_agent) as http_user_agent, values(http_method) as http_method, values(status) as status, values(bytes) as bytes count by url
SPL 2 – Using the Network Resolution Data Model:
| tstats `summariesonly` latest(_time) as _time values("DNS.dest") as dest, values("DNS.query") as query, values("DNS.query_count") as query_count, values("DNS.message_type") as message_type, values("DNS.answer") as answer, values("DNS.reply_code") as reply_code from datamodel="Network_Resolution"."DNS" where DNS.query IN ("anydesk.com", "rustdesk.com") | table _time, dest, query, query_count, message_type, answer, reply_code | fieldformat Time = strftime(_time,"%m/%d/%Y %T")
Step 6 Research has shown that a pattern Akira and other APTs followed getting into a Cisco VPN was to attempt to authenticate to internal machines for lateral movement. Common source machine names and destinations have been made aware. Thus, connection attempts to authenticate to/from Windows machines with a specific naming convention (“WIN-*”) on a client’s user VPN network may be evidence of this CISCO ASA VPN exploitation.
Actions to Detect: The following Windows Event Codes; 4626 – “An account was successfully logged on” 4625 – “An account failed to log on.”
The following machines names attempting authentication; WIN-* WIN-R84DEUE96RB
SPL – Using the Windows Event Log Data Source:
index=wineventlog EventCode IN ("4625","4626") ComputerName IN ("WIN-R84DEUE96RB", "WIN-*")
| table _time, name, Message, status, ComputerName, Display_Name, EventCode,
SPL 2 – Using the Authentication Data Model:
| tstats `summariesonly` latest(_time) as _time, values(Authentication.src_user_id) as src_user_id, values(Authentication.src_user_role) as src_user_role, values(Authentication.user_id) as user_id, values(Authentication.user_role) as user_role, values(Authentication.vendor_account) as vendor_account, values(Authentication.authentication_method) as authentication_method, values(Authentication.signature) as signature from datamodel="Authentication"."Authentication" where Authentication.signature IN ("4625","4626") AND "Authentication.dest" IN ("WIN-R84DEUE96RB", "WIN-*") by "Authentication.action", "Authentication.app", "Authentication.src", "Authentication.src_user", "Authentication.dest", "Authentication.user" | `drop_dm_object_name("Authentication")` | fields _time, action, app, src, src_user, src_user_id, src_user_role, dest, user, user_id, user_role, vendor_account, authentication_method
Ideally, you could make scheduled searches like what is shown above with lookup tables for matching more specific and new detections. These can be set to run on a continuous schedule to ensure the monitoring of your assets from new vulnerabilities. Old vulnerabilities that have been patched (and applied) can also be aged out of this lookup table to ensure it is timely and efficient. For questions on how to build such a process that is dynamic and customizable for your environment, ask one of our consultants by filling in the form below. Also, subscribe to the TekStream blog to catch the next monthly security bulletin and apply the latest detections to protect your systems. Happy Splunking!
The approaches recommended herein have not been tested broadly across the TekStream customer base. They are preliminary in nature and come without any certification of efficacy.
When working in Splunk, scheduled searches often skip or cannot execute for one reason or another. If a search got skipped, a scheduled job waits on the line for the search slot and the job sits in deferred status. If the scheduling window expires, the search does not run and the job resets to skipped status.
Reports, alerts, data models and many app dashboards like Enterprise Security (ES) depend on your scheduled searches. When these searches do not run in the scheduled time window, the overall Splunk environment becomes unreliable because of missing data or incorrect data in the dashboards and reports. This can cause you to miss crucial alerts and can slow the performance of dashboards.
How to Find Skipped Searches in Splunk Cloud
The below spls show any scheduled searches that are being skipped, the reason why and the savedsearch name. Time range of last 7 days is a good place to start, and can go back up to 30 days.
index=_internal sourcetype=scheduler status=”skipped” | stats values(savedsearch_name) count by reason
index=_internal sourcetype=scheduler savedsearch_Name=* status=skipped | stats count by reason
Skipped Search Reasons and Solutions
These are the most common reasons for skipped searches in any Splunk Cloud stack:
Reason 1: The maximum number of concurrent running jobs for historical scheduled searches on this instance or cluster has been reached.
Explanation: By default, only one instance of a given search is kept running at the same time. Therefore, if the search is already running for scheduled_time and when the next cron scheduled _time comes due for the next run, the scheduler will not execute the next job. So, the next scheduled search job is skipped now because the previous scheduled search job for the same saved search is still running. Example: The cron schedule configured to run the search every 5 minutes but the search itself takes 10 minutes to complete.
Solution: a. Tune the spl of the search job to run within the configured time window. If possible, shorten the earliest time for the job. b. If you cannot improve the search runtime, then increase the cron period to make sure it’s more than the search execution time.
Reason 2: The maximum number of concurrent historical scheduled search on this cluster has been reached or the maximum number of concurrent auto-summarization searches has been reached.
Explanation: Each Splunk cloud stack is configured to run a maximum number of concurrent searches. We can find it under Settings -> Search Preferences -> Limits set for scheduled searches and summarization searches. As a cloud customer, set these values in the backend in the limits.conf. When we change the percentage from 50% to 75%, we can see the number of search slots for the scheduled searches and summarization searches (DM) increased. Before increasing this concurrency limit, please make sure all the best practices listed in the below Solution section are implemented. Example: If a DM skipped for last 5 minutes acceleration then when it runs the next time it tries to run for last 10 minutes data. If that is also skipped, the next time it tries to run for last 15 minutes data and keeps accumulating.
Solution: a. Avoid scheduling search jobs at the top of the hour, like 10:00 am, 11:00 am or 10:30 pm, 11:30 pm, etc. It means we are scheduling too many searches at the same time. Tune the cron schedules of the scheduled jobs to fire on different minutes, which makes the load spread through the hour/day. b. Disable unused scheduled searches. Remove unused apps and TA’s. c. Not all the DMs need to be accelerated. Only if the summary data is more than 1GB is the acceleration useful. d. Consider workload management. The following rule limits the number of concurrent ad hoc searches to 50% of the total search concurrency limit, which in turn provides more search slots for scheduled searches and summarization searches: search_type=adhoc AND adhoc_search_percentage >50. e. Create WLM rule to place prioritized searches in the high priority pool to get them maximum resources and hence the search completes faster. f. Tune Datamodel to search only the indexes needed.
Best practice setup for search jobs can eliminate skipped searches and incomplete data. Following the quick tips here will ensure more thorough alert reporting and faster dashboards.
This article will give Splunk admins a beginner’s guide to Splunk App/User Context Configuration Files. In a previous post, I went over several Splunk configuration files that one would find in a global context – independent of any apps or users. As a quick refresher, configuration files in Splunk (or “conf files”) dictate almost all settings in a Splunk environment. Splunk can have several of the same conf files in several directories, and “merge” via precedence rules. These rules differ depending on the context. Here, we will discuss Splunk conf files in the app/user context.
When is the App/User Context Applicable?
This context applies when editing conf files that pertain to a certain app or dealing with knowledge objects/actions owned by certain users. Search related activities is most common to this context, and most conf files discussed will have direct effects on search related processes.
App/User Context Conf File Precedence
Conf files can exist in default or local directories within apps or the overall system. Generally, local settings take precedence over default settings, and it is recommended users make changes in local directories. Further ordering depends on global or app/user context. For the app/user context, the baseline precedence order is as follows (taken from Splunk documentation):
User directories for current user (/opt/splunk/etc/users/) – local, then default
App directories for current running app (/opt/splunk/etc/apps/running_app_name)– local, then default
App directories for other apps (/opt/splunk/etc/apps/other_app_name/) – local, then default
System directories (/opt/splunk/etc/system/) – local, then default
For example, if I had savedsearches.conf files stored within:
The first settings to take precedence would be the ones set in the admin user directory, as they would have any options set per user. Then, any settings set locally within the running app (in this case, search) would take precedence, followed by the app’s default settings. That is followed by settings in any other app contexts, and finally settings in the system directories that would apply if not overridden by a higher precedence file.
App directory names can determine additional precedence. For app/user context, Splunk uses reverse-lexicographical order for priority. For example, a file that starts with the letter “Z” has a higher precedence than a file with the letter “A”.
Here are some common conf files found in the app/user context in Splunk:
ALERT_ACTIONS.CONF
alert_actions.conf provides settings for saved search actions. Different options exist for configuring alerts to send emails, RSS notifications, scripts, scheduled searches, and custom alert actions.
The [default] stanza dictates settings for all alert_actions within the conf file but can be overridden by individual alert_action stanzas.
Here are some settings commonly configured in [default]:
maxresults = <integer> – the max number of search results sent through alerts
hostname = [protocol]<host>[:<port>] – the hostname in the URL sent through alerts
maxtime = <integer>[m|s|h|d] – the allowed amount of time for an alert to execute before it’s aborted
command = <string> – the search command that executes the action
label = <string> – sets the label in the UI for custom alert actions
description = <string> – sets the description in the UI for custom alert actions
FIELDS.CONF
fields.conf provides settings for Splunk to handle indexed and extracted fields, multivalue fields, and how search time handles field values.
Again, the [default] stanza dictates settings for all fields that can be overwritten by individual field stanzas.
For local settings, the stanza name may be the field name itself, or a wildcard expression for a certain sourcetype formatted like this:
sourcetype::<sourcetype>::<wildcard>
Additional settings:
TOKENIZER = <regex> – indicates a field value is part of a larger token (pertinent to multivalue fields)
INDEXED = <Boolean> – specifies if the field is created at index or search time
INDEXED_VALUE = several options:
Set to “true” if the value is in the raw event text
Set to “false” if not
Can also set to a sed-cmd string to substitute a field value
Can also set to a simple substitution string
MACROS.CONF
macros.conf provides settings to configure search macros, or reusable pieces of SPL referred to by a name between two backticks. This makes it very easy to use the same search strings in several different searches. Arguments can be passed into macros for more flexibility, and macros can contain eval statements.
Each stanza in macros.conf is specific to each search macro, and its naming convention is the name of the macro unless specified otherwise.
Available settings:
Available settings:
args = <string>, <string>, … – any arguments passed into the macro
definition – the search terms referred by the macro. Any arguments must be separated by dollar signs.
validation = <string> – verifies that the macro has appropriate arguments. Should return NULL if valid, or a Boolean/string if false.
errormsg = <string> – the error message returned by the macro if passed bad arguments and the validation setting is a Boolean statement.
Iseval = true|false – specifies if the definition is an eval expression that returns a string of the expanded macro
description = <string> – optional setting to describe what the macro does
PROPS.CONF
I went over props.conf in the global context in my last post, but this file can exist in both the global and the app/user context, depending on what settings are being used.
Use the EXTRACT or REPORT settings in props.conf to create search time field extractions. Typically, EXTRACT is the setting to use, but REPORT can be used across multiple sources/sourcetypes/hosts, to apply multiple extractions, to set up delimiter extractions, multivalue fields, to extract fields that start with numbers or underscores, and to manage formatting.
Example formatting: EXTRACT-hostname = d{4}sHostName=(?<HostName>w{5})s
Use the rename = <string> setting to rename a sourcetype at search time.
SAVEDSEARCHES.CONF
savedsearches.conf provides possible setting/value pairs for saved searches. The standard settings, under each stanza representing a saved search, are:
disabled = <Boolean> – is the search enabled or not
search = <string> – the SPL for the saved search
dispatchAS = [user|owner] – who does the search run as?
There are settings for additional configurations of saved searches including scheduling, notifications, workload management, and event actions.
TRANSFORMS.CONF
This file is used in tandem with props.conf to enact more complex regex transformations at both index time (global context) and search time (app/user context).
In a global context, transforms.conf uses regex to override host and sourcetypes values, mask sensitive data, create index time field extractions, and set up fields from lookup tables.
The app/user context uses regex or delimiters to help create search time field extractions. When the extraction occurs depends on which Splunk instance includes the transforms.conf file – for the app/user context, put transforms.conf on a search head. Settings for search time extractions include:
REGEX = <regex> – the regular expression used
FORMAT = <string> – required for index time extractions, but optional for search time extractions. Specifies formatting, particularly using $<number> to specify the capture group to output the regex.
SOURCE_KEY = <string> – defines the field(s) where Splunk applies the regex – the default is _raw
DELIMS = <quoted string list> – only applicable for search time extractions, to extract fields based on a delimiter separating field values
FIELDS = <quoted string list> – gives the option to provide field names to extracted fields
For further reading, here is a full list of Splunk conf files, and once again, here is a list to my original blog post about global conf files. Happy Splunking!
The TimeChart function is one of most used visualizations of Splunk Dashboards, easily showing the volume of specific events, broken down by category over time. In certain situations, you may want to overlay additional data on top of your time chart to highlight certain events that correlate with the time chart. Luckily the masterminds at Splunk have already thought of a clever way on how we can flag certain search results and overlay it: Annotations!
It’s not as simple as clicking a few buttons on your dashboard. Don’t be worried though, it’s not difficult either! As long as looking at the XML source doesn’t scare you, you’ll be fine. Let’s continue.
Create a Chart Overlay
In this example we’ll be using the Simple XML Dashboard. The below data will show a count of events over the span of 2 months. They’re placed into 1-day buckets using the span argument.
Additionally, we’ll group these events by their action so we can distinguish the two different actions.
This gives us a TimeChart that will look like this:
Now, let’s stack our chart to reduce clutter across the TimeChart.
To give us more clarity in our data, we can also add an overlay to show the total of both groupings. We can do this with the addtotals command.
Now we can use the new field created by the addtotals command, to overlay in the Dashboard settings.
This gives us a Dashboard that looks like this. You’ll see the orange TOTAL line is now added to the TimeChart.
Now for the fun part. Let’s add in the Annotations, or flags, to highlight certain events.
In this example, I’ll just be using a unique timestamp value from 3 of the events, but in real world situations you could use a dynamic search to flag server reboots or critical errors on an application.
To add the Annotations:
1) Go into ‘Edit’ on your Dashboard and modify the XML source.
2) Find the <chart> for your TimeChart in the XML
3) Insert this annotation XML directly below the opening <chart> tag:
<search type="annotation">
<query>YOUR SPL QUERY HERE
| eval annotation_label = “ANNOTATION LABEL – FREE TEXT HERE (optional)”
| eval annotation_category = “SPECIFY A SPLUNK FIELD HERE (optional)”
</query></search>
After saving the XML, you’ll see your annotations display on your TimeChart if it found matching events. It may look something like this:
If you hover over the annotation label, you’ll see what we defined under the eval annotation commands.
Voila! You’ve got yourself a powerful visualization, able to show multiple data sources and correlate them together through the TimeChart command. Happy Splunking!
By Bryan Bollou, Team Lead, Cybersecurity Engineering
Purpose of TekStream Security Bulletins
With the TekStream Security Bulletin, we are presenting some specific detection use cases using everyone’s favorite SIEM Splunk! We’ve cherry-picked vulnerabilities that are not only intriguing but also directly impactful for our valued clients. These vulnerabilities were chosen based on a multitude of factors, ranging from the technology in the crosshairs to the specific sectors being targeted. This is not a blog post to fully explain or give recommendations on remediating the vulnerability – this has been discussed at length by various resources. The goal here is to aggregate the detections to maximize your chances of detecting an attempt to exploit these vulnerabilities. A part of that is gathering the list of IOCs scattered in multiple locations on the internet and looking at activity that could point to the vulnerability being exploited. Here at TekStream, we have an amazing team of cybersecurity engineers armed with a deep knowledge of logs and the secrets they hold, ready to fortify your cyber resiliency!
Introduction
Confirmed to have been in use since July 3rd, 2023, the vulnerability CVE-2023-36884 is a zero-day Office and Windows HTML Remote Code Execution Vulnerability. This is an unpatched vulnerability that could be exploited by doing the following.
An attacker designs a Microsoft document that downloads a malicious file when simply opened by an unsuspecting user.
The malicious file downloaded has a script that injects an iframe into the system.
This then leads to another download with a malicious payload. This payload can contain any number of malware including adware, spyware, and even ransomware. A well-known malware family associated with this vulnerability is “RomCom” malware.
Threat Overview
The vulnerability has been acknowledged by Microsoft and they have suggested various mitigation steps to prevent its exploitation. These steps include Blocking Office applications from creating child processes or setting the FEATURE_BLOCK_CROSS_PROTOCOL_FILE_NAVIGATION registry key to avoid exploitation. In this blog post, we would like to present some specific detection use cases using everyone’s favorite SIEM: Splunk.
For information on remediating the vulnerability, various resources have discussed this at length, notably Picus Security. We recommend you review their assessment.
Aggregate Detections
The goal here is to aggregate the detections to maximize your chances of detecting an attempt to exploit this vulnerability. A part of that is gathering the list of IOCs scattered in multiple locations on the internet and looking at activity that could point to the CVE-2023-36884 vulnerability being exploited. Here at TekStream, we have several security engineers that are intimate with cybersecurity knowledge and especially the logs of our clients.
In this blog post, we go through the various steps in CVE-2023-36884 vulnerability exploitation and detection. With this format, we are providing a more generic data model “tstats” command. This is taking advantage of the data model to quickly find data that may match our IOC list. We then provide examples of a more specific search that will add context to the first find. There will be a wide variety of specific searches as each client has their own specific technologies.
Note: The initial infected Microsoft document is normally sent to the victims through a phishing campaign. Detecting this part is not covered in this blog post.
The following detection steps mirror the stages and TTP-related indicators used in the attack:
Detect if any Microsoft application started processes with PowerShell or a Windows shell – cmd.exe or powershell.exe.
Detect connections to IP addresses associated with malware known to exploit this vulnerability.
Detect connections to domains associated with malware known to exploit this vulnerability. Also, detect connections to URLs associated with malware that exploit this vulnerability and allow users to pay ransoms.
Detect if a “.url” file was created in Microsoft Office’s recent folder: C:Documents and Settingsuser profileApplication DataMicrosoftOfficeRecent.
Detect hashes and filenames of scripts known to exploit this vulnerability.
Threat Implication
Phishing campaigns with Microsoft document attachments are the main method of delivery to exploit this vulnerability.
Customers who use Microsoft Defender for Office are protected from attachments that attempt to exploit this vulnerability.
Threat Detection
Step 1
When exploiting this vulnerability, a maliciously modified document is normally sent to a victim in a phishing email. This document will then spawn a child process when opened by an Office application to download more malicious files. Thus, detecting if any Microsoft application started processes with PowerShell or a Windows shell – cmd.exe or powershell.exe is the first step in detection.
Actions Detect
SPL
| tstats `summariesonly` latest(_time) as _time, values(Processes.user) as user, values(Processes.process) as process, latest(Processes.parent_process) as parent_process, latest(Processes.parent_process_exec) as parent_process_exec, latest(Processes.parent_process_guid) as parent_process_guid, latest(Processes.parent_process_id) as parent_process_id, latest(Processes.parent_process_path) as parent_process_path, latest(Processes.process_path) as process_path, latest(Processes.process_exec) as process_exec, latest(Processes.process_guid) as process_guid, latest(Processes.process_id) as process_id, latest(Processes.process_hash) as process_hash from datamodel="Endpoint"."Processes" where (Processes.parent_process IN ("Excel.exe","Graph.exe","MSAccess.exe","MSPub.exe","PowerPoint.exe","Visio.exe","WinProj.exe","WinWord.exe","Wordpad.exe") AND Processes.process IN ("cmd.exe","powershell.exe")) by Processes.dest, Processes.process_name, Processes.parent_process_name| head 10000 | `drop_dm_object_name("Processes")`| fields _time, dest, user, process_name, process, process_hash, process_path, process_exec, process_id, process_guid, parent_process, parent_process_name, parent_process_path, parent_process_exec, parent_process_guid, parent_process_id
Step 2
There are two steps in the exploitation of this vulnerability in which a maliciously modified document may attempt to connect to an external source to download additional malicious scripts and/or payloads. To detect the connection to some of the known destinations associated with this malware, this detection looks for attempted connections to known bad IP addresses.
Actions Detect
Attempted Connections to the following IP addresses. Note: These and other IOCs are listed in the CSV attached at the end of this blog post.
SPL
| tstats `summariesonly` latest(_time) as _time, sum("All_Traffic.bytes") as bytes, values("All_Traffic.src_port") as src_port, values("All_Traffic.transport") as transport, values("All_Traffic.dest_port") as dest_port from datamodel="Network_Traffic"."All_Traffic" where All_Traffic.src IN ("104.234.239.26","138.124.183.8","209.127.116.190","209.159.147.170","45.9.148.118","45.9.148.123","45.9.148.219","65.21.27.250","66.23.226.102","74.50.94.156 ","74.50.94.156","94.232.40.34") OR All_Traffic.dest IN ("104.234.239.26","138.124.183.8","209.127.116.190","209.159.147.170","45.9.148.118","45.9.148.123","45.9.148.219","65.21.27.250","66.23.226.102","74.50.94.156 ","74.50.94.156","94.232.40.34") by "All_Traffic.action", "All_Traffic.src", "All_Traffic.dest", "All_Traffic.user" | head 10000 | `drop_dm_object_name("All_Traffic")`| eval earliest_time = IF(isnum("$earliest_time$"),"$earliest_time$",strftime(relative_time(now(),"$earliest_time$"),"%s")) | eval latest_time = CASE(isnum("$latest_time$"),"$latest_time$","$latest_time$"="now",now(),1=1,strftime(relative_time(now(),"$latest_time$"),"%s")) | where _time >= earliest_time AND _time <= latest_time | head 10000 | table action, src, src_port, dest, transport, dest_port, user, bytes
Step 3
Like above, there are two steps in the exploitation of this vulnerability in which a maliciously modified document may attempt to connect to an external source to download additional malicious scripts and/or payloads. To detect the connection to some of the known destinations associated with this malware, this detection looks for attempted connections to known bad domains.
Detect connections to URLs associated with malware that exploit this vulnerability and allow users to pay ransoms.
| tstats `summariesonly` sum("Web.bytes") as bytes,values("Web.http_content_type") as http_content_type,values("Web.http_method") as http_method,values("Web.http_user_agent") as http_user_agent,values("Web.status") as status from datamodel="Web"."Web" by "Web.src", "Web.dest", "Web.user", "Web.http_referrer", "Web.url", _time | `drop_dm_object_name("Web")` | where match(url, "(?i)(altimata.org)|(bentaxworld.com)|(finformservice.com)|(penofach.com)|(ukrainianworldcongress.info)|(wexonlake.com)") | fields _time src, dest, user, http_referrer, url, http_content_type, http_method, http_user_agent, status, bytes | eval ip_pair = src . " - " . dest | stats values(_time) as Time values(ip_pair) AS src_dest, values(user) as user, values(http_referrer) as http_referrer, values(http_user_agent) as http_user_agent, values(http_method) as http_method, values(status) as status, values(bytes) as bytes count by url | fieldformat Time = strftime(Time,"%m/%d/%Y %T")
Detect URLs
| tstats `summariesonly` sum("Web.bytes") as bytes,values("Web.http_content_type") as http_content_type,values("Web.http_method") as http_method,values("Web.http_user_agent") as http_user_agent,values("Web.status") as status from datamodel="Web"."Web" where Web.url IN ("https://finformservice.com:80/api/v1.5/subscriptiontoken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9","https://finformservice.com:80/api/v1.5/subscriptiontoken=eyJpZCI6MTIzNDU2Nzg5LCJuYW1lIjoiSm9zZXBoIn0","https://finformservice.com:80/api/v1.5/subscriptiontoken=OpOSSw7e485LOP5PrzScxHb7SR6sAOMRckfFwi4rp7o","https://65.21.27.250:8080/mds/O--------------------------","https://finformservicecom:8080/mds/S-------------------------- ") by "Web.src", "Web.dest", "Web.user", "Web.http_referrer", "Web.url", _time | `drop_dm_object_name("Web")` | fields _time src, dest, user, http_referrer, url, http_content_type, http_method, http_user_agent, status, bytes | eval ip_pair = src . " - " . dest | stats values(_time) as Time values(ip_pair) AS src_dest, values(user) as user, values(http_referrer) as http_referrer, values(http_user_agent) as http_user_agent, values(http_method) as http_method, values(status) as status, values(bytes) as bytes count by url| fieldformat Time = strftime(Time,"%m/%d/%Y %T")
Step 4
During the exploitation of the vulnerability, a new file normally one with a “.url” extension has been seen to be dropped. This would be detected in the Microsoft Office’s “recent” folder: C:Documents and Settingsuser profileApplication DataMicrosoftOfficeRecent
Actions Detect
A file with the extension “.url” created or moved into the Microsoft Office “recent” folder.
SPL
| tstats `summariesonly` latest(_time) as _time, latest(Filesystem.file_create_time) as file_create_time, latest(Filesystem.file_modify_time) as file_modify_time, latest(Filesystem.file_access_time) as file_access_time from datamodel="Endpoint"."Filesystem", values(Filesystem.dest) as dest, values(Filesystem.action) as action, values(Filesystem.file_name) as file_name, values(Filesystem.file_hash) as file_hash, values(Filesystem.file_path) as file_path, values(Filesystem.file_size) as file_size |`drop_dm_object_name("Filesystem")` | where match (file_name, "(i?)(.url)$” AND match(file_path, “(?i)( C:\\Documents and Settings\\.*\\Application Data\\Microsoft\\Office\\Recent))”| fields _time, dest, action, file_name, file_hash, file_path, file_size, file_create_time, file_modify_time, file_access_time
| fieldformat Time = strftime(_time,"%m/%d/%Y %T")
Step 5
While there is a ton of variety for the malware payload that can be downloaded in the last step of this vulnerability’s exploitation, there are certain scripts seen often. This detection is to find the hashes of these commonly seen malicious scripts in a client’s environment.
Actions Detect
The occurrence of the following hashes in the environment.
SPL
| tstats `summariesonly` latest(_time) as _time, latest(Filesystem.file_create_time) as file_create_time, latest(Filesystem.file_modify_time) as file_modify_time, latest(Filesystem.file_access_time) as file_access_time from datamodel="Endpoint"."Filesystem", values(Filesystem.dest) as dest, values(Filesystem.action) as action, values(Filesystem.file_name) as file_name, values(Filesystem.file_hash) as file_hash, values(Filesystem.file_path) as file_path, values(Filesystem.file_size) as file_size where Filesystem.file_hash IN ("0501d09a219131657c54dba71faf2b9d793e466f2c7fdf6b0b3c50ec5b866b2a","07377209fe68a98e9bca310d9749daa4eb79558e9fc419cf0b02a9e37679038d","1a7bb878c826fe0ca9a0677ed072ee9a57a228a09ee02b3c5bd00f54f354930f","3a3138c5add59d2172ad33bc6761f2f82ba344f3d03a2269c623f22c1a35df97","48142dc7fe28a5d8a849fff11cb8206912e8382314a2f05e72abad0978b27e90","5f40cb4852ec50ee24f3cd951a172c725d02012d17dd645b6ce22d324aa140ad","a61b2eafcf39715031357df6b01e85e0d1ea2e8ee1dfec241b114e18f7a1163f","d3263cc3eff826431c2016aee674c7e3e5329bebfb7a145907de39a279859f4a","e7cfeb023c3160a7366f209a16a6f6ea5a0bc9a3ddc16c6cba758114dfe6b539") |`drop_dm_object_name("Filesystem")` | fields _time, dest, action, file_name, file_hash, file_path, file_size, file_create_time, file_modify_time, file_access_time
| fieldformat Time = strftime(_time,"%m/%d/%Y %T")
Conclusion
It is highly recommended to implement scheduled searches using lookup tables, as demonstrated above, to enhance the precision of matching specific and novel detections. By setting these searches to run continuously, you can ensure constant monitoring of your assets for emerging vulnerabilities. To maintain timeliness and efficiency, it is essential to remove old, patched vulnerabilities from the lookup table. If you need assistance in creating a dynamic and customizable process tailored to your environment, feel free to consult our experts by completing the form below. Additionally, stay informed by subscribing to the TekStream blog for the latest monthly security bulletin and applying the most recent detections to fortify your systems. Happy Splunking!
References
Articles referenced and used for this security bulletin:
The approaches recommended herein have not been tested broadly across the TekStream customer base. They are preliminary in nature and come without any certification of efficacy.
Today, I want to introduce you to a new way of simplifying configuration management with Splunk’s deployment server/deployment client architecture. The goal is to get you out of the business of constantly adding new hostnames to or removing hostnames from whitelists or csv files in your serverclass.conf file on your deployment server. You can put all that on automatic with this approach.
Overview
As an overview, a deployment server manages the configuration for multiple deployment clients, usually forwarders, via a model where clients connect to a deployment server, identify themselves and then, based on that identification, download app bundles from the deployment server which the deployment server has been configured for them to receive. This determination by the deployment server of which apps a client downloads is usually done by matching the hostname of the client or its IP address against a list of values defined in a configuration file called “serverclass.conf” on the deployment server. These lists are in the form of one or more whitelist or blacklist settings in a “serverClass” stanza and are typlically comprised of hostnames and IP addresses, either in whole or in part with the use of wildcards (*). Whenever a new deployment client is added or an old one retired, a change to these listings must be made and the deployment server’s configuration reloaded.
Auto-Scale AWS Heavy Forwarders
Let’s say, for example, you need to auto-scale heavy forwarders to handle increased AWS event traffic. You can’t be constantly adding and removing ec2 instance names to one or more serverclasses in serverclass.conf. You need a way to have the deployment client communicate to the deployment server, letting it know “I’m an AWS heavy forwarder” and have the deployment server recognize that and send the client a listing of apps to install and update based solely on its classification as an “AWS heavy forwarder” without needing to have the particular hostname or IP address or IP address range detailed anywhere in serverclass.conf.
The answer here is to add that designation to the deployment client when the universal forwarder software is installed. This way, when the deployment client connects to the deployment server for the very first time, it identifies itself properly. This designation is defined in a setting called “clientName” in deploymentclient.conf in the “[deploynent- client]” stanza. It is recommended this setting be added to the copy of deploymentclient.conf in $SPLUNK_HOME/etc/system/local as it is an identifier for that particular server and will remain untouched by any changes made by the deployment server in $SPLUNK_HOME/etc/apps. Unlike “hostname” or “DNS name”, multiple deployment clients can have the same clientName. It’s just a categorization, a tag, a label to say, “I’m a web server” or “I’m a database server” or, in our example, “I’m an AWS heavy forwarder.” The actual value you use for clientName by itself is unimportant. What is important is that the “clientName” in deploymentclient.conf matches against one or more server classes on the deployment server to determine which apps are to be retrieved by the client from the server.
So, a deploymentclient.conf file in $SPLUNK_HOME/etc/system/local might look like this:
[deployment-client] clientName = aws-idm
and the serverclass.conf file on the deployment server might contain something like this:
Notice that you use the “clientName” value in serverclass.conf in the same way you would use hostname or IP address. So, you could also have a configuration in serverclass.conf that looks like this:
This configuration could be used to address all AWS instances running a Linux OS to distribute the Unix/Linux TA to them.
Mix and Match Identifiers
You can also mix and match the use of clientName with the other identifiers such as hostname or IP address. So, this example is also possible using a wildcarded clientName of “:oracle:”:
Remember that the order of these various identifiers like “clientName”, “hostname” and “IP address” are evaluated by the deployment server. “clientName” takes precedence over “hostname” or “DNS name”. So, you can use a phased in approach if you want to introduce this categorization system into an existing Splunk deployment. Add the clientName values alongside the existing hostnames and other identifiers. As deployment clients are configured with their clientName value, it is that value that will take precedence and eventually, when all clients have a clientName, the hostname can be removed from serverclass.conf to clean up the file. Just be careful during the transition. Just because clientName is part of the client’s identification of itself doesn’t mean that hostname or IP address is ignored. They are still part of the identification. The precedence just means that, should both identifiers exist in a serverClass stanza, the clientName setting will be decisive in determining the client’s membership in that serverClass.
clientName Values
The clientName value can be anything. You don’t need to segment it with dashes or colons. It could be just a string like “weblogic” or “database”. However, I have found in implementing this approach with customers that using segmentation in the value allows these clientNames to have multiple dimensions in them. You could, for example, identify a host as being in “Production” versus “Development”, in the “Finance” department or the “Sales” department, in the “Seattle”, “Chicago” or “New York” offices, all within the same clientName. For example:
newyork:sales:sqlserver:prod
By evaluating the segments, different apps can be sent to different hosts simply distinguished only by the value of one particular segment. For example, a serverClass to configure the collection of database log events from all the Microsoft SQL Server hosts could, using the example hostname above, employ a simple whitelist like:
Or server classes could be configured to send prod hosts’ event data to a production indexer cluster while those in the development environment to the development cluster.
If you choose to take this approach, though, consider the nature of your infrastructure carefully and how Splunk is laid out in it. Then, design your “clientName” conventions to your best advantage.
In this article, you have seen how you can get out of the business of maintaining lists of server hostnames in serverclass.conf because of constantly onboarding new and removing decommissioned hostnames. With the “clientName” setting in deploymentclient.conf, you can put the management of configuring deployment clients on automatic.
Splunk’s dashboarding capabilities separate it from the rest of the pack. The ability to normalize and visualize data in a way that’s meaningful to all levels of an organization is one of the many reasons it has been widely adopted by businesses in nearly every industry. To achieve this level of versatility, Splunk dashboards come out-of-the-box with powerful features that allow users to create flexible and reusable templates. One of those features is the dynamic input.
Dynamic Inputs: Pros and Cons
Dynamic inputs let you pass one or more values to a panel by using a separate SPL search to populate a list of values. When a user loads a dashboard with dynamic inputs, the populating searches run automatically and return the list of values.
Pros
Dynamic inputs (by definition) are non static, which makes them good for data that changes frequently. That translates to less time reworking inputs to fit incoming data, making your dashboards more flexible.
Cons
It adds another search, and could eat up more resources. This is why we need to make it as performative as possible, and we’ll use tstats to do that.
What is tstats and How is it Used?
Tstats is a generating command that performs statistical queries on indexed fields (as opposed to search time fields). It works similarly to the stats command and even uses the same functions, with one key difference: tstats performs these operations on the tsidx files, as opposed to the raw data in the indexes. This makes tstats much faster than stats: it’s like looking at the table of the contents for information instead of flipping through the whole book.
Implementing tstats Into the Dashboard Inputs
Imagine a Classic dashboard panel showing the top sources by host for a given index. Perhaps this is shown through a piechart visualization. If the list of possible hosts changes frequently, or are too numerous to type by hand, a dynamic input token might be the right tool for the job.
In the dashboard while in Edit mode, select “Add Input” and choose the appropriate input type for your use case. In this example, the Dropdown option will do nicely. These are the important settings and their values:
Under “General” – set the appropriate label and make sure “Search on Change” is selected.
Under “Token Options” – give the “Token” field the name of the token to use for this input.
Under “Dynamic Options” – the “Search String” text box is where you’ll put the search that dynamically returns the values. This is where the tstats search will go. Two things to consider: make sure the search returns a list of values, and be sure to set the time range appropriately for your use case. With tstats you can look over longer time ranges without drastically impacting how long the search runs. Set the values for “Field for Label” and “Field for Value”, which can both be the name of the output field (in most cases). Below is a simple example:
| tstats values(host) where index=<your_index_name>
| rename values(host) as Hosts
| stats list() by Hosts
Once finished, click “Apply”. Double check that your search is returning the correct results and each host is selectable in the dropdown. Finally, add the input token you just created to the appropriate search(es).
That’s it! You can add multiple dynamic inputs to your dashboard by repeating these steps, or pass multiple values through a single token by making a few changes:
Instead of using the Dropdown input, select “Checkbox” or “Multiselect”
2. Adjust the SPL in the relevant panels to accept multiple values:
My guess is that this will demonstrate that Splunk really does stand out from the pack. With the ability to normalize and visualize your data, you’ll provide actionable insights and put your company on the path to success using Splunk. Fill out the form below if you’d like to ask more. Happy Splunking!