refactoring and adding clamav scanning backend

This commit is contained in:
Volodymyr Smirnov
2020-10-20 17:08:40 +03:00
parent 7e63c77419
commit b1a2357b50
15 changed files with 128 additions and 46 deletions

View File

@@ -1,5 +1,4 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Text.RegularExpressions;
using MalwareMultiScan.Backends.Backends.Abstracts;
@@ -9,22 +8,26 @@ namespace MalwareMultiScan.Backends.Backends.Implementations
{
public class WindowsDefenderScanBackend : AbstractLocalProcessScanBackend
{
public WindowsDefenderScanBackend(ILogger logger) : base(logger)
{
}
public override string Name { get; } = "Windows Defender";
public override DateTime DatabaseLastUpdate =>
File.GetLastWriteTime("/opt/engine/mpavbase.vdm");
protected override string BackendPath { get; } = "/opt/mpclient";
protected override Regex MatchRegex { get; } =
new Regex(@"EngineScanCallback\(\)\: Threat (?<threat>[\S]+) identified",
protected override Regex MatchRegex { get; } =
new Regex(@"EngineScanCallback\(\): Threat (?<threat>[\S]+) identified",
RegexOptions.Compiled | RegexOptions.Multiline);
protected override bool ParseStdErr { get; } = true;
protected override string GetBackendArguments(string path) => path;
public WindowsDefenderScanBackend(ILogger logger) : base(logger)
protected override string GetBackendArguments(string path)
{
return path;
}
}
}