Skip to main content

Threatlocker Deployment [MAC]

Overview

This script deploys threatlocker agent on Mac machines.

Sample Run

Play Button > Run Automation > Script
SampleRun1

Search and select Threatlocker Deployment [MAC] SampleRun1

Set the required arguments and click the Run button to run the script.
Run As: System
Preset Parameter: <Leave it Blank>
SampleRun1

Run Automation: Yes SampleRun1

Dependencies

Automation Setup/Import

Step 1

Navigate to Administration > Library > Automation
Step1

Step 2

Locate the Add button on the right-hand side of the screen, click on it and click the New Script button.
Step2

The scripting window will open.
ScriptingScreen

Step 3

Configure the Create Script section as follows:

Name: Threatlocker Deployment [MAC]
Description: This script deploys threatlocker agent on Mac machines
Categories: ProVal
Language: ShellScript
Operating System: Mac
Architecture: 64-bit
Run As: System
CreateSript

Step 4

Paste the following Shell script in the scripting section:

#!/bin/bash
GroupKey= Ninja-property-get cpvalThreatlockerMacGroupkey
#install
if [ ! -d /Applications/Threatlocker.app ]
then
curl --output-dir "/Applications" -O https://updates.threatlocker.com/repository/mac/1.0/Threatlocker.app.zip
echo "Downloading Threatlocker"
open /Applications/Threatlocker.app.zip
sleep 5
osascript -e 'quit app "Finder"'
rm -d /Applications/Threatlocker.app.zip
if [ ! -d /Applications/Threatlocker.app ]
then
echo "Not able to download the file"
exit 1
else
open /Applications/ThreatLocker.app --args -groupKey $GroupKey
echo "Installing Threatlocker"
sleep 15
echo "Verifying Group Key"
sleep 15
if [ ! -d /Library/Application\ Support/Threatlocker ]
then
echo "GroupKey is Invalid"
exit 1
else
echo "Threatlocker Installed"
exit 0
fi
fi
fi

CreateSript

Script Variables

Click the Add button next to Script Variables.
AddVariableButton

Saving the Automation

Click the Save button in the top-right corner of the screen to save your automation.
SaveButton

You will be prompted to enter your MFA code. Provide the code and press the Continue button to finalize the process.
MFA

Completed Automation

CompletedAutomation

Output

  • Activity Details