Installing Kaspersky AntiVirus Software

niacobelli
New Contributor III

Good morning,

I am trying to automate the installation of Kaspersky AntiVirus. Right now we manually install it on each computer and I shouldn't have to. The actual Kaspersky installation gets installed as it should because I just drag the .pkg into Admin. However, the Network Agent that assigns what server it looks for doesn't work. I had made a Snapshot and typed in our server, but from our console we can see the computer but it isn't talking with our server for remote activation.

Does anyone have any experience with Kaspersky and can lend a hand?

Thank you,
Nick

20 REPLIES 20

s_mcc
New Contributor II

First off, let me empathize with having the deal with KAV at all. I feel that pain.

That aside, the simple (And undignified) way we set KAV to deploy is to drop both dmgs into tmp (With their install scripts) and run the script attatched. With the Netagent you can run the script with -r arguement and specify your server, or just edit the script to include the URL and bypass that. (See http://support.kaspersky.com/us/12332#block3 for reference.) Both installs via script run silent, and afterwards our clients do check in to the administration server to acquire their license. I can't speak to snapshotting, but trying to include the install created config file in pkg deployments caused unknown errors in our sync. Possibly that's what you're seeing.

For reference, we do netagent then suite (Not sure that matters), as in previous iterations we used to push from the Kaspersky Admin, but that seems flaky with that last couple updates.

Hope that helps.

niacobelli
New Contributor III

@mccreedys Thanks, I am not sure if I fully understand some of your terminology and abbreviations. What is tmp and what scripts are they running?

I have the install.sh and when I put our server name in the -r argument and it returned an error. I am probably missing something really obvious. We ran the Kaspersky tool on our Admin server, but I don't know what to do next.

rob_hernandez
New Contributor III

Tagging for later. I, too, am interested in getting this to work.

s_mcc
New Contributor II

Sorry for the delay, I'll try to be less scattered.

For the netagent, I've wrapped the klnagent folder (With the script [install.sh] and dmg) inside a package that drops the folder on our client machine at /private/tmp (This is just because we clean our tmp spaces so the folder won't linger). Currently, I just have the script edited so that the variable assigned to IP points to our administration server in lieu of using the -r command. I've sometimes seen an error where the dmg won't mount if you don't first cd into the directory where it and the script are, though that's been rare.

Dropping the package (and the edited script) and running the script via Execute Command in the 'Files and Processes' section of the Policy has been working for us. It's a simpler command, not requiring any arguments so maybe that'll work for you?

Hopefully you found a better answer before I answered, if not, hopefully this helps. (I'll watch it closer next time.)

mscottblake
Valued Contributor

I am deploying Kaspersky Endpoint Security successfully without any issues. I'll post my notes on Monday when I have access to them again.

canopimp
New Contributor III

The way I found to do this was to edit the install.sh script for the NetAgent to specify the server using its DNS name. There is a field for it at the top of the script when you edit it. Following the post @mccreedys made about using the Kaspersky Installation instructions, I followed the Apple Remote Desktop Installation section. I used the Packages program to create the package for the agents three files. (install.sh, klnagent.kud, and klnagentmac.dmg) I followed Rich Trouton's Blog about making an Office install package. Here to make my package. By running the script as a post-installation script in Packages, it installs the netagent properly. I then took the setup files for the client and did the same thing and made a Client package that runs the install script post-installation as well. I then took both packages and made them one big installation package with the netagent installing first and then the client using the exact method Rich explains in his blog. It has worked perfectly in deployment. Hope this helps.

mscottblake
Valued Contributor

@niacobelli

Oops, I meant to post back here. Sorry about that.

I follow the same basic layout as @canopimp.

Kaspersky Network Agent
I add the necessary info into the install.sh variables, then add the files into Packages as depicted.
9c09364a537344a79af0a360bd5df1b6

Kaspersky Endpoint Security
Since their install.sh file takes parameters, I create a postinstall.sh file that simply calls install.sh and add the files into Packages as depicted.
0362dfe5d053446ab73d278eee731cbb

garyj
New Contributor

I'm not clear on the postinstall.sh script calling the install.sh script.
Install.sh works for the netagent, but I get an error running the install.sh that installs Kaspersky.

What does your postinstall.sh file look like?

Ok, figured it out. This seems to work

#!/bin/sh sh install.sh

mscottblake
Valued Contributor

@garyj

Yeah, install.sh takes parameters and if it's run as a postinstall, Installer.app will pass a few things to it, but they are not the values the script is expecting, so it fails.

niacobelli
New Contributor III

Hey @mscottblake ,

I'm still trying to wrap my head around this and using Packages. In the install.sh from Kaspersky, what values can I change? I have the IP address and the server name that we use. Where in the script can I edit these fields?

Also, how can I add a post install script to run everything through Packages?

Sorry for so many questions, I just want to make sure I have everything covered. Scripting is a weak point that I'm trying to work on.

Thank you

mscottblake
Valued Contributor

@niacobelli If I remember correctly, the only thing I have to change is in the Network Agent package. Near the top, the IP_ADDRESS field gets the address to the KES server.

In my case, I have IP_ADDRESS=kes.domain.com/site

eflores
New Contributor

@mscottblake] what is the program you are using in your screenshots to create your packages/scripts?

thanks - ernesto

mscottblake
Valued Contributor

@eflores I use Packages for most of my packaging needs.

criseno
New Contributor

Hi, i was able to install both kaspersky endpoint and net agent successfully. However, how can I deploy the license key remotely through casper. After installation through caspers it shows its not activated

canopimp
New Contributor III

The installation files need to be made by the Kaspersky Server Console. This ensures the activation files are in place to point back to the server. At least this is how we do it. I have not tried to activate after installing with some kind of script or automation.

criseno
New Contributor

Hi, I was able to activate kaspersky mac client via the kaspersky admin console. There's a way there to create a task to distribute the key file or activation code.

https://support.kaspersky.com/12333#block3

Monkeyfist
New Contributor II

Just wanted to thank you guys for the tips I got mine working a bit differently with the newer versions. Add the .key file for the client pkg and you avoid activation. Also the .ini file with the agent pkg and you will not have to edit the install.sh Also I had to just include install.sh for both and do a postinstall.sh file.

For anyone that still is stuck with it. They officially don't support Jamf installs and refuse to even try. They say use your server to remote install after the fact. I get it working about every other version. I'm about two months from switching off them thank god.

 

tvalente
New Contributor III

For the new version with Catalina compatibility, (Kaspersky 11), the "kav addkey" command is not working anymore.

As @Monkeyfist noted, you can add the key file in the same directory as the install.sh from the editor. It will search for something with a ".key" extension and use it to activate the license. The new command is :

kav LICENSE /add /Path/to/license.key

schiemsk
New Contributor III

I work with KSC + KESB (for Windows, for Mac, for Linux)

I do not directly install KES for mac by Jamf.
I use the Kaspersky agent package from KSC and deploy it to our Mac stations with Jamf by pushing it to /private/tmp/<agentfolder> and running a "run after" script to install it with the mandatory params (accept eula, mainly).


After that, the KES deployment is done by KSC through a scheduled task.
The licence key is set, in KSC, to be automacitaly distributed.

 

Beware the latest Monterey release which is no longer support python 2.7 : only the latest KES version (with patch C included) can be installed.

 

Ouf course, all configuration profiles (PPP, ...) are set at first.