Virus Detection

Overview

Virus detection is one of the intelligence tasks in the Filestack platform. Using this mechanism, you can detect infected content in files your users upload asynchronously immediately after the file hits the storage.

This task is only available at Filestack Workflows. Read more about Workflows here.

Workflows Task Configuration

Visit Creating Workflows Tutorial to learn how you can use Workflows UI to configure your tasks and logic between them.

Virus detection task is available under Intelligence tasks category.

Workflows Parameters

Task Name string Unique name of the task. It will be included in the webhook response and can be used to build logic below.

Logic

Virus Detection task returns following response to the workflows:

  • If your file does not contain any virus or malware:

    {
    "data": {
        "infected": false,
        "infections_list": []
    }
    }
  • If your file contains any virus or malware:

    {
    "data": {
        "infected": true,
        "infections_list": [
            "content.malicious.ait-trojan-nymeria-315"
        ]
    }
    }

Logic Parameters

data dictionary Includes the response from this service.
infected boolean Indicates whether the file is infected or not.
infections_list array of strings List of strings with names of any malware found in the file, if the file is not infected list will be empty.

Based on the task’s response you can build logic that tells the workflow how dependent tasks should be executed. For example, if you would like to run another task if a virus was detected you can use following rule:

infected eq true

In Workflows UI this command would look like in the example below:

Visit Creating Workflows Tutorial to learn how you can use Workflows UI to configure your tasks and logic between them.

Webhook

Below you can find an example webhook payload for a virus detection task

  • no virus detected

    {
    "workflow": "687227d2-5f84-44a0-b20b-1c29a1deb2ab",
    "createdAt": "2019-01-23T03:30:55.400729934Z",
    "updatedAt": "2019-01-23T03:30:57.437268735Z",
    "sources": [
        "VJQTvCboRVivuJ2BDKgd"
    ],
    "results": {
        "virus_detection_1548213592150": {
            "data": {
                "infected": false,
                "infections_list": []
            }
        }
    },
    "status": "Finished"
    }
  • virus detected

    {
    "workflow": "687227d2-5f84-44a0-b20b-1c29a1deb2ab",
    "createdAt": "2019-01-23T03:30:55.400729934Z",
    "updatedAt": "2019-01-23T03:30:57.437268735Z",
    "sources": [
        "VJQTvCboRVivuJ2BDKgd"
    ],
    "results": {
        "virus_detection_1548213592150": {
            "data": {
                "infected": true,
                "infections_list": [
                    "content.malicious.ait-trojan-nymeria-315"
                ]
            }
        }
    },
    "status": "Finished"
    }

Please visit the webhooks documentation page to see full payload of the webhook.