# Sophos anti-virus (savdid) Version: 3.99-stable Halon provides a malware detection add-on to Halon Protect from Sophos. Unlike other anti-virus solutions, it is designed specifically for in-transit email filtering. For more information, please see the [Features](#features) section. This is the documentation for the Sophos anti-virus add-on option. The package consists of one service called *savdid* which can be used to scan messages for viruses. ## Table of contents * [Features](#features) * [Behavioral Genotype](#features:behavioral-genotype) * [QR code protection (Quishing)](#features:qr-code-protection-quishing) * [Context Mail (CXMail)](#features:context-mail-cxmail) * [Sophos Live Protection](#features:sophos-live-protection) * [Optimized performance](#features:optimized-performance) * [True File Type (TFT)](#features:true-file-type-tft) * [Solution components](#features:solution-components) * [savdid daemon](#features:savdid-daemon) * [Halon Protect module](#features:halon-protect-module) * [Sophos definition mirror hosted by Halon](#features:sophos-definition-mirror-hosted-by-halon) * [Sophos datacenter lookup](#features:sophos-datacenter-lookup) * [Installation](#install) * [Prerequisites](#install:prerequisites) * [Distributions](#install:distributions) * [Ubuntu](#install:ubuntu) * [RHEL](#install:rhel) * [Startup](#install:startup) * [Docker & K8s](#install:docker-k8s) * [Upgrade](#upgrade) * [Configuration](#config) * [Protocol directives](#config:protocol-directives) * [Scanner directives](#config:scanner-directives) * [Global directives](#config:global-directives) * [Update virus definitions](#update) * [Integration](#integration) # Features Halon provides a malware detection add-on to Halon Protect from Sophos. Unlike other anti-virus solutions, it is designed specifically for in-transit email filtering. Sophos anti-virus provides protection against known and unknown threats, using proactive technologies to guard against zero-day threats. It has an option to use cloud lookups to improve threat response, reduce false positives and provide up-to-the-minute protection. With efficient memory usage and an architecture designed to leverage modern compute resources, it is a great choice for high throughput applications. ## Behavioral Genotype Sophos Behavioral Genotype provides immediate zero-day protection from more than 80% of emerging threats. The behavioral rule sets are constantly validated against an extensive library of malware samples and legitimate applications, ensuring accurate detection and reducing false positives. ## QR code protection (Quishing) QR codes embedded in emails are decoded and checked ensuring they’re safe. The URLs embedded in the QR codes are extracted and scanned by Sophos for malicious or suspicious content. * [Sophos article about Quishing](https://community.sophos.com/sophos-email/b/blog/posts/qr-code-quishing-protection) * [Halon blog about Quishing](https://halon.io/blog/quishing-qr-codes) ## Context Mail (CXMail) CXMail is designed to be highly effective against zero-day malware attacks that are spread via email. The technology applies stricter rules aimed at active content that is delivered in email attachments and proactively identifies polymorphic malicious documents and executables. The higher detection rate of CXMail is achieved by identifying strongly suspicious content that is not regularly associated with email communication. ## Sophos Live Protection A feature that enables real-time lookups to detect malicious attacks faster and with added accuracy. * **Faster threat response with ‘in-the-cloud’ checking.** Uses real-time information on the latest threats from SophosLabs; enabling up-to-the-minute detection. * **Increased accuracy with early-stage detection.** Helps thwart malicious code and malware early; more accurate protection with an increased amount of detection data. * **Effective mitigation of false-positives.** Remediates false positive entries with cloud information; whitelisting in the cloud prevents erroneous detection of system files as malicious. * **GDPR-friendly telemetry data helps SophosLabs improve detections.** The hashes (one-way cryptographic checksums) of attached files sent to Live Protection allows SophosLabs to improve existing detections, find new malware patterns, and target emerging threat vectors. ## Optimized performance It improves resource usage by requiring only one copy of the malware information database to service all requests. It doesn’t require frequent loading and re-initialization. The “hot updating” mechanism provides continuity of service, loading new definition data in parallel with the previous data. ## True File Type (TFT) TFT allows Halon Protect to accurately detect the file type of a file passed to Sophos engine. * File detection based on SophosLabs malware detection technology * Maintained and supported by SophosLabs * File types sorted into Group, Type, and Subtype allowing granular control over files * File types mapped to specific threat levels based on potential risk ## Solution components The solution involves the following components: * savdid daemon * Halon Protect module * Sophos definition mirror hosted by Halon * Sophos datacenter lookup (optional) ### savdid daemon The Sophos Anti Virus Dynamic Interface daemon (savdid) contains the anti-virus engine, and a server for querying the engine over a protocol called SSSP. The daemon is running on-premise at the customer, as close to Halon Protect as possible. It is provided as a Linux package for Ubuntu or RHEL-compatible distributions (.deb or .rpm) via a software repository provided to clients. For install instructions, please see the [Installation](#install) section. Halon also provides a Docker template and Kubernetes sample configurations. Please see [https://github.com/halon/halon-docker](https://github.com/halon/halon-docker) for more information. ### Halon Protect module Halon provides an open-source module for integration with savdid to provide anti-virus detection by sending queries to the daemons using the SSSP protocol. It is available in Halon’s software repositories and installed using the Linux distributions’ package managers. Please see [https://github.com/halon-extras/sophos](https://github.com/halon-extras/sophos) for more information. ### Sophos definition mirror hosted by Halon The savdid daemon comes with an update routine that periodically downloads incremental updates to the virus definition database from a mirror operated by Halon, hosted on a geo-redundant CDN. The mirror is password protected, with credentials provided by Halon to the customer. ### Sophos datacenter lookup There is an option to enable cloud lookups from the savdid daemon to Sophos’s datacenters called “Live Protection”, as described above. # Installation ## Prerequisites Make sure you have followed the [instructions](https://docs.halon.io/manual/comp_install.html#installation) in our manual to add our package repository. ## Distributions ### Ubuntu To install the .deb package use the following commands. ```console # apt-get update # apt-get install savdid ``` ### RHEL To install the .rpm package use the following commands. ```console # yum install savdid ``` ## Startup When the initial [configuration](#config) is in place and you have ran the shell script to [update the virus definitions](#update) at least once, the program can be started with: ```console # systemctl start savdid ``` ## Docker & K8s For instructions on how to build a container image of the program as well as deploying it on K8s (Kubernetes), see our [halon-docker](https://github.com/halon/halon-docker) GitHub repository. # Upgrade In order to upgrade the package, install the new package over the previous installed one (see the installation chapter). After the upgrade the service will be stopped and requires to be manually started. # Configuration *savdid* loads the non-reloadable configuration from `/etc/savdid/savdid.conf`. The default configuration file in `/opt/savdid/share/examples` can normally be used as a base: ```console # cp /opt/savdid/share/examples/savdid.conf /etc/savdid/ ``` Below are some of the most important settings that can be configured. ## Protocol directives ### channel.commprotocol.address The IP address to listen on. Mutually exclusive with [`channel.commprotocol.socket`](#config:confval-channel.commprotocol.socket). ### channel.commprotocol.port The port to listen on. Mutually exclusive with [`channel.commprotocol.socket`](#config:confval-channel.commprotocol.socket). ### channel.commprotocol.socket The socket to listen on. In the default configuration this is set to `/var/run/sssp.sock`. Mutually exclusive with [`channel.commprotocol.address`](#config:confval-channel.commprotocol.address). ### channel.commprotocol.type The type should be `UNIX` when using [`channel.commprotocol.socket`](#config:confval-channel.commprotocol.socket) and `IP` when using [`channel.commprotocol.address`](#config:confval-channel.commprotocol.address). ## Scanner directives ### channel.scanner.enabletft Enables the reporting of the file type of the scanned file. The valid options are *YES* or *NO*. The default is *NO*. ### channel.scanner.tftreport Specifies whether to report only the first TFT on the top level file, or report all TFTs that are found in sub files. The valid options are *FIRST* or *ALL*. ## Global directives ### user The privdrop user ### group The privdrop group # Update virus definitions In order to keep the virus definitions up to date, copy the sample shell script from `/opt/savdid/share/examples/update-cron.sh` to for example `/root/update-cron.sh`, replace the URL inside it with the one that was provided by us, run `crontab -e` as the root user and add the following cron job. ```default */15 * * * * /root/update-cron.sh ``` # Integration In order to integrate this program with our MTA, see our client library [here](https://github.com/halon-extras/sophos).