logo
logo

Antivirus scan

An antivirus scan is a component of an antivirus package that scans files for viruses and other harmful items. Sitecore Content Hub has an antivirus scan functionality that triggers when users upload assets, either through the Creation component, or through an Excel import.

As a superuser, you can enable the antivirus scan in the settings. This document describes how to set it up.

Enable the antivirus scan

To enable the antivirus scan:

  1. On the menu bar, click Manage .

  2. On the Manage page, click Settings.

  3. On the Settings page, search for Antivirus.

  4. Search and select the AntivirusSetting.

  5. On the AntivirusSetting, set the antivirusEnabled flag to true.

  6. Click Save.

Configure an antivirus task

Because the antivirus scan functionality makes a call to an external service API, it requires a RunExternalWebTask processing task configured in the M.MediaMatrix for the related media flow.

Set up an external web task

  1. On the menu bar, click Manage .

  2. On the Manage page, click Settings.

  3. On the Settings page, search for Media processing.

  4. On the Media processing page, select Content and click Archives.

  5. On the Archives flow details page, click and, in the right-hand pane, select Run external web task.

  6. In the Parameters tab, in the Name field, enter Antivirus. You can leave the Content type field blank. In the Content disposition field, select Attachment. In the URL field, enter a URL that points to the external antivirus scan service of your choice.

  7. In the Outputs tab, click Store output to enable outputs. In the Output type field, select Property. In the Property field, select Virusscan result.

  8. Click Save task, then Save and Close.

  9. Click Publish.

Configure the M.MediaMatrix.Content entity

  1. Go to {host}/en-us/admin/entitymgmt/entities/{entity ID number}.

  2. On the Media Matrix entities page, locate Content and click View detail next to it.

  3. On the M.MediaMatrix.Content entity detail page, click and make sure the Text option is selected from the drop-down menu.

  4. Search for the Archives node and make sure this JSON comes first under tasks:

    "antivirus": {
            "type": "RunExternalWebTask",
            "do update": true,
            "input": "source",
            "output": "antivirus",
            "outputfileprovider": "local",
            "contentdisposition": "attachment",
            "url": "http://beeceptor.com/console/testsitecore-antivirus",
            "parameters": {},
            "headers": {}
        }
  5. Add an antivirus dependency in the metadata entry of the Archives node as follows:

    "deps": [
        "antivirus"
    ]
  6. Store the scan output in the antivirus property of the file as follows:

    "properties": {
        "VirusScanResult": "antivirus"
    }
  7. Click Save.

Complete the antivirus scan

Create an asset either through the Creation component or through an Excel import. If the file is considered to have malicious content by the antivirus service you have used, on the file details page, you see the message: "This file has been flagged as malicious. Downloads are disabled." Also, if a file is flagged as malicious, the thumbnail and associated renditions are replaced by placeholders, and any options for downloading it are disabled.

Note

An external web task is a webhook that Content Hub uses in file processing to create custom renditions (pre-defined file conversions).

Can we improve this article ? Provide feedback