Using f-secure with PMG

Jul 31, 2020
6
6
23
54
Some days ago I have successfully activated f-secure. Just for the case, anybody is interested in the /usr/local/bin/pmg-custom-check, that's what I'm using:
Bash:
#!/bin/sh

if [ "$#" -ne 2 ]; then
  echo "usage: $0 APIVERSION QUEUEFILENAME" 1>&2
  exit 1
fi

apiver="$1"
shift

if [ "$apiver" != "v1" ]; then
  echo "wrong APIVERSION: $apiver" 1>&2
  exit 2
fi

echo "v1"

FSANALYZE="/opt/f-secure/linuxsecurity/bin/fsanalyze"
if [ ! -x "$FSANALYZE" ] ; then
        echo "ERROR: Virus Scanner '$$FSANALYZE' not accessible!" >&2
        exit 3
fi

RESULT=`$FSANALYZE -q --malware=none "$1" | sed -e 's/^.*infection=\([^ ]*\).*/\1/'`

if [ -z "$RESULT" ] ; then
        echo OK
else
        echo "VIRUS: $RESULT (f-secure)"
fi

exit 0
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!