add sophos and mcafee scan backend

This commit is contained in:
Volodymyr Smirnov
2020-10-22 21:27:16 +03:00
parent e8f104168f
commit 22ef94f527
6 changed files with 101 additions and 1 deletions

View File

@@ -0,0 +1,32 @@
using System;
using System.IO;
using System.Text.RegularExpressions;
using MalwareMultiScan.Backends.Backends.Abstracts;
using Microsoft.Extensions.Logging;
namespace MalwareMultiScan.Backends.Backends.Implementations
{
public class SophosScanBackend : AbstractLocalProcessScanBackend
{
public SophosScanBackend(ILogger logger) : base(logger)
{
}
public override string Id { get; } = "sophos";
public override DateTime DatabaseLastUpdate =>
File.GetLastWriteTime("/opt/sophos-av/lib/sav/vdlsync.upd");
protected override string BackendPath { get; } = "/opt/sophos-av/bin/savscan";
protected override bool ThrowOnNonZeroExitCode { get; } = false;
protected override Regex MatchRegex { get; } =
new Regex(@">>> Virus '(?<threat>.*)' found in file .*", RegexOptions.Compiled | RegexOptions.Multiline);
protected override string GetBackendArguments(string path)
{
return $"-f -archive -ss {path}";
}
}
}