private async Task RegisterIncidentAtMongoAsync(IFormFile file, VTShortReport shortReport) { await Mongo.UploadFile(file.FileName, file.OpenReadStream()); await Mongo.InsertShortReport(shortReport.md5, JsonConvert.SerializeObject(shortReport, Formatting.Indented)); }
private async Task RegisterIncidentAtElasticAsync(string host, VTShortReport shortReport, string restrictingPolicy) { var incident = new EventIncident(host, shortReport.md5, shortReport.full_class, restrictingPolicy); var firstOccurrenceIp = await Elastic.FindFirstOccurrenceIpByFileHash(shortReport.md5); var paths = await Neo4J.FindAllPaths(firstOccurrenceIp, host); incident.SetPossibleRoutes(paths); incident.ExcludeRestrictedRoutes(shortReport, Redis); await Logstash.SendEventAsync(incident); }
public async Task RegisterIncident(IFormFile file, string host, VTShortReport shortReport, string restrictingPolicy) { await RegisterIncidentAtMongoAsync(file, shortReport); await RegisterIncidentAtElasticAsync(host, shortReport, restrictingPolicy); }