コード例 #1
0
        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));
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public async Task RegisterIncident(IFormFile file, string host, VTShortReport shortReport, string restrictingPolicy)
 {
     await RegisterIncidentAtMongoAsync(file, shortReport);
     await RegisterIncidentAtElasticAsync(host, shortReport, restrictingPolicy);
 }