Verdict-as-a-Service

Verdict-as-a-Service Logo Online Dokumentation

Example: Nextcloud Plugin

This example demonstrates how to utilize Verdict-as-a-Service to protect a Nextcloud installation against malware. It is meant to scan the files uploaded to the Nextcloud installation.

Simple implementation

The main lines of code utilizing Verdict-as-a-Service in this example are the following.

$this->vaas->Connect($this->authenticator->getToken());
$verdict = $this->vaas->ForFile($filePath);

switch ($verdict->Verdict->value) {
    case TagService::CLEAN:
        $this->tagService->setTag($fileId, TagService::CLEAN);
        break;
    case TagService::MALICIOUS:
        $this->tagService->setTag($fileId, TagService::MALICIOUS);
        try {
            $this->fileService->setMaliciousPrefixIfActivated($fileId);
            $this->fileService->moveFileToQuarantineFolderIfDefined($fileId);
        } catch (Exception) {
        }
        break;
    default:
        $this->tagService->setTag($fileId, TagService::UNSCANNED);
        break;
}

Automatic file scanning

We implemented an automatic file scan, that scans all files that are already uploaded to the Nextcloud instance. This scan option can also be configured to only scan new files for malware.

Found items will get moved into the quarantine folder and tagged with the "Malicious"-Tag.

On-Demand scan

You can always run an on-demand scan for any existing file in the Nextcloud instance via the context menu.

95%

When a virus is found, you get a notification about it. The file will get moved into the configured quarantine folder and it will get tagged with the "Malicious"-Tag.

95%

How to get the plugin?

The plugin is currently not published and therefore not available in the Nextcloud Apps directory. You can get in contact with us and have a chat about your use case. Have a look at the contact page for that.