<div dir="ltr">Hi<div><br></div><div>This is the wrapper shell script  I'm using from perl code:</div><div><br></div><div>#!/bin/sh <br><br>version="1.0"<br># $1=subject<br># $2=text<br><br>die () {<br><br>    if [ -e $task_file ]; then <br>        rm -f $task_file <br>    fi<br><br>    # delete task in the end<br>    /opt/kaspersky/kesl/bin/kesl-control --delete-task $task_name >/dev/null 2>&1<br><br>    echo >&2 "$@"<br>    exit 1<br>}<br><br># verify parms <br>[ "$#" -eq 3 ] || die "3 argument required, $# provided, 1=task_uuid,2=task_settings_filename,3=file_to_scan"<br><br># use var for command line parms<br>task_name=$1<br>task_file=$2<br>scan_file=$3<br><br># check scan file <br>if [ ! -e $scan_file ]; then <br>         die "KAV_ERROR_000: task file: $scan_file does not exist"<br>fi <br><br># create task <br>if [ ! -e $task_file ]; then <br>        die "KAV_ERROR_000: task file: $task_file does not exist"<br>fi <br><br>/opt/kaspersky/kesl/bin/kesl-control --create-task $task_name --type ODS --file $task_file >/dev/null 2>&1<br>ret_create_task=$? <br><br># check return value <br>if [ $ret_create_task -gt 0 ]; then <br>        die "KAV_ERROR_$ret_create_task: task: $task_name cannot be created"<br>fi <br><br># start  task <br>/opt/kaspersky/kesl/bin/kesl-control --start-task $task_name -W >/dev/null 2>&1<br>ret_run_task=$?<br><br># check return value<br>if [ $ret_run_task -gt 0 ]; then<br>        die "KAV_ERROR_$ret_run_task: task: $task_name cannot be started"<br>fi<br><br># delete task in the end <br>/opt/kaspersky/kesl/bin/kesl-control --delete-task $task_name >/dev/null 2>&1<br><br># get events<br>output=`/opt/kaspersky/kesl/bin/kesl-control -E --query "TaskName=='$task_name' and EventType=='ThreatDetected' and ObjectName=='File' and Filename like '%$scan_file%'"`<br>ret_show_events=$?<br><br>if [ $ret_show_events -gt 0 ]; then<br>        die "000_KAV_ERROR_$ret_show_events: task: $task_name cannot show events"<br>fi<br><br>echo "$output"<br><br>exit 0<div class="gmail-yj6qo"></div><div class="gmail-adL"><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jan 8, 2019 at 4:38 PM Davide Bozzelli <<a href="mailto:davide.bozzelli@gmail.com">davide.bozzelli@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">As promised the following is some info about kesl (kaspersky enpoint security).<div><br></div><div>The command line utility to interact with the service is: /opt/kaspersky/kesl/bin/kesl-control</div><div>There is no simple way to have  a clamdscan like functionality in oder to scan a file and get the virus name.</div><div><br></div><div>HOW TO RUN A SCAN </div><div>--------------------------------</div><div><br></div><div>So after some researching i've found the following steps:</div><div><br></div><div>1) create a task file settings in which i will put the filename to scan, something linke:</div><div><div>FirstAction=Skip</div><div>ScanMailBases=Yes</div><div>ScanPlainMail=Yes</div><div>UseAnalyzer=Yes</div><div>HeuristicLevel=Medium</div><div>[ScanScope.item_1]</div><div>Path=/tmp/eicar_com.zip</div></div><div><br></div><div>2) create a task: /opt/kaspersky/kesl/bin/kesl-control --create-task $task_name --type ODS --file $task_file</div><div><br></div><div>3) run task: /opt/kaspersky/kesl/bin/kesl-control --start-task $task_name -W </div><div>     the -W parameter force to wait the end of the task </div><div><br></div><div>4) delete task: /opt/kaspersky/kesl/bin/kesl-control --delete-task $task_name</div><div><br></div><div>5) run a query to find out scan info about filename AND task: </div><div>    /opt/kaspersky/kesl/bin/kesl-control -E --query "TaskName=='$task_name' and EventType=='ThreatDetected' and ObjectName=='File' and Filename like '%$scan_file%'"</div><div>   </div><div>HOW TO INTEGRATE WITH PMG-SMTP-FILTER </div><div>-------------------------------------------------------------------</div><div><br></div><div>Early i haved used system() to run various command but this leads in a fork() for each command.</div><div>I've prefer then to put all the  tasks operation in a shell script and then let run it from perl code.</div><div>In this way the perl code is more or less similar to the other used for avast or clamd.</div><div><br></div><div>I'm going to post perl and shell code in a separate mail on this list under this thread.</div><div><br></div><div>Thx </div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jan 8, 2019 at 12:48 PM Stoiko Ivanov <<a href="mailto:s.ivanov@proxmox.com" target="_blank">s.ivanov@proxmox.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
Thank you for providing the links and the time you spent integrating it!<br>
<br>
I'll give it a look and will try to post my results here this week.<br>
<br>
<br>
<br>
On Fri, 28 Dec 2018 15:53:01 +0100<br>
Davide Bozzelli <<a href="mailto:davide.bozzelli@gmail.com" target="_blank">davide.bozzelli@gmail.com</a>> wrote:<br>
<br>
> Basically the product is one: kaspersky endpoint security for linux,<br>
> sold in two version<br>
> 1) as endpoint product (standalone av)<br>
> 2) as specifically for file server<br>
> <br>
> LINKS:<br>
> 1)<br>
> <a href="https://www.kaspersky.com/small-to-medium-business-security/file-server" rel="noreferrer" target="_blank">https://www.kaspersky.com/small-to-medium-business-security/file-server</a><br>
> 2)<br>
> <a href="https://www.kaspersky.com/small-to-medium-business-security/endpoint-linux" rel="noreferrer" target="_blank">https://www.kaspersky.com/small-to-medium-business-security/endpoint-linux</a><br>
> <br>
> Pricing for 1 license of  "kaspersky security for file server" is<br>
> circa 400 euros.<br>
> Price seems to be fair.<br>
> AV is daemonized and performace seems to be good (but more slower than<br>
> avast/clamd).<br>
> Deb package exists for debian and it's easily to download and test.<br>
> There is not a simple command line interface like clamdscan or<br>
> scan/avast but i was able<br>
> to simulate it.<br>
> <br>
> Thx<br>
> <br>
> <br>
> <br>
> On Fri, Dec 28, 2018 at 3:10 PM Dietmar Maurer <<a href="mailto:dietmar@proxmox.com" target="_blank">dietmar@proxmox.com</a>><br>
> wrote:<br>
> <br>
> > > As per topic, I was able to integrate the kaspersky antivirus with<br>
> > > pmg-smtp-filter.<br>
> > > I would'nt give any implementation's details here as don't know<br>
> > > if could  <br>
> > be  <br>
> > > interesting<br>
> > > for the product.<br>
> > ><br>
> > > Do you think would be useful ?  <br>
> ><br>
> > What is the pricing of that product? Do you have a link to the<br>
> > product page?<br>
> ><br>
> >  <br>
> <br>
<br>
<br>
_______________________________________________<br>
pmg-devel mailing list<br>
<a href="mailto:pmg-devel@pve.proxmox.com" target="_blank">pmg-devel@pve.proxmox.com</a><br>
<a href="https://pve.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel" rel="noreferrer" target="_blank">https://pve.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_6923118838849335973gmail_signature">Got problems with Windows? - ReBooT<br>Got problems with Linux? - Be RooT </div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Got problems with Windows? - ReBooT<br>Got problems with Linux? - Be RooT </div>