Tag: enterprise security

  • Troubleshooting Guide: Assets & Identities in Splunk Enterprise Security

    Troubleshooting Guide: Assets & Identities in Splunk Enterprise Security

    By Kamal Dorairaj, Senior Splunk Consultant

    Splunk Enterprise Security (ES) uses an asset and identity (A&I) information management system to correlate asset and identity information with events to provide context and enrich data. There are many docs and discussions on how to populate these A&I in Splunk ES but not many on how to troubleshoot A&I issues and validate the framework. This blog covers various actions as well as steps to assess and validate the A&I framework in Splunk ES.

    1. Validate Search Preview

    In Splunk ES, Navigate to Configure -> Data Enrichment -> Assets and Identity Management-> Search Preview. 
    All three search in this page run periodically to make sure that the ES framework is using the latest and updated assets and identities. For example: When we expand the “Identity_lookup_expanded” SPL, there will be two macros which are merged into identity and updated into the identity lookup file. Ideally when we open the search preview SPL, it should return zero events. Returning zero events means the KV store committed all the changes to the collections. It commits changes every 300 seconds which is configured under “Time” in the Miscellaneous Settings -> Global Settings.  

    2. Validate the Macros

    Run the “identity_lookup_expanded” SPL in a separate search. Below is an example of the SPL. 

    Splunk SPL search string showing identity correlation logic using eval and inputlookup.

    In this `add_entity_source(“TS Identities”,”TS Identities”)` is the macro that pulling the Identity details. Open this macro in a separate search window and expand it. Here we can see all the lookup files the search references.  

    Splunk Enterprise Security interface showing inputlookup and fillnull for TS Identities.

    Navigate to Settings -> “Searches, Reports and Alerts” -> Search for the “TS Identities”. Click the Report -> Review the SPL -> The search in this report is populating the above file. The SPL can be run over 7 days or 30days to check when it’s being populated. 

    3. Validate Correlation Setup

    Go to “Correlation Setup” under Asset and Identity Management -> Select “Enable for all sourcetypes” as in screenshot below. 

    Correlation setup options in Splunk Enterprise Security for asset and identity mapping.

    By enabling this option, every single search run on ES goes thru the identity lookup expanded and asset lookup expanded.  
    Let’s say for example, you have user=bob then correlation will try check to if identity=bob then try to pull all the information from the identity and details found and use it to enrich the events. So, this setting is very important for the ES framework. 

    4. Validate Enforce Props

    The “Enforce props” setting should be enabled under the Global Settings. If we do not enable this option, then the framework will be using stale lookups and not receiving the enrichments on ES searches. This setting is a must for RBA.  

    Enabling this option would bring more risk fields into the automatic lookups. If not enabled, then we are not running the latest version of the automatic lookups. Also, if there are any custom fields in the identity fields, those won’t be available in the automatic lookup. Basically, custom fields won’t be enriched in all the searches. Go to “Searches, Reports, and Alerts” -> Search for “SA-IdentityManagement” -> All the lookups for src, dest, user, src_user. On the backend, Splunk uses props to provide the enrichments for all these fields. 

    Splunk enforcement settings for props, macros, transforms and identity lookup.

    5. Validate Lookup Files

    Permissions of all the lookup files needs to be reviewed. Go to Lookups -> Lookup definition -> search for the lookup -> make sure permissions looks accurate. If correct, then take note of the csv file name and navigate to Lookups -> Lookup files -> check permissions and confirm it also looks correct.  

    The permissions should be scoped as global.  
    If all permissions appear accurate in the UI then directly ssh into the server.  

    Navigate to cd /opt/splunk and search for the lookup file by executing the following command: 

    Bash terminal command to locate assets_network.csv file for troubleshooting.

    Next run this: 

    ls -al <path of the file name returns from the above> and less the file name. 

    Terminal command to search for assets_network configuration in inputs.conf.

    Basically, looking for the csv files defined in any inputs.conf stanzas. 

    Next, check If any transforms are using it with the following: 

    Command-line search for assets_network references in transforms.conf file.

    6. Validate Thru Logs

    To look for any errors or issues in the log file, run the below SPL: 

    index=_internal source=*entity*  

    Check the source field for a list of used sources. We can see ‘identity manager log’, ‘entity merge log’ and ‘identity correlation rest handler log’. All these logs are related to the assets& identity framework logs. 

    For Example: A customer experienced WLM blocking their searches. Using the above SPL, we were able to further troubleshoot our issue. 

    When the identity manager runs it sends logs for everything into identity manager log. 

    Index=_internal source=*identity_manager.log 

    In the source field narrow your SPL to investigate the splunkd_access log. All rest calls executed are written in this log file. Make sure all the values for the filed status are “200”. 

    Splunk ES runs *Audit -* scheduled searches every day, which are it’s all-health check searches.

    Now, you can populate A&I in Splunk ES, but you also have a guide for troubleshooting issues and validating the framework. Splunk Enterprise Security is considered the most robust security platform out there, and with this set of steps you can ensure you’re getting the most from your instance.

    Our team is available if you have additional questions, just inquire using the form below. Find more Splunk Technical Blogs here, and learn more about TekStream Splunk Services here. Happy Splunking!

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