Author: dystrick

  • TekStream Security Bulletin: Akira on Cisco Adaptive Security Appliance (ASA) VPN

    TekStream Security Bulletin: Akira on Cisco Adaptive Security Appliance (ASA) VPN

    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:

    1. Connection attempts from malicious IPs to the Cisco ASA VPN
    2. Connection attempts to hit the CISCO ASA VPN URL using a parameter string often seen with brute force attacks
    3. Connection attempts to log in to the CISCO ASA VPN with often-used account names
    4. Process execution of set.bat and nd.exe files to expose more credentials and enable lateral movement of the threat actor
    5. 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
    6. 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.

    Table showcasing actions to detect if known ATP and IP addresses have conducted the exploitation vulnerability of CISCO ASA VPNs have been captured.

    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.

    SPL – Using the Cisco ASA Data Source:

    index=cisco* sourcetype=cisco:asa eventtype=cisco_vpn* src_ip 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") |  table _time, Cisco_ASA_action, Cisco_ASA_message_id, Cisco_ASA_user, src_ip, dest_ip, direction, signature

    SPL 2 – Using Network Traffic Data Model:

    | 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:

    A table showcasing actions to detect if known ATP and IP addresses have conducted the exploitation vulnerability of CISCO ASA VPNs has been captured using often-used account names to determine exploitation.

    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.

    SPL – Using the Cisco ASA Data Source:

    index=cisco* sourcetype=cisco:asa eventtype=cisco_vpn* Cisco_ASA_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")|  table _time, Cisco_ASA_action, Cisco_ASA_message_id, Cisco_ASA_user, src_ip, dest_ip, direction, signature

    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 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
    

    IOC List

    We have aggregated a list of IOCs related to the Cisco ASA VPN exploitation. It has been presented here for you to have it consolidated in one spot and made easier to export to a lookup for notable detections.

    Conclusion

    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!

    References

    Articles referenced and used for this Blog Post:

    Akira Ransomware Targets Cisco VPNs to Breach Organizations

    Hacking Campaign Bruteforces VPNs to Breach Networks

    Cisco ASA Ransomware Attacks

    Under Seige Rapid7 Observed Exploitation of Cisco ASA SSL VPNs

    Akira Ransomware Attacking VPNs Without Multi-Factor Authentication

    Disclaimer

    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.

  • How to Avoid Skipped Searches in Splunk Cloud

    How to Avoid Skipped Searches in Splunk Cloud

    By Kamal Dorairaj, Senior Splunk Consultant

    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.

  • A Beginner’s Guide to Splunk App/User Context Configuration Files

    A Beginner’s Guide to Splunk App/User Context Configuration Files

    By Eric Levy, Splunk Consultant

    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):

    1. User directories for current user (/opt/splunk/etc/users/) – local, then default
    2. App directories for current running app (/opt/splunk/etc/apps/running_app_name)– local, then default
    3. App directories for other apps (/opt/splunk/etc/apps/other_app_name/) – local, then default
    4. System directories (/opt/splunk/etc/system/) – local, then default

    For example, if I had savedsearches.conf files stored within:

    1. /opt/splunk/etc/users/admin/search/local/savedsearches.conf
    2. /opt/splunk/etc/apps/search/local/savedsearches.conf
    3. /opt/splunk/etc/apps/search/default/savedsearches.conf
    4. /opt/spunk/etc/apps/TA-splunksearches/local/savedsearches.conf
    5. /opt/splunk/etc/system/local/savedsearches.conf

    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!

  • Creating Chart Overlays and Annotations (Flags) in a TimeChart

    Creating Chart Overlays and Annotations (Flags) in a TimeChart

    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.

    SPL code example using timechart to count actions (search and list_health) over daily intervals in the audit index.

    This gives us a TimeChart that will look like this:

    Splunk bar chart displaying daily counts of 'search' and 'list_health' actions with separate bars for each category.

    Now, let’s stack our chart to reduce clutter across the TimeChart.

    Splunk chart editing panel set to stacked mode with multi-series enabled, allowing for layered visualization of time series data.
    Stacked bar chart showing combined daily totals for 'search' and 'list_health' actions for visual comparison over time.

    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.

     SPL query showing the addition of a TOTAL field using addtotals to sum all daily action counts across columns.
    Bar chart showing TOTAL count as a third category, alongside search and list_health, visualized in distinct colors.

    Now we can use the new field created by the addtotals command, to overlay in the Dashboard settings.

    Splunk chart overlay settings with TOTAL selected as the overlay metric and axis view toggled on.

    This gives us a Dashboard that looks like this. You’ll see the orange TOTAL line is now added to the TimeChart.

    Combined bar and line chart showing 'search' and 'list_health' as bars, with a TOTAL overlay as a line for trend analysis.

    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.

    Splunk dashboard editor showing UI and Source buttons for switching between visual and XML editing views.

    2) Find the <chart> for your TimeChart in the XML

    XML snippet of a Splunk dashboard panel showing a timechart query, addtotals, and display options like chart height and refresh settings.

    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>
    XML code snippet showing how to define an annotation search within a Splunk dashboard. The query uses eval to define annotation_label as “- - - URGENT EVENT! - - -” and assigns the annotation_category based on the action field.

    After saving the XML, you’ll see your annotations display on your TimeChart if it found matching events. It may look something like this:

    A Splunk timechart displaying stacked bar and line data with three vertical dashed lines and flags at the top—representing annotated timestamps for urgent events layered onto the TOTAL line overlay.

    If you hover over the annotation label, you’ll see what we defined under the eval annotation commands.

    Close-up of a tooltip on a Splunk timechart annotation flag. It reads “- - - URGENT EVENT! - - -” and provides the action category (search) and the exact timestamp of the event (Oct 31, 2022, 11:36:12.220 PM).

    Voila! You’ve got yourself a powerful visualization, able to show multiple data sources and correlate them together through the TimeChart command. Happy Splunking!

  • Security Bulletin: Microsoft Zero-Day Office & Windows Vulnerability

    Security Bulletin: Microsoft Zero-Day Office & Windows Vulnerability

    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: 

    1. Detect if any Microsoft application started processes with PowerShell or a Windows shell – cmd.exe or powershell.exe.  
    1. Detect connections to IP addresses associated with malware known to exploit this vulnerability. 
    1. 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. 
    1. Detect if a “.url” file was created in Microsoft Office’s recent folder: C:Documents and Settingsuser profileApplication DataMicrosoftOfficeRecent. 
    1. 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
    Table listing Microsoft Office applications as parent processes (e.g., Excel.exe, Word.exe, PowerPoint.exe) capable of spawning suspicious child processes like cmd.exe and powershell.exe—an indication of possible exploit activity linked to a zero-day vulnerability.
    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.

    Duplicate table showing Office-based parent processes and associated child processes (cmd.exe, powershell.exe) involved in potentially malicious behavior exploited in Microsoft’s zero-day vulnerability.
    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.

    Actions Detect

    Attempted Connections to the list of domains. IOC Domain Checklist

    SPL

    Detect Domains

    | 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.

    Table displaying two columns of hexadecimal hash values—likely file or process hashes—used to identify known malicious files or indicators of compromise (IOCs) associated with the Microsoft Office and Windows zero-day vulnerability.
    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:

    CVE-2023-36884 – Microsoft Office and Windows HTML Remote Code Execution: Threat Brief (Updated)

    Storm-0978 attacks reveal financial and espionage motives

    CVE-2023-36884: A Detailed Look at The Recent Microsoft Vulnerability

    Yet Another Microsoft Office365 zero-day: CVE-2023-36884

    Disclaimer

    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.

  • Using clientName to Simplify Forwarder Management

    Using clientName to Simplify Forwarder Management

    By Jon Walthour, Technical Architect

    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:

    [serverClass:aws-heavy-forwarders] whitelist.0 = aws-idm
    
    [serverClass:aws-heavy-forwarders:app:Splunk_TA_aws]
    

    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:

    [serverClass:all-aws] whitelist.0 = aws-*
    machineTypesFilter = linux-x86_64 [serverClass:all-aws:app:Splunk_TA_nix]
    

    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:”:

    [serverClass:all-oracle] 
    whitelist.0 = *:oracle:* 
    whitelist.1 = oraclehost01 
    whitelist.2 = oraclehost02 
    whitelist.3 = 192.168.23.*

    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:

    [serverClass:mssqlservers] whitelist.0 = *:*:sqlserver:*

    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.

    [serverClass:prod_forwarder_outputs] whitelist.0 = *:*:*:prod
    
    [serverClass:dev_forwarder_outputs] whitelist.0 = *:*:*:dev
    

    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.

  • TekStream Achieves AWS Partner Government Services Competency  

    TekStream Achieves AWS Partner Government Services Competency  

    Designation Recognizes TekStream Expertise in Unique Needs of Government Migration Projects and Maximizing AWS Funding Programs to Offset Client Migration Expenses

    Atlanta, Georgia, July 24, 2023 – TekStream Solutions, LLC is pleased to announce its selection by Amazon Web Services (AWS) as an Advanced Technology Partner in the AWS Government Competency Program. This designation recognizes TekStream’s proven ability to help Government agencies migrate, modernize, and optimize their workloads on AWS.  

    As an AWS Government Services Competency Partner, TekStream is authorized to provide the full range of migration services, including assessment, planning, design, implementation, operation and optimization. Migration is a critical part of cloud adoption, and TekStream has the experience and expertise to ensure state, local and federal agencies successfully transition critical workloads to AWS.  

    “We are excited to be named an AWS Government Services Competency Partner,” says Troy Allen, Vice President, Cloud Services at TekStream. “This designation reflects our extensive technical experience migrating government workloads to the cloud and modernizing their applications. It is a rigorous selection process, and we are proud TekStream was recognized by AWS as being well equipped to provide our customers an enhanced level of service.”    

    “The AWS Government Services Competency Partner designation gives our teams access to exclusive AWS resources and incentives as well as unique partner programs,” says Judd Robins, EVP, Sales & Marketing at TekStream. “This combined with our experience and understanding of AWS toolsets uniquely positions our teams to create and implement cloud migration and transformation plans across a variety of industries and use cases.” 

    One of TekStream’s recent government customers to receive AWS funding was the Georgia Technology Authority (GTA). TekStream helped them migrate their on-premise datacenter to the AWS Cloud, improving resiliency and stability. GTA realized $1M annual savings by moving workloads to the cloud and leveraged $150k in AWS incentives to fund their migration. Access to AWS funding allowed them to launch the program without cost, avoiding the long budgeting process some government agencies face. 

    As an AWS Partner with awarded designations including Migration Services Competency, Oracle Migration Competency and now the Government Services Competency TekStream has unique access to special funding programs that subsidize costs to migrate to the cloud. TekStream experts have the know-how and training to take maximum advantage of these special funding sources as they help clients anticipate, plan, and activate cloud migration initiatives. For more information on these programs, visit www.tekstream.com/aws funding.   

    About TekStream:  

    TekStream, (www.tekstream.com) headquartered in Atlanta, Georgia, helps clients accelerate digital transformation by navigating complex technology environments with a combination of technical expertise and staffing solutions. TekStream provides battle-tested processes and methodologies to help companies with legacy systems get to the cloud faster, so they can become more agile, reduce costs and improve operational efficiencies. With hundreds of successful deployments, TekStream guarantees on-time and on-budget project delivery and is proud to have 98% customer retention. 

  • Dynamic Inputs: Make Your Splunk Dashboards More Flexible

    Dynamic Inputs: Make Your Splunk Dashboards More Flexible

    By Nate Hufnagel, Splunk Consultant

    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.

    Pie chart visualization in Splunk showing the distribution of log file sources by host. The majority of the data originates from a Windows-based universal forwarder path, with additional sources from various Linux-based log files.

    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
    
    Dynamic dropdown configuration panel in Splunk dashboard settings. The configuration uses a search string to populate the dropdown with host values from a specified index over the last 60 minutes.

    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).

    Splunk dashboard editor displaying a checkbox input configuration. Multiple dynamically populated host values are shown as selectable options using a token named “host_token.”

    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:

    1. Instead of using the Dropdown input, select “Checkbox” or “Multiselect”
    Splunk search query using a tokenized input. The query filters internal index logs based on selected hosts and uses the top command to return the five most frequent sources.

    2. Adjust the SPL in the relevant panels to accept multiple values:

    Screenshot showing how to 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!

  • TekStream Recognized in 2023 Splunk Partner Awards 

    TekStream Recognized in 2023 Splunk Partner Awards 

    TekStream Named 2023 Public Sector Trailblazer Award Winner for Outstanding Partnership 

    ATLANTA, GA – July 18, 2023 – TekStream, the Atlanta-based firm specializing in Managed Detection and Response (MDR) and a Shared SOC model for universities and state/local government, announced today it has received the 2023 Public Sector Trailblazer Award for exceptional performance and commitment to their Splunk partnership. The Public Sector Trailblazer Award recognizes a Splunk partner who has demonstrated innovation and resilience using Splunk products & technologies to deliver breakthrough solutions to solve complex customer challenges. This partner goes above and beyond in their technology engagement with Splunk to deliver value to their customers with a proven ability to penetrate new markets with a joint value proposition. For more information on Splunk’s award program: 2023 Partner Awards.

    “Led by Bruce Johnson, Senior Director Enterprise Security, this team demonstrated a singular commitment to solving the unprecedented need for agencies and educational institutions to secure their intellectual property and citizen data,” says Matthew Clemmons​,​ Managing Director, Splunk at TekStream. “Our team works hard to help customers solve challenges every day, so it is fitting they are being recognized for a relentless commitment to excellence.”​    

    ​“This award recognizes an amazing team of expert developers who sought out new and trailblazing ways to handle urgent ransomware security issues faced by the public sector,” said Judd Robins, Executive Vice President, Sales and Marketing. “With Splunk as our partner, we can achieve great things.”​ 

    “Congratulations to TekStream for being named the 2023 Public Sector Trailblazer,” said Gretchen O’Hara, Vice President, Worldwide Partners and Alliances, Splunk. “The 2023 Splunk Partner Awards recognize partners like TekStream for outstanding performance and innovation and celebrate the joint success that helps customers build resilience and solve day-to-day challenges. Together we are focused on delivering continuous value to our joint customers.”

    The Splunk Partner Awards recognize dedicated global and regional partners who demonstrate a steadfast commitment to collaboration and innovation in their Splunk partnership to help customers achieve positive business outcomes and accelerate their mission to better the world. All award recipients were selected by a group of Splunk executives, theater leaders and the global partner organization.

    About TEKSTREAM

    TekStream accelerates clients’ digital transformation by navigating complex technology environments with a combination of technical expertise and staffing solutions. We guide client decisions, quickly implement the right technologies with the right people and keep them running for sustainable growth. Our battle-tested processes and methodology help companies with legacy systems get to the cloud faster, so they can be agile, reduce costs and improve operational efficiencies. With hundreds of deployments under our belt, we can guarantee on-time and on-budget project delivery. That’s why 98% of our clients are repeat customers.

    Media Contact Information: Cece Kintner, Marketing Operations Manager, [email protected] or 404-643-1847.

    ### End Release ### 

  • Looping Around the Block – Using Loops with Ansible Blocks

    Looping Around the Block – Using Loops with Ansible Blocks

    By William Phelps, Senior Technical Architect

    It’s a real “task” to use Ansible sometimes.

    In reality, everything in Ansible is a task. A task is the basic work unit within an Ansible playbook. A task is also the smallest unit of work within an Ansible script.

    Each task calls an Ansible “module” to perform its intended function. Once a task is completed, the next task is called. That next task can be blissfully unaware of anything that happened in the previous task (or any previous tasks as well.) This is actually a very powerful feature at times, as different tasks can then have differing environment variables or a different user executing each task. For example, think of needing to execute one or more tasks as root, whereas the rest of the play is meant to be executed with lower privilege.

    However, today’s topic initially looks at the need to execute a series of tasks as more or less a unit or “block”. Each task creates a result that subsequently needs to be passed to one or more following tasks. If a task fails, either the play stops with an error, or it needs to enter some kind of error handler.

    In general programming terms, this approach is called a try/catch/finally approach. Ansible uses the terminology block/rescue/always to refer to the same thing. Here is a schematic example:

    YAML code example showing an Ansible task block that includes a main block of commands, a rescue section for error handling, and an always section to execute final steps. Demonstrates control flow using blocks.

    Obviously this snippet would do very little, but merely illustrates the basic premise of an Ansible block.

    So now let’s further consider a use case where there this type of block needs to be executed repeatedly. For an example, there exists a list of file names in a folder. That list of files (or some attribute of each file) must be evaluated in the context of the block, and some series of actions must occur for each file.

    Normally, such looping is achieved in Ansible using the with_items or loop parameter within a task. For example, this snippet installs several packages using the yum module.

    Ansible playbook snippet using a loop to install multiple required libraries with the yum module. Features variables and with_items for iteration over packages.

    Depending on the Ansible module (in this case “yum”), the module may or may not support the with_items argument or the “loop” argument. “block” is one such module in Ansible. It also does not appear that Ansible will ever add such support.

    The approach to get around this limitation lies in a module called include_tasks. This module can work inside of a block, and also can accept loop arguments. For example:

    An Ansible task that loops over a list of files, using include_tasks to call an external subtasks.yml file, showing how to modularize repeated actions across items.

    All of the operations that need to looped then reside in the subtasks.yml file.  A simple example could be as shown:

    Contents of subtasks.yml, defining two tasks: one for copying a file to a specific location using a shell command, and another to echo the file name, both using {{ item }} to iterate over a list.

    Once the loop is finished, the next task in the main playbook script is executed.

    Don’t be thrown for a loop. This post is intended as more of a conceptual teaching post for Ansible rather than a working example. Please contact us if there is a need for working code for a real-world scenario.