This use case helps to monitor active user accounts on Windows OS that have not updated their passwords in the client system in more than “n” number of days. The “n” number of days depends on organizational policy. Using your Splunk instance is the best way to search for changes and monitor active updates.
Risk
The risk involved in having active user accounts with passwords not changed is that the organization might be susceptible to brute force attacks. A brute force attack is where an attacker will be trying to access a company’s network by trying all possible passwords until they get lucky (dangerous!!!!).
Control
Using LDAP can help set monitoring in place for active users whose passwords are yet to be changed or nearing expiration (based on organization policy). LDAP, or Lightweight Directory Access Protocol, is a communication protocol that provides the ability to access and maintain distributed directory information services over a network. LDAP is used in Microsoft’s Active Directory but can also be used in other tools. Querying the LDAP directory requires using the Supporting Add-on for Active Directory (SA-ldapsearch) from Splunkbase in order to use the ldapsearch command. The ldapsearch command will display the users, their respective organizational units, lastLogonTime, created date, pwdLastset and so on.
SPL Query
Begin your query like this:
|ldapsearch domain=<**your company domain**> search="(&(objectClass=user)(!(objectClass=computer)))"
| search userAccountControl!=ACCOUNTDISABLE
| rex "OU=(?<OU>[a-zA-Zs]+),DC"
| eval lasttime=strptime(pwdLastSet,"%Y-%m-%dT%H:%M:%S.%6N")
|eval diff=round(((now() - lasttime)/86400),2)
| eval timediff = n - diff
| stats values(whenCreated) as "Created Date" latest(lastLogonTimestamp) as "LastLogonTime" values(OU) as OU values(sAMAccountName) as sAMAccountName values(pwdLastSet) as PWDLastSet values(timediff) as "Time left to change password" by displayName
SPL Analysis
| ldapsearch domain=<**your company domain**> search="(&(objectClass=user)(!(objectClass=computer)))"
This is querying the ldap tree for users, service accounts and not computers.
| search userAccountControl!=ACCOUNTDISABLE
This is searching for the active users and service accounts and ignoring disabled accounts
| rex "OU=(?<OU>[a-zA-Zs]+),DC"
This is optional and depends on the use case. This is a field extraction for the list of “Organizational Unit” that each user or service accounts belongs to in the ldap tree.
Converts the “pwdLastSet” timestamp field to current Unix epoch time to allows make further comparisons by creating a field “lasttime”.
|eval diff=round(((now() - lasttime)/86400),2)
Converts the “lasttime” (the last time password was set in days) by creating a new field called “diff”.
| eval timediff = n - diff
Assuming your organizational policy for password change is “90 days” where n = number of days. This will calculate the “the time left to change password after n days”.
| stats values(whenCreated) as "Created Date" latest(lastLogonTimestamp) as "LastLogonTime" values(OU) as OU values(sAMAccountName) as sAMAccountName values(pwdLastSet) as PWDLastSet values(timediff) as "Time left to change password" by displayName
This search will tabulate resulting fields by the User’s displayname.
Result
Any user/service account that is non-compliant or has not changed the password within the Organization’s policy will have a negative sign (-) before the accrued number of days, signifying the number of days their password has been not being changed. The user accounts that are compliant will have a positive sign (+) before the number of days, signifying the number of days left to change their password.
Example: Dashboard Panel of Active User Accounts
This can be turned into the following knowledge objects.
Alert Splunk will send an email alert to the admin with list of user/service accounts with negative sign (-) to take action and user/service accounts with the number days left to change password.
Dashboard Panel This can form part of a Splunk dashboard that will be constantly monitored by an Admin.
Report Splunk can be set to send a report to the admin on a monthly or quarterly basis with the list of active user accounts and how much time left to change their password.
That will do it! Now you’ll equip your team with brute force security monitoring for passwords using Splunk. If you would like more details, please contact us using the form below. Happy Splunking!
The following blog will show how to set up pass4SymmKey authentication between a Splunk Deployment Server and the Universal forwarders in Splunk version 8.x.x. This method will make it more difficult for someone to set up a rogue Universal forwarder that could potentially connect to your Deployment Server.
Please note: This does not fully protect against the Splunk Deployment Server vulnerability listed in the web link below. As such, you should make sure you have updated your current Deployment Server to versions 8.1.0.1, 8.2.6.1, or 9.0.x
Setup pass4SymmKey Authentication between the Deployment Server and Universal forwarders
Step 1: Create a new app for the Deployment Server and Universal Forwarders a. pass4Symmkey_auth_app/local/server.conf b. In the server.conf file, add the following stanza. [deployment] pass4SymmKey = password
Step 2: Add the app to these locations on the Deployment Server a. $SPLUNK_HOME/etc/apps/ b. $SPLUNK_HOME/etc/deployment-apps
Step 3: Set the new app to restart the Universal forwarder after it pushes it to the clients a. Open the Splunk GUI and go to setting>forwarder management b. Select the App tab on the forwarder management main screen c. Find the newly created app from the list, and under the action column, select “Edit.” d. Check the box next to Restart Splunkd. e. Click “Save.”
Step 4: Create a new serverclass on the Deployment Server and push the app to the universal forwarders
Step 5: Create a restmap.conf file on the Deployment Server. (This turns on the required Authentication) a. Create the restmap.conf file in $SPLUNK_HOME/etc/system/local/restmap.conf b. Add the following stanza to the restmap.conf [broker:broker] requireAuthentication = true c. Restart the Deployment Server
Step 6: How to temporarily turn off authentication between the Deployment Server and Universal Forwarders; this will be required to add new universal forwarders. a. Set the restmap.conf requireAuthentication attribute to false or comment out the complete stanza. b. Restart the Deployment Server.
After completing these steps, your pass4SymmKey will be authenticated between your Splunk instance and any of your Universal Forwarders. If you have any follow up questions, please reach out below.
Welcome back to our series discussing some unique ways to visualize data across specific points in time with Splunk SPL! Previously, we created a dashboard chart to isolate and compare a specific day from a prior week, and then we isolated and compared it to the same day from the current week to see the percentage change between the two values across the day in a new area chart visualization. In this installment, we will pick a specific hour from one day and chart out those specific values across a prior set of weeks in a straightforward visualization.
Referring back to our first installment (Figure 1 below), we showed a full day across four weeks, overlayed in one line chart visualization. Then, in our second installment, we isolated one of these specific days to compare to the current week (Figure 2).
Part One: Day Over Week (Figure 1)Part Two: Isolate and Compare (Figure 2)
Now, for example, let’s say we noticed that spike at 10 am where the Compared Week is much higher than the Current Week and we want to see if that’s just an anomaly or a consistent trend at that same hour. One thing that would make it easy to visualize this would be a line chart that charts that specific hour for that day of the week across the past 4 weeks.
Let’s build that very search! Once we’re done, our visualization will look as shown below. In the image below, two dropdown inputs are populated with the specified day of the week and hour to isolate for the past 4 weeks, including the current week. This is just a line chart but it is isolated to just that specific day/hour across the past 4 weeks, which makes it much easier to visualize without any other data points to distract the view.
Visualizing a specific day/hour (Figure 3)
The complete search consists of various parts and transformation so let’s break it up into the few major steps that comprise it and analyze it to ensure we understand how this cake is baked. The final search is below:
Index=test…
| eval Date = strftime(_time,"%m/%d %I %p"), Day = strftime(_time,"%A"), Hour=strftime(_time,"%H"), TotalSales = round(TotalSales,2)
| fields _time, "TotalSales", Hour, Day, Date
| where Day="Thursday" AND Hour = 10
| sort 0 - _time
| streamstats dc(Date) as WeekNum current=true
| eval WeekNum = WeekNum -1, WeeksBefore = WeekNum . CASE(WeekNum = 0, " Current Week",WeekNum = 1, " Wk Prior",1=1," Wks Prior") . " (" . Date . ")"
| chart values(TotalSales) as "Week Value" by WeeksBefore
| sort 0 - WeeksBefore
| eval WeeksBefore = IF(match(WeeksBefore,"^0s"),substr(WeeksBefore,3),WeeksBefore)
Now let’s break this search down and explain what is going on here. The first four lines are setting up our data. We create fields to store the specific Date, Day and Hour for our values as well as filter out only the information for the specific days and hour we are looking to compare. In this case, Thursday is the selected day and 10 am is the selected hour but this could easily be replaced with a token here to allow dynamic selection of any day of the week (it actually is in our specific dashboard).
The next three lines of the search allow us to format and prepare the data so that the chart will be easy to understand with descriptive labels on the x-axis. The sort command just sorts our data by descending time order so that the subsequent streamstats command can appropriately categorize the date in terms of how many weeks before the event is in relation to the current week. The eval command after this takes the WeekNum value, adjusts it so it reflects the appropriate relation to current week and then creates a WeeksBefore field that contains text values to better articulate how many weeks before the value presented is from, as well as identifying the current week and labeling it appropriately. We’ll discuss what needs to be further finalized on this field for optimal readability a bit later but we can continue for now.
| chart values(TotalSales) as "Week Value" by WeeksBefore
| sort 0 - WeeksBefore
| eval WeeksBefore = IF(match(WeeksBefore,"^0s"),substr(WeeksBefore,3),WeeksBefore)
Now that we’ve isolated and appropriately categorized and formatted our data, all that is needed is a chart command to group the values by the WeeksBefore field. Then, sort the results in descending order by WeeksBefore to ensure that the values are displayed in chronological order once placed in the visualization/line chart. If you were to run the search at this point, you’d notice that the WeeksBefore field has values like this:
WeeksBefore field after running search (Figure 4)
In order to get the field to display the right value for the current week (without the 0), the eval command at the end cleans up the data so that the “Current Week” value for WeeksBefore is labeled appropriately using the match function with some simple regex. Once applied, the values look as follows:
WeeksBefore field after eval command removes the “0” on the Current Week label (Figure 5)
The visualization is now ready! It will display much like a timechart but over a certain time period for only that day/hour data point across multiple weeks and with helpful, dynamic, and descriptive labeling on your x-axis!
Stay tuned for our fourth and final installment in this series on unique Splunk Dashboard panels, when we will discuss how to pick one single time value from a day (i.e. a specific hour value) and plot that data point back across various weeks, comparing each prior data point to the current week (same hour/day) and showing percentage deltas along the way. A sample image is shown below.
Part Four Sneak Peek: Hour Over Week Percentage Change Timechart (Figure 6)
Until next time, please contact us for more information on this specific Splunk dashboard tutorial, or any Splunk questions you may have!
Today I will be going over some essential Linux commands to set up Splunk on a Linux server and troubleshoot.
Once you are in a Linux box we first need to make sure there is an /opt/splunk directory in this server. So, we are going to use the cd (change directory) command to see if it is there.
cd /opt/splunk
If you do not go into a Splunk box, then we now move to the mkdir (make directory) command to create it. We also are going to add a sudo before this command to make root perform the action.
sudo mkdir /opt/splunk
Now that there is a directory to place Splunk, let’s bring it in! We are going to install wget onto the server before moving to making a Splunk user.
sudo yum install wget
Next, we want to have a user to run Splunk so let’s use the adduser command to create a Splunk user and log into it.
sudo adduser splunk
sudo su – splunk
Let’s use that wget command to bring in the Splunk tgz. This command can be found on the Splunk downloads page for the version you would like. For this example, I will list the wget for 9.0.2: wget -O splunk-9.0.2-17e00c557dc1-Linux-x86_64.tgz
After downloading Splunk to your server there we need to untar the folder in the /opt/splunk/folder. Let’s run this command: sudo tar -xvzf wget -O splunk-9.0.2-17e00c557dc1-Linux-x86_64.tgz
Now we need to accept Splunk license agreements: cd /opt/splunk/bin
Then run this command to enable boot start and accept the license: sudo enable boot-start -user splunk –accept-license
Here you will be asked for the username and password you want to use for Splunk, so fill those in.
Now you should have a Web UI for Splunk!
Troubleshooting
Since this post is about using Linux commands to start and troubleshoot Splunk, let’s move on to some common items you may encounter.
Upgrading vs. Re-Installing: while working on this post I decided to upgrade my local instance and ran into a problem. I used a different install method this time, so it wasn’t a true “upgrade” but instead more like a re-install.
Holding ports: I ran into the problem where my old version of Splunk was still holding on to port 8000. I used the ps -ef | grep splunk command to find the splunk tasks still running. I used the kill command to stop those tasks. Here is my command for example: kill -9 20189. After stopping I was able to start my new version of Splunk with no problems.
Finding available disks: A command recommended to me by a friend that I find helpful finds the available disks and their usage on the server. This command does just that: df -h. Nothing beats a friendly recommendation sometimes!
Decrypting your pass4SymmKey: Another instance you might need a special command for is decrypting your pass4SymmKey. When you have forgotten your pass4SymmKey, copy the value down in the .conf file and go to the bin directory. Run this command with your value to show what you decrypted password is: ./splunk show-decrypted -value
Data doesn’t show up: A command I used often in my training was the btool command. Anytime I had data not show up I would run the ./splunk btool outputs list command on my forwarders and indexers to make sure they were forwarding to the correct IPs. You can also add –debug to the end of the command to show the destination path to each line.
Find your inputs: One more command that may help you is the ./splunk list inputstatus command. This command will help you find your inputs and the STUS where they were ingested. You can see the file size, the position, directory, how much of the file has been processed and its completion status.
That’s a good round of the basic commands you will need to set up Splunk and troubleshoot with a Linux box. I hope this helps you get started Splunking! You can contact me below for follow up:
Oracle Cloud Migrations Service is a service that enables organizations to move their existing workloads easily and efficiently to the Oracle Cloud. The service offers a range of tools and resources to help organizations plan and execute their migrations, as well as ongoing support to help ensure the success of the migration.
Databases: The service provides tools and resources for migrating different types of databases, such as Oracle, SQL Server, MySQL, and PostgreSQL to the Oracle Cloud.
Applications: The service can be used to migrate a wide range of applications, including custom-built applications, packaged software, and open-source software.
Infrastructure: The service provides tools and resources for migrating virtual machines (VMs) and other types of infrastructure, such as storage and networking, to the Oracle Cloud.
Big Data and Analytics: The service can be used to migrate big data and analytics workloads, such as Hadoop and Spark clusters, to the Oracle Cloud.
Containers: The service can be used to migrate container-based workloads, such as those built using Docker and Kubernetes, to the Oracle Cloud.
Machine Learning: The service can be used to migrate machine learning workloads, such as those built using TensorFlow and PyTorch, to the Oracle Cloud.
The Automated Cloud Discovery (ACD) tool is a key feature of the Oracle Cloud Migrations Service. It is used to automatically discover and assess an organization’s existing workloads, providing detailed information on the resources and dependencies that need to be migrated.
The ACD tool uses a combination of agent-based and agentless discovery methods to collect data on the organization’s existing workloads. This data includes information on the operating system, software, and configurations of the workloads, as well as information on the resources and dependencies that are required to support them.
Once the data is collected, the ACD tool analyzes it to provide detailed information on the workloads that need to be migrated. This includes information on the resources and dependencies that need to be migrated, as well as information on any potential issues or challenges that may need to be addressed during the migration process.
The ACD tool also provides a detailed migration plan, which can be used to guide the migration process. The migration plan includes information on the steps that need to be taken to migrate the workloads, as well as information on the resources and dependencies that need to be migrated.
Detailed reports are provided by the tool on the migration plan and the status of the migration, which can be used to track the progress of the migration and ensure that it is completed successfully.
Cloud Adoption Framework (CAF)
The Cloud Adoption Framework (CAF) is a set of best practices, templates and guidelines that can be used to plan and execute the migration of workloads to the Oracle Cloud using the Oracle Cloud Migrations Service. The CAF provides a structured approach for migrating workloads to the cloud, covering all aspects of the migration process, from assessment to deployment and ongoing management.
The CAF provides guidance on how to plan and execute the migration, including how to identify the workloads that need to be migrated, how to assess the resources and dependencies required to support the workloads, and how to plan and execute the migration. It also provides guidance on how to deploy the workloads on the Oracle Cloud and how to manage and optimize the workloads after the migration is complete.
CAF includes a set of templates and guidelines that can be used to plan and execute the migration, including templates for creating a migration plan, templates for identifying and assessing workloads, and templates for deploying and managing workloads on the Oracle Cloud. It also provides a set of best practices for migrating workloads to the Oracle Cloud, including best practices for identifying and assessing workloads, best practices for planning and executing the migration, and best practices for deploying and managing workloads on the Oracle Cloud.
Guidance from the CAF also includes how to address common challenges and issues that may arise during the migration process, such as how to handle data privacy and security, how to handle compliance and regulatory requirements, and how to handle performance and scalability issues.
Migration Process Overview
The workflow of the migration process using the Oracle Cloud Migrations Service includes several key steps:
Assessment: The first step in the migration process is to assess the existing workloads that need to be migrated. The Automated Cloud Discovery (ACD) tool is used to automatically discover and assess the organization’s existing workloads, providing detailed information on the resources and dependencies that need to be migrated. This information is used to create a detailed migration plan, which can be used to guide the migration process.
Planning: Once the assessment is complete, the next step is to plan the migration. The Cloud Adoption Framework (CAF) is used to plan and execute the migration. It covers all aspects of the migration process, from assessment to deployment and ongoing management. The CAF provides best practices, templates, and guidelines to help organizations plan and execute their migrations.
Migration: After the planning is completed, the next step is to execute the migration. The Oracle Cloud Migrations Service provides a range of tools and resources for migrating different types of workloads. These include tools for migrating databases, applications, and infrastructure. For example, the service includes the Oracle Cloud Infrastructure Data Transfer Appliance for migrating large amounts of data to the cloud and the Oracle Cloud Infrastructure VM Import/Export for migrating virtual machines to the cloud.
Deployment: Once the migration is complete, the next step is to deploy the workloads on the Oracle Cloud. The Oracle Cloud Migrations Service provides resources and tools to help organizations deploy their workloads on the Oracle Cloud. This includes setting up the network, storage, and other resources, as well as configuring the workloads to use the same operating system and software as they did before the migration.
Ongoing Management: After the workloads are deployed on the Oracle Cloud, ongoing management is required to ensure the success of the migration. The Oracle Cloud Migrations Service provides ongoing support to help organizations manage and optimize their workloads on the Oracle Cloud. This includes monitoring and troubleshooting, as well as providing guidance and best practices for ongoing management.
It’s important to note that the migration process is not a one-time event, it requires a continuous effort to ensure that the workloads continue to run smoothly on the Oracle Cloud. The Oracle Cloud Migrations Service provides the necessary resources, tools, and support to make this possible.
Pricing and Licensing Information
The pricing for the Oracle Cloud Migrations Service is based on the number of assets and data that are being migrated. It’s important to note that the cost of migration also includes ongoing costs such as compute and storage costs for running the workloads on the Oracle Cloud.
When it comes to licensing considerations, it’s important to ensure that the necessary licenses for the software running on the workloads that are being migrated are in place. Organizations must also understand the licensing terms and conditions of the Oracle Cloud. For Oracle software running on the workloads, the appropriate licenses must be purchased for use on the Oracle Cloud. Oracle provides different licensing options for running Oracle software on the cloud, such as Bring Your Own License (BYOL) or License Included (LI).
Conclusion
In conclusion, Oracle Cloud Migrations Service is a powerful tool that allows organizations to move their existing workloads easily and efficiently to the Oracle Cloud. The service includes a range of tools and resources, such as Automated Cloud Discovery (ACD) and Cloud Adoption Framework (CAF), to help plan and execute migrations. The pricing is based on the number of assets and data that are being migrated and the ongoing costs such as compute and storage costs for running the workloads on the Oracle Cloud. It’s important to consider licensing implications and ensure the necessary licenses for the software running on the workloads that are being migrated are in place.
Contact Hardik or another member of our Oracle team using the below form. We look forward to speaking with you!
This blog will take you through the necessary steps to get CrowdStrike data into Splunk via API. Before starting, ensure the CrowdStrike App and Technical Add-On (TA) are installed in your Splunk environment. For Splunk Cloud, simply install both the App and TA using your Search Head. For on-prem instances, the CrowdStrike App should be installed on Search Heads and the TA should be installed on Indexers or Heavy Forwarders depending on where your data will be collected and parsed. Don’t forget to also create an index for your new CrowdStrike data.
Phase One: Generate an API key in CrowdStrike
Navigate to SUPPORT AND RESOURCES within the Falcon console to manage API clients and keys used by your organization. Select API CLIENTS AND KEYS to view, edit, or create an API:
Your account’s cloud base URL for API interactions is located on the top of this page. Select ADD NEW API CLIENT to generate a new API:
Provide an API client name, a description for this API, and select your API scopes. At a minimum, you’ll want to select EVENT STREAMS as seen below:
Record your API secret somewhere safe. Once this window is closed, the secret is no longer available. This information will be used when configuring the TA within Splunk:
Phase Two: Configure the CrowdStrike TA in Splunk
In the CrowdStrike Falcon Event Streams TA, select CONFIGURATION toward the top of the page. Within the Account tab, click ADD and enter the details below:
• Account Name: This can be whatever you want as it is only used in context of this TA. • Username: Client ID from the API client generated above. • Password: Secret from the API client generated above.
Next, go to INPUTS on the top of the page and select CREATE NEW INPUT. Enter the required information as seen below. Note that the API Credential dropdown will now have your CrowdStrike account created in the last step:
Once saved, you will see your new input has been created. It may take several minutes for events to start coming into your CrowdStrike index (i.e., index=crowdstrike). The CrowdStrike Falcon app will also start populating as data comes in. The home view defaults to the last 24 hours, so you may need to expand your time range to make the dashboard populate.
If you have additional questions regarding configuration of the CrowdStrike app or onboarding of data, reach out to our team here at TekStream.
Implementing Splunk Web SSL and TLS Hostname Certificate Validation
This post focuses on how to secure Splunk Enterprise 9.0 deployments by implementing SSL for Splunk Web and configuring TLS certificate hostname validation. It focuses securing a simple deployment consisting of a single all-in-one Splunk instance (i.e.., responsible for indexing, searching, app and configuration deployment) and a solitary universal forwarder. Figure 1 below shows a diagram of the deployment used in this blog post.
Figure 1. Splunk Enterprise 9.0 deployment consisting of a single all-in-one instance (aio1) and a single universal forwarder (uf1)
The all-in-one Splunk instance (aio1) runs Splunk Enterprise version 9.0.2, and the universal forwarder runs Splunk Universal Forwarder 9.0.2. The operating system running on aio1 and uf1 is CentOS Stream release 8.
NOTE:
• To follow along with this blog post, you will need to obtain a copy of the public certificate of your organization’s Certificate Authority (CA) and the ability to either generate a public certificate or submit a certificate signing request (CSR) for your Splunk Enterprise servers and universal forwarders.
• It is assumed that you have backend access to your deployment (e.g., able to SSH into your hosts) and can execute Splunk management commands.
• The SPLUNK_HOME environment variable refers to the Splunk installation directory and may be different in your set up. For this blog series, SPLUNK_HOME will be set to:
/opt/splunk (aio1)
/opt/splunkforwarder (uf1)
• It is important to use the OpenSSL version shipped with Splunk Enterprise to avoid compatibility issues that may present themselves when using a non-Splunk OpenSSL version to generate private keys and public certificate requests. The version OpenSSL provided by Splunk can be accessed in the CLI using $SPLUNK_HOME/bin/splunk cmd openssl.
Preparing the Deployment and Gathering TLS Certificates
This section will focus on the configuring the Splunk Enterprise all-in-one instance aio1. The steps described in this section can be replicated on any Splunk instance and universal forwarder.
In this set up, we will need to create the folders and apps to hold our configurations. Create a directory called org_certs/ in the $SPLUNK_HOME/etc/auth directory to hold the TLS certificates used to secure connections.
Next, create the following folders within the newly created $SPLUNK_HOME/etc/auth/org_certs/ folder:
• root/ – will hold the public certificate of the Certificate Authority responsible for issuing certificates • server/ – will hold the private key generated by and public certificate issued to the Splunk instance
Figure 2. Creating folders to hold CA public certificate and certificate issued to the server
Next, place a copy of the CA’s public certificate in $SPLUNK_HOME/etc/auth/org_certs/root. The name of the certificate file does not have to match the name in Figure 3 and can be anything you chose that describes its purpose. Ensure that the following with the CA public certificate is true:
• Account that Splunk is running as has ownership of the file • CA public certificate is in PEM (.pem) format.
Figure 3. CA public certificate
Generating Private Keys
Navigate to $SPLUNK_HOME/etc/auth/org_certs/server and generate a RSA private key for the Splunk instance. When prompted, supply a password.
Figure 4. Generating RSA private key for Splunk instance
Remove the password from the generated private key file using the command in Figure 5. The reason for removing password protection from the private key file is that Splunk performance may degrade due to handshake operations timing out when having to decrypt the private key. The impact of this is typically felt with Splunk Web timing out and producing 500 Internal Server errors.
Figure 5. Remove password from generated private key file
Generating and Submitting a Certificate Signing Request (CSR)
For TLS certificate hostname validation to work properly, we will need to make sure that the common name (CN) of the public certificate obtained from the CA matches the actual hostname of the server and that any possible subject alternative names (SAN) are identified, e.g., if the hostname is aio1, a possible SAN would be aio1.example.com. To do this, create a custom SSL configuration file in $SPLUNK_HOME/etc/auth/server called cert.cnf and add the following content to it:
[req]
distinguished_name = req_distinguished_name
req_extensions = req_ext
prompt = no
[req_distinguished_name]
# Replace the below with your organization's information
C = US
ST = Georgia
L = Atlanta
O = Tekstream
OU = Splunk
# Replace with the server's hostname
CN = aio1
[req_ext]
subjectAltName = @alt_names
[alt_names]
# Replace with IP.2 with your server’s address.
# IP.1 is set to the loopback address in order to run Splunk CLI commands on the server
IP.1 = 127.0.0.1
# You can add the server IP address, e.g. IP.2 = 10.1.2.3
# Add any alternative names that the server is known by, e.g. DNS.1 = aio1.example.com
Next, save the configuration file and run the following command to generate the CSR to submit to the CA:
(Optional) Check the content of the CSR you just created by running the following command to see the CN and SANs configured in the request:
Figure 6. Output of Certificate Signing Request (CSR) for all-in-one Splunk instance
Finally, submit the CSR to your CA and wait for the CA to issue a public certificate for the instance. When you receive the server’s public certificate, store it in $SPLUNK_HOME/etc/auth/org_certs/server and ensure that the account Splunk is running as has ownership and the ability to read the certificate file.
(Optional) Verify that the Subject Alternative Names show up in the server’s public certificate by running the following command, replacing the name of the certificate file with your own:
[splunk@aio1 server]$ splunk cmd openssl x509 -in server.pem -noout -text | grep -A 1 “Subject Alternative Name”
You should see an output similar to below:
X509v3 Subject Alternative Name:
IP Address:127.0.0.1
Preparing the Public Certificate for the Splunk Instance
Once you receive the CA-issued public certificate, place it in the $SPLUNK_HOME/etc/auth/org_certs/server folder and ensure that Splunk can read the certificate file and that it is in PEM format. If the issued certificate is not in PEM format, you can perform one of the following commands based on the file extension to convert it to PEM.
With the server’s public certificate in PEM format, our next step will be to combine the server public certificate, the CA public certificate, and the server private key into a single PEM certificate file. Make sure you are within the $SPLUNK_HOME/etc/auth/org_certs/server directory and run the following to combine the certificate files:
The contents of the combined certificate file should look similar to what is below:
----- BEGIN CERTIFICATE -----
… (server public certificate) …
----- END CERTIFICATE -----
----- BEGIN RSA PRIVATE KEY -----
… (server private key) …
----- END RSA PRIVATE KEY -----
----- BEGIN CERTIFICATE -----
… (CA public certificate) …
----- END CERTIFICATE -----
(Optional) Verify the information within the combined public certificate PEM file matches the original server public certificate PEM file by running the following:
# Create a temporary file containing the certificate info of the original certificate
[splunk@aio1 server]$ $SPLUNK_HOME/bin/splunk openssl x509 -in server.pem -text -noout > pemfile1
# Create a second temporary file containing the certificate info of the combined certificate
[splunk@aio1 server]$ $SPLUNK_HOME/bin/splunk openssl x509 -in server-combined.pem -text -noout > pemfile2
# Compare the two files to see if the are different:
# - If no output is generated, the certificates match and we can proceed
# - If there is output, you will need to recreate the combined certificate file
[splunk@aio1 server]$ diff pemfile1 pemfile2
[splunk@aio1 server]$
Before continuing, repeat the steps above for your universal forwarders to obtain the required certificate files. Make sure to provide the correct hostname for the universal forwarder when generating the CSR.
Securing Splunk with TLS Certificates
Before proceeding with the set up of SSL for Splunk Web and TLS certificate hostname validation, we will need to create three configuration apps, org_enable_splunkweb_ssl, org_enable_tls_validation, and org_indexer_base, within $SPLUNK_HOME/etc/apps on the Splunk server (aio1).
Create the configuration app folders and ensure they have the following directory structure:
Figure 7.Configuration app directory structures
For each app’s local/app.conf file, add the following content:
[install]
state = enabled
[package]
check_for_updates = false
[ui]
is_visible = false
is_manageable = false
Next, for each app’s metadata/local.meta file, add the following content:
[]
access = read : [ * ], write : [ admin ]
export = system
Configure SSL for Splunk Web, TLS Certificate Hostname Validation, and Receiving on the All-in-One Instance
Navigate to the local folder of the configuration app we created earlier to enable SSL for Splunk Web, $SPLUNK_HOME/etc/apps/org_enable_splunkweb_ssl/local. Add the following content to the web.conf file:
[settings]
# Enable SSL for Splunk Web
enableSplunkWebSSL = true
# Reference the server’s private key created earlier.
privKeyPath = $SPLUNK_HOME/etc/auth/org_certs/server/server.key
# Reference the server’s public key obtained from your CA
serverCert = $SPLUNK_HOME/etc/auth/org_certs/server/server-combined.pem
Next, navigate to the local folder of configuration app to enable TLS hostname validation, $SPLUNK_HOME/etc/apps/org_enable_tls_validation/local. Add the following content to the server.conf file:
[sslConfig]
# Reference the file that contains all root certificate authority certificates combined
sslRootCAPath = $SPLUNK_HOME/etc/auth/org_certs/root/ca.pem
# Turns on TLS certificate requirements
sslVerifyServerCert = true
# Turns on TLS certificate host name validation
sslVerifyServerName = true
serverCert = $SPLUNK_HOME/etc/auth/org_certs/server/server-combined.pem
# Turns on TLS certificate hostname validation for CLI. This is a required setting on
# any instance you will use the CLI to connect to a Splunk platform instance. E.g.,
# running ‘splunk reload deploy-server’ to deploy app bundles from a Deployment Server
# to Deployment Clients.
cliVerifyServerName = true
Next, navigate to the local folder of the configuration app to enable receiving on the server, $SPLUNK_HOME/etc/apps/org_indexer_base/local. Add the following content to the inputs.conf file:
# Enable listening on port 9996 for receiving events using SSL
[splunktcp-ssl://9996]
# Configure SSL settings
[SSL]
# Full path to the combined server certificate file.
serverCert = $SPLUNK_HOME/etc/auth/org_certs/server/server-combined.pem
# Force client to present an SSL certificate to authenticate
requireClientCert = true
# TLS/SSL version required for handshakes to be successful.
# It is best practice to use the latest version of TLS, which is version 1.2 at the time of this writing.
sslVersions = tls1.2
# Comma-separated list of Common Name (CN)
sslCommonNameToCheck = uf1
# Optional, if Subject Alternative Names (SAN) are configured in client certificates
# sslAltNameToCheck = uf1.example.com
Restart Splunk on the server and verify whether you can log into Splunk Web. If you are unable to log in, check internal splunkd logs and revisit the steps outlined in this blog.
Configure Secure Forwarding on Universal Forwarder
Before continuing, make sure that the universal forwarder (uf1) has a private key, a public certificate, and the CA public certificate in $SPLUNK_HOME/etc/auth/org_certs, in the respective server/ and root/ folders.
On the universal forwarder, create a configuration app in the $SPLUNK_HOME/etc/apps folder called org_forwarder_outputs. The configuration app should have a similar directory structure as the apps we created earlier, with the only difference being configuration files within:
Figure 8. Configuration app directory structure
Navigate to $SPLUNK_HOME/etc/apps/org_forwarder_outputs/local and add the following content to the server.conf file:
Next, add the following content to the outputs.conf file:
[tcpout]
defaultGroup = primary_indexers
[tcpout:primary_indexers]
disabled = false
# Replace <IP-Address> with IP address of the all-in-one instance
server = <IP-Address>:9996
# SSL SETTINGS
clientCert = $SPLUNK_HOME/etc/auth/org_certs/server/server-combined.pem
sslVerifyServerCert = true
useClientSSLCompression = true
sslCommonNameToCheck = aio1
Finally, restart the Splunk on the universal forwarder. After Splunk restarts on the universal forwarder, you can verify that it is connecting to the all-in-one instance by checking the internal Splunk logs on the universal forwarder. You should see something like the following that will confirm communication between the two servers:
12-08-2022 01:19:43.439 +0000 INFO AutoLoadBalancedConnectionStrategy [1032 TcpOutEloop] - Connected to idx=x.x.x.x:9996:2, pset=0, reuse=0. autoBatch=1
Another way to verify that the universal forwarder is forwarding events search for its internal logs from the all-in-one instance. Run the following SPL query over the last 15 minutes to verify this:
index=_internal host=”uf1”
Conclusion
There you have it. You have successfully configured TLS hostname validation between an all-in-one standalone Splunk server and universal forwarder. Let’s revisit the steps taken to achieve this goal:
• Created a directory, $SPLUNK_HOME/etc/auth/org_certs/ to hold our certificates for the CA and our Splunk instances. • Prepared our certificates for configuring TLS hostname validation, making sure that the Common Name (CN) identified in each public certificate for the server matched the server’s hostname and included the loopback address as a Subject Alternative Name (SAN). • Created three apps on the all-in-one instance and restarted the server: • org_enable_splunkweb_ssl – enables SSL for Splunk Web • org_enable_tls_validation – configure TLS hostname validation • org_indexer_base – configures receiving on the all-in-one instance using our certificates • Created a single app on the universal forwarder and restarted it: • org_forwarder_outputs – tells the universal forwarder to use our certificates when sending events to the all-in-one instance • Verified that our configuration was successful by checking the internal logs of each server and running a query from the all-in-one instance to confirm that it was receiving events from the universal forwarder.
While Splunk can receive syslog events directly, having a centralized logging location is considered best practice. There are inherent issues that come with sending data to syslog over UDP 514. First, UDP is a stateless protocol that does not guarantee delivery which can result in events getting dropped. When you restart Splunk the listener is not available, thus you will lose events while Splunk is down. Additionally, it is difficult to differentiate between the various datasets coming in. If all syslog data sources are coming into Splunk as “udp:514” or “syslog”, how can you easily distinguish the events you are analyzing? Rsyslog is a great way to integrate log aggregation while also addressing these concerns.
Modular Approach
Rsyslog allows for a modular approach by treating messages according to defined rules. For example, data sources can be sent to different ports allowing them to be separated into their own respective directories. This can then be utilized in the Universal Forwarder’s monitor input to collect the logs and send them to Splunk. With this method, your data flow will resemble the following and Splunk will now be able to segregate source types:
Sample Rsyslog workflow
When rsyslog is installed, the main configuration file is located under /etc/rsyslog.conf. In there you will find that $ModLoad imtcp is commented out. This needs to be uncommented to allow for TCP syslog reception (also uncomment $ModLoad imudp if you’ll be using UDP). There are three key components within rsyslog.conf to specify data collection ports and store messages in separate directories:
Inputs objects designate input sources to collect the messages. For this use case, you’ll want to be familiar with the imptcp input module mentioned above. This module provides the ability to receive syslog messages via TCP and allows for specifying which ports to send data to. Ideally, each technology will be collected on its own unique port.
Filter conditions allow for property-based or expression-based filtering. This will check messages against specific conditions using a compare operation. All remote traffic coming in will pass through technology-specific filters to match against the corresponding data sources.
Rulesets specify how rsyslog will process a message when the filter condition is true. Rules provide the ability to carry out specific actions such as write a message to disk or send to a remote location. In this case, the output should be written to a directory to be used in the root of the UF monitoring stanza.
Once messages are written to a local directory on the syslog server, the Universal Forwarder can now transmit this data to Splunk. The UF’s inputs configuration file will allow the events to be collected, and will also allow for setting the indexes, source types, and host segments of the data. Assigning the source type will help distinguish data sources as well as determine how event data will be formatted during the indexing process; be sure to use what is required by the respective TA. The inputs.conf stanzas should resemble something like this:
[monitor:///<log root>/<vendor name>/*/*.log]
index=foo
sourcetype=bar
host_segment=<the segment in the path that is your hostname>
There you have it! We hope this has answered your questions about Rsyslog. Please contact us if you would like further information.
Welcome back to our series discussing some unique ways to visualize data across specific points in time with Splunk SPL! In Part One, we created a dashboard chart to show day over week values over multiple weeks. In this segment, we will expand on our previous chart and isolate and compare one day from a specific week to the same day from the current week and show the percentage change between the two values across the day in a new area chart visualization.
Using our sales example from our first installment (shown below), we showed a full day across 4 weeks, overlaid in one line chart visualization. Now, what if, after analyzing this at a high level, you wanted to display percentage changes between the latest Thursday (red line) and the Thursday 3 weeks back (blue line)?
Once we’re done, our visualization will look as shown below. In the image below, a dropdown input is populated with the options for the last 3 weeks and is passing a value of 1-3 to send as a token to the panel search in order to determine which week to compare with the day from the current week. The panel itself consists of an area chart visualization that will be formatted with the week values as chart overlays to highlight the percentage change.
Since the search is a little extensive and consists of various parts, let’s view the complete search first and then break it down to its various steps to make it easier to digest. This is the search that was used for the panel above. The field being used for the chart is the TotalSales field.
index=test …
| eval Date = strftime(_time,"%m/%d"), Day = strftime(_time,"%A"), Hour=strftime(_time,"%H"), TotalSales = round(TotalSales,2)
| fields _time, "TotalSales", Hour, Day, Date
| where Day = "Thursday"
| sort 0 - _time
| streamstats dc(Date) as WeekNum current=true
| eval WeekNum = WeekNum - 1
| where WeekNum = 0 OR WeekNum = 3
| stats values(LatestWeek) as CurrentWeek, values(PriorWeek) as PriorWeek, values(eval(if(WeekNum=0,Date,NULL()))) AS Date by Hour
| eval CurrentWeek = IF(ISNULL(Date),"",CurrentWeek), Delta_Percentage = round(((CurrentWeek - PriorWeek)/PriorWeek) * 100,2)
| eval xAxis = "Hour (" . Date . ")"
| eval {xAxis} = Hour
| rename CurrentWeek AS "Current Week", PriorWeek as "Compared Week", Delta_Percentage AS "% Change"
| fields "Hour *" "% Change" "Current Week" "Compared Week"
Let’s break this search down and explain what is going on here. The first 4 lines are setting up our data. We create fields to store the specific Date, Day, and Hour for our values as well as filter out only the information for the specific day we are looking to compare. In this case, Thursday is the selected day but this could easily be replaced with a token here to allow dynamic selection of any day of the week.
| sort 0 - _time
| streamstats dc(Date) as WeekNum current=true
| eval WeekNum = WeekNum - 1
| where WeekNum = 0 OR WeekNum = 3
These next 4 lines of the search allow us to filter for the day of the current week and the day of the selected week. A quick way to do that here is to sort the result set in descending date order, then running a streamstats command to get the distinct number of weeks. Using this strategy, it makes it much easier to be able to configure a dropdown input to easily allow someone to simply select any previous week with just a number. In this case, the where command is filtering for WeekNum = 0 or WeekNum = 3, which will isolate only the values for the Thursday of the current week or the Thursday 3 weeks back. This “3” value is where you could instead use a token from a dropdown to allow for dynamic selection of different weeks back. At this point, we have now isolated our result set to solely the two days we are looking to compare.
| stats values(LatestWeek) as CurrentWeek, values(PriorWeek) as PriorWeek, values(eval(if(WeekNum=0,Date,NULL()))) AS Date by Hour
| eval CurrentWeek = IF(ISNULL(Date),"",CurrentWeek), Delta_Percentage = round(((CurrentWeek - PriorWeek)/PriorWeek) * 100,2)
Now that we have isolated our data, we can use stats to perform our aggregation and group our values according to each hour of the day into their own separate fields. Since our result set is now only from the current week and the selected week in the past then, logically, the “latest” value will be from the current week and the “earliest” value will be from the previous, selected week. We group these by Hour of the day and each event will now have the value for each hour from both days. Crucially, this is what we need in order to be able to calculate the percentage delta between periods. Note that the Date field is pulled so we can have the latest date reflected in our x-axis for reference, as we’ll see later. The following eval command nulls out any CurrentWeek values when the Date field is also null to avoid any issues with the charting if Date values are null but those CurrentWeek values are not. Additionally, we calculate the Delta_Percentage between the two values.
At this point, if you ran the search up to our latest command, your results should return a table with the Hour of the day, a CurrentWeek and PreviousWeek value for each of the days being compared, the date of the day of the current week, and the delta percentage between the day from the current week and the week being compared.
Now, all that remains is to get all the fields named in a more presentable fashion before we prepare our chart. That’s what the last 4 lines in our SPL achieve.
| eval xAxis = "Hour (" . Date . ")"
| eval {xAxis} = Hour
| rename CurrentWeek AS "Current Week", PriorWeek as "Compared Week", Delta_Percentage AS "% Change"
| fields "Hour *" "% Change" "Current Week" "Compared Week"
The first line above assigns a field (xAxis) with the string “Hour” followed by the date of the “current day” being compared in parentheses. In this example, that text will read “Hour (12/16)”. Then, in the second line, that text is used to create a field by that name (the field label in braces) and is assigned the value of the Hour. In the last two lines, we just rename our fields to be more presentable and then leave only the Hour (using the “Hour *” wildcard to allow for the date in the field label), % Change, Current Week and Compared Week.
Finally, we can configure our visualization! Format the panel/visualization as an area chart. Assign Current Week and Compared Week as Chart Overlay fields and set them to be on their own axis.
This will show the two values as lines on the chart and leave the % Change field as the shaded area between them to help visualize the percentage difference between the Thursday this week and the Thursday 3 weeks ago, across every hour of the day. Until next time!
Stay tuned for our next installment in this series on unique Splunk Dashboard panels, when we will discuss how to pick one single value from the day (i.e. a specific hour value) and plot it back across the same hour and day from previous weeks in one line! A sample image is shown below.
Contact Marvin below to ask questions or share ideas. Happy Splunking!
Amazon Web Services (AWS) is one of the clear leaders in cloud computing – offering an impressive array of services that allow organizations to shift their operations to the cloud. However, it may surprise you to learn that many organizations are receiving funding support from AWS to cover a portion, and sometimes all, of the expenses related to strategically migrating workloads to the AWS environment.
If you are considering a move to the cloud, we have three examples of TekStream clients that have leveraged AWS funds to support their cloud migrations.
Navigating AWS Funding Opportunities
Before we dive into these practical examples, let’s review the specific guardrails of the program. With AWS Funding, eligible projects can receive funds or credits from AWS to cover a portion of their project costs.
The exact amount received from the AWS Funding Program depends on several factors, including the projected annual recurring revenue for the first 12 months of a project’s completion and the total cost of the project’s consulting services.
Currently, AWS Funding can be accessed to support the following projects:
ISV Workload Migration Programs for Oracle, Splunk, Microsoft and others
Migration Acceleration Programs
Proof-of-Concept Initiatives
Georgia Department of Human Services Migrated Document Imaging to The Cloud
The Georgia Department of Human Services’ legacy Document Imaging System was showing signs of performance and security issues due to outdated software and aging hardware. After an in-depth discovery, TekStream developed a strategy for rehosting their documents on AWS’ Managed Service platform.
A limited budget for the project made securing AWS funding critical to the successful completion of this project. As an AWS Certified Migration Competency Partner, TekStream successfully secured $250,000 in AWS funding to help cover migration and implementation costs.
A subsidiary of a fast-growing quick service restaurant, Partnered with TekStream to Implement a Disaster Recovery Plan
A subsidiary is a critical vendor to a fast-growing restaurant’s supply chain. The subsidiary company partnered with TekStream to develop and implement a disaster recovery plan to mitigate the risk and impact of any natural disaster or cyberattack that could impact its ability to meet its supply commitment.
TekStream utilized AWS Elastic Disaster Recovery Services (DRS) block-level replication to create a cloud-based system to back-up critical data without impacting system performance. This system runs continuously in the background of the subsidiary company’s operations. The data is then replicated in a low-cost staging area, ensuring the subsidiary company can recover critical data and systems within 72 hours of a disaster or attack. To help support the development of this plan, TekStream worked with AWS Proof-of-Concept Funding to secure a commitment of 15% of the initiative’s cost.
SGK is a global leader in brand marketing and packaging production. Every day, SGK professionals would sort through thousands of packaging proofs across 20+ languages to support the production needs of their 1,500 worldwide clients. The legacy process relied on extensive manual labor that was time-intensive, prone to error, and costly.
TekStream AWS experts defined a new approach leveraging a suite of AWS tools to create an Intelligent Document Processing (IDP) solution that automated the extraction, translation, and cataloging of critical packaging information. The results included a 50% reduction in manual labor costs. Even better, TekStream was able to secure $25,000 in AWS funding to support the strategic implementation of this new IDP solution.
AWS Funding May Be Available for Your Next Project
We’ve found that one of the main reasons companies aren’t tapping into AWS funding is because they are unaware the funds are available, or they aren’t sure what projects will qualify to receive these funds. This is where a Certified AWS Migration Services Competency Partner like TekStream can help you navigate the options and gain maximum funding. If you are considering making a move to the cloud, we will show you how.
Contact us to learn more about how TekStream’s AWS competencies and to schedule an introductory call with a TekStream AWS professional.