Introduction
Splunk is a great tool and very useful for establishing any security issues in your environment. It allows you to search, analyse and visualise data in real time. It is a good fit for security sensitive environments, and this includes your VDI infrastructure. In this blog I show you how to integrate the Splunk forwarder into your Omnissa Horizon Gold image (sometimes called the reference image), and in such a way that your cloned instances will also have their own unique data inputs into the Splunk repository. The process consists of the following steps.
1) Install the Splunk Forwarder application.
2) Generalize the Splunk Agent.
3) Create the Synchronisation scripts.
4) Run the Optimization Tool and create the snapshot.
5) Create the Horizon Desktop Pool with the a Post-Synchronization Script.
The implementation steps in this blog have been tested on Splunk version 9.4.1 and Omnissa Horizon version 8.12.x
Install the Splunk Forwarder application.
Follow your standard OS installation process for creating a gold image, which should include installing the Horizon Agent. When you are satisfied with your gold image, install the Splunk Universal Forwarding agent - again the wizard details will be specific to your environment.
When completed, wait for the Splunk application definitions to download - these will appear in <installation folder>\SplunkUniversalForwarder\etc\apps - by default this will be C:\Program Files\SplunkUniversalForwarder\etc\apps.
For the purposes of this blog we are assuming you have installed the Splunk forwarding agent to the default directory.
There should be more than 8 subfolders indicating the apps download has completed.
When the app download has completed, delete the following file: "C:\Program Files\SplunkUniversalForwarder\etc\system\local\deploymentclient.conf"
Generalize the Splunk Agent
In this step we remove the properties specific to the Gold reference installation that are in the Splunk forwarder configuration files - for instance the host name.
1) Open a command prompt as administrator and navigate to the bin directory - for instance C:\Program Files\SplunkUniversalForwarder\bin
Run the following command: splunk.exe clone-prep-clear-config
Create the Synchronization scripts
The synchronization scripts will execute a command to repopulate the configuration files with the cloned VM's details so that duplicated entries are not passed into the Splunk repository. Manually this is achieved by running splunk.exe restart, however we need to create scripts to achieve this during the Horizon pool creation process.
1) Create a local directory on the VDI gold image - for instance c:\Scripts.
2) create a batch file in this directory - in this example we will call it begin.bat. In this file enter in the following command:
PowerShell.exe -NoProfile -ExecutionPolicy Bypass -file c:\scripts\modify.ps1
3) In the Scripts directory create another script file called modify.ps1. Populate this file with the following PowerShell command:
start-process -NoNewWindow -Filepath "c:\program files\SplunkUniversalForwarder\bin\splunk.exe" -ArgumentList 'restart' -Wait
Note: you can test this by running begin.bat, but you will have to once more run the splunk.exe clone-prep-clear-config command to recreate the cloneprep file and generalize the Splunk installation.
Run the Optimization Tool and create the snapshot
As you would normally do, run the Optimization tool. My process includes running the following in order: Analyze, Optimize, Generalize and then Finalize.
Ensure the VM Gold build is switched off and then create a snapshot. The snapshot is used, of course, when running the Desktop Pool Creation wizard.
Create the Horizon Desktop Pool with the a Post-Synchronization Script
In your Horizon Admin portal create an Instant Clone pool (ClonePrep) using the new Gold image and snapshot. When getting to part 10 of the wizard, the Guest Customization window - enter in c:\Scripts\begin.bat in the Post-Synchronization Script name box.
After your pool is created, open a VDI instance with the Horizon client. Ensure that the cloneprep file does not exist in C:\Program Files\SplunkUniversalForwarder. Once confirmed you can also check entries exist in the Splunk repository for your cloned instance.
Conclusion
I hope you have enjoyed reading this little blog. The VDI Horizon platform is great for spinning up multiple VM clones. The Splunk Enterprise reporting solution is a great way of maintaining the integrity of your physical infrastructure, and using the above procedure - it is also a great way of observing any issues arising in your VDI Horizon platform.