I'm having some difficulty figuring out how to use Casper to install Cylance on every Mac in our organization. I've tried to create a shell script that will run it (not through Casper yet) but when I try on a test Mac it fails.
I have the Cylance.pkg and a cylance_install_token file in the same folder as the script. I copied the verbiage from a larger script that someone in our InfoSeec team had created a while ago to install this and other security software and it works there. Maybe I missed something?
If I can get this script to actually install it then I can go to the next step and figure out how to use Casper to push it out.
!/bin/sh
Cylance AV Client Install
echo "Installing Cylance AV Agent for Mac.
"; echo "Cylance AV Agent Start: " date"
" >> $LOG;
installer -pkg CylancePROTECT.pkg -target LocalSystem echo "Cylance AV Agent Stop: " date"
" >> $LOG; echo "Completed Cylance AV Agent for Mac Installation.
";
The output I get from Terminal is
BUR-JMENDEL4-i:~ jmendel$ /Users/jmendel/Desktop/Cylance Installer/Cylance.sh
Installing Cylance AV Agent for Mac.
/Users/jmendel/Desktop/Cylance Installer/Cylance.sh: line 5: $LOG: ambiguous redirect installer: Error the package path specified was invalid: 'CylancePROTECT.pkg'. /Users/jmendel/Desktop/Cylance Installer/Cylance.sh: line 7: $LOG: ambiguous redirect Completed Cylance AV Agent for Mac Installation.
• Open /private/tmp (On a computer with composer) • Create a folder called "Cylance" (Just a suggestion on name) • Drag the cylancePROTECT.pkg into this new folder. • Create a shell script as suggested (example below) and call it something like "install_cylance_with_token.sh"
• Copy the script into that new directory (/private/tmp/Cylance) • Open Composer • Drag the entire "Cylance" directory into Composer (the "Cylance" folder that you created in /private/tmp/) • Check permissions on everything in that composer list. • Package what you have in composer as a .pkg or a .dmg as you prefer. I see no benefit to having this packaged as a .dmg so... • Upload this new package to Casper Admin with whatever notes and settings you prefer. In all likelihood, this will need to be installed after boot, but I'm not positive.
• Create a policy as described above, using the "execute command" field in "Files and Processes" as described. In the case of my example, that would be:
This is what I've done this morning to check. It's working well for me.
P.S. I did consider simply trying to edit the source of the installer as there seems to be a script in the package where we could stick the token, but this process seems simpler.
I've made the changes and added sudo because without that it was saying it needed to be run as root. However with sudo it requires a password that I want the users to avoid seeing or having to enter.
Thanks. Now that we've determined that it works manually do you have suggestions for the best way to have it set to run unattended on every Mac in our company?
The easiest method would be to add the package as-is to your distribution point and deploy via a policy. If it works using the installer command, it should be ok with a policy. Did the cylance_install_token file have something to do with it?
Ok. In that case, create a new package that deploys the installer package and the cylance_install_token into a folder on the target Macs hard drive (I normally use /tmp for things like this) and up-load the new package to the distribution point.
In the policy, deploy the package, which will drop the actual package into the folder you've specified, along with the file, then add an extra command in the "files and processes" section of the policy, using the "execute command" text field to run installer -pkg /path/to/package -target /
@jonathanla is this installing your install token as well?!
Im currently attempting to deploy this remotely as well. from the cylance site i found this:
"The following shell scripts can be used to install & deploy Cylance on OSX using Casper: UNATTENDED_INSTALL.SH 1 #!/bin/bash 2 echo xxxxxxxxxxxxxx > /private/cylanceinstall/cyagent_install_token 3 sudo installer -pkg /private/cylanceinstall/CylanceAgent.pkg -target / For the unattended_install.sh, replace the xxxxxxxxxxxxxx with your install token. The unattended_install.sh is packaged with the installer pkg, and placed in /private to wait for execution from another shell script. TRIGGER.SH 1 #!/bin/bash 2 sudo cd /private/cylanceinstall 3 source /private/cylanceinstall/unattended_install.sh 4 sleep 60 5 sudo rm -rf /private/cylanceinstall The trigger.sh script is executed from the server side to run unattended_install.sh, sleep for 60 seconds (waiting for the installation to complete), then remove the deployment package."
Has anyone gotten this to deploy successfully? If so, what did you do exactly to achieve this? @wayfaircasper I'm encountering issues when I try to follow the directions posted on Cylance's site.
I have... then again it was just a POC with a single token that I was distributing to a small test fleet of about 20 computers. I'll admit that for the POC I simply grabbed the installer and token via Composer snapshot that I cleaned up and packaged. Nothing scripted and nothing complicated. Again, I used only my POC token but all units were properly recognized on their web console.
This was a month or so ago so I'm not what differences there may have been. We won't be deploying for a few more months, so I haven't pursued beyond the POC.
@kempt I got it working, but not exactly the way that Cylance says to install it.
I used their: UNATTENDED_INSTALL.SH 1 #!/bin/bash
2 echo xxxxxxxxxxxxxx > /Customlocation/cylanceinstall/cyagent_install_token
3 sudo installer -pkg /Customlocation/cylanceinstall/CylanceAgent.pkg -target /
With one policy I have this Script and the CylancePROTECT.pkg that are moved into a directory on the users machine, Next in the policy i add "File and Processes", and under the "Execute Command" I have the following line: /Customlocation/unattended_install.sh
This just runs the unattended Install, that creates the token and installs the software. it does it silently and seems to work as expected.
Sorry to have dropped this for a while. I'm coming back to this now.
I used Composer to snapshot the install of the Cylance package. During the install, a modal window pops up wanting the token key. I can open a text file, copy and paste the key in and then continue with the install. After I finish the snapshot and upload it in Casper Admin I build a policy with that package and it will install Cylance, however, it will be without any token key and will keep prompting for a key in another modal window. This would not be optimal for the user experience.
Why won't it keep the token key in the package? Is there a file somewhere's I can find it and add it to the snapshot?
Would you mind uploading some screenshots of your policy that you created to run it unattended? I think this might be the better option to install this way.
I'm still not following your process. Can we start at the beginning?
You use Composer to install Cylance and during the install when it asks for the token you copy and past it in that field and then finish up the Composer snapshot which you have saved as CylanceAgent1.pkg
• Open /private/tmp (On a computer with composer) • Create a folder called "Cylance" (Just a suggestion on name) • Drag the cylancePROTECT.pkg into this new folder. • Create a shell script as suggested (example below) and call it something like "install_cylance_with_token.sh"
• Copy the script into that new directory (/private/tmp/Cylance) • Open Composer • Drag the entire "Cylance" directory into Composer (the "Cylance" folder that you created in /private/tmp/) • Check permissions on everything in that composer list. • Package what you have in composer as a .pkg or a .dmg as you prefer. I see no benefit to having this packaged as a .dmg so... • Upload this new package to Casper Admin with whatever notes and settings you prefer. In all likelihood, this will need to be installed after boot, but I'm not positive.
• Create a policy as described above, using the "execute command" field in "Files and Processes" as described. In the case of my example, that would be:
This is what I've done this morning to check. It's working well for me.
P.S. I did consider simply trying to edit the source of the installer as there seems to be a script in the package where we could stick the token, but this process seems simpler.
This is also how i am doing this, my tmp folder is called something different, and apparently i was not clear enough in the beginning. But the main key here is that you dont install cylance during the composer package creation, just have the install package in the correct tmp folder with the correct script.
my apologize, let me know if i can be of any further help.
exit 0 • Copy the script into that directory (/private/tmp/Cylance)
• Open Composer • Drag the entire "Cylance" directory into Composer (the "Cylance" folder that you created in /private/tmp/ • Check permissions on everything in that composer list. • Package what you have in composer as a .pkg or a .dmg as you prefer. I see no benifit to having this packaged as a .dmg so... • Upload this new package to Casper Admin with whatever notes and settings you prefer. In all likelyhood, this will need to be installed after boot, but I'm not positive. • Create a policy as described above, using the "execute command" field in "Files and Processes" as described. In the case of my example, that would be:
Whoops, sorry about that! I've edited the post to clarify for the future. It was a good thing too, as there were also a few blatant misspellings! In any event, Yes, you should copy the cylancePROTECT.pkg into that new folder. And yes, you copy your "installation token" from the "Application" section (https://my-vs2.cylance.com/Application/) of your Cylance Dashboard into the script. Specifically, where the text says "PLACE_TOKEN_HERE". Make sure that the spaces between remain intact.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.