When choosing a virus scanner select only one of the following virus scanning software to scan the package:
-
MetaDefender
-
Custom Virus Scanner
-
Windows Defender
Configure MetaDefender virus scanner
This procedure shows how to configure the settings for MetaDefender or any custom virus scanner to implement virus scanning of packages before uploading them to a file server. Scanning is performed asynchronously but waits until the response from the scanner is received before starting to upload the package.
-
If no custom scanning is configured the package is not upload, and the software generates an error message that no virus scanning option was used.
-
If the package was scanned and the scan fails, the package is not uploaded and you receive a notification about any detected virus.
Configure IVirusScanner virus interface
The IVirusScanner interface is provided for you to implement a custom scanner:
-
Navigate to [Product Folder]\Web API, for example: "C:\Program Files (x86)\Smart\Engineering Manager\5.0.1".
-
Under the installation root path, navigate to "..\Smart\Engineering Manager\5.0.1\Server".
-
From the GrpcClient folder, open the appsettings.json file using a text editor.
-
Go to the <VirusScanner> section and in the <MetaDefenderServer> section, add the following rows:
<!--Settings for Metadefender VirusScan-->
-
Enter values for the following parameters, for example:
<add key="MetaDefender_URI" value="http://semappmetdef01.mycloud.net:8008" />
<add key="MetaDefender_ApiKey" value="" />
<add key="MetaDefender_PollingInterval" value="200" />
<add key="MetaDefender_Timeout" value="1000000" />
-
The MetaDefender_ApiKey value is relevant where the MetaDefender URI is secured. For details on how to generate a key, see https://onlinehelp.opswat.com/vault/Generate_an_API_key_from_Metadefender_Core.html. If the MetaDefender URI is not secured, the MetaDefender_ApiKey parameter value should be left blank.
-
The MetaDefender_PollingInterval parameter determines the sleep time between polling scan results.
-
Values of the MetaDefender_PollingInterval and MetaDefender_Timeout parameters are in milliseconds.
-
-
Save and close the appsettings.json file.
Use a custom virus scanner to perform scanning
The custom scanner example shown below makes use of the ClamAV virus scanner.
-
Download Clam AV Win.X64.Zip file, located at ClamAV Downloads.
-
Create a folder on the system and extract the .ZIP file to that folder. For example: C:\ClamAV folder.
-
From the ClamAV installation package, locate the clamd.conf and freshclam.conf files and copy them to the ClamAV folder. See, ClamAV configuration.
-
Open a command prompt window and enter the following command: C:\ClamAV>freshclam.exe . This downloads the latest virus definitions.
-
To install ClamAV, enter the following command: C:\ClamAV>clamd –install. The command response is: Service ClamD successfully created.
-
To install the ClamAV Virus Updater service, enter the following command: C:\ClamAV>freshclam -install. The command response is: Service FreshClam successfully created.
-
From the Windows Control Panel, select Administrative Tools > Services.
-
In the Services list, select the Startup Type to Automatic for the ClamAV FreshClam and the ClamAV ClamD services.
-
To activate the service in the code, open the appsettings.json file located in WebApi.Service project.
-
Set the Active value to "true", in the “ClamAVServer” section.
-
Save and close the appsettings.json file.
-
Restart the Smart Engineering Manager server.
We recommend downloading and configuring the ClamAV service on the same machine on which Smart Engineering Manager is installed.
Use Windows Defender for scanning a package
Windows Defender is built into Windows and therefore only needs to be set to to "true" in the Active value, in the appsettings.json file.
Parameters for ClamAVServer, MetaDefenderServer and WindowsDefender
Set any parameter that is active to "true", only for the virus scanner option you decide to use. In the example below, the ClamAVServer is set as the active scanner.