-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Evaluator #43
base: master
Are you sure you want to change the base?
Evaluator #43
Conversation
from collections import defaultdict | ||
|
||
#Enter an API key to obtain informations from nerd | ||
NERD_API_KEY = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be loaded from configuration (see https://github.com/CESNET/Nemea-Detectors/tree/master/blacklistfilter/blacklist_downloader and @BLACKLISTFILTERDIR@
as an example) . It is not a best practice to modify installed scripts.
parser.add_option("-i", "--ifcspec", dest="ifcspec", | ||
help="TRAP IFC specifier", metavar="IFCSPEC") | ||
parser.add_option("-c", "--csv-path", dest="csv", help="Path to the csv files generated by Split Evidence") | ||
parser.add_option("-e","--evidence-path", dest="evidence", help="Path to the folder for storing data of unreported detections") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the config file is passed using a new option, you need not to use configure to fill the correct path as it is in blacklist_downloader
.
self.nerd_info = nerd_info | ||
|
||
class MonitoredClient: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General comment: doc is missing... classes and methods should be documented.
self.statistics["packets_recv"] += int(flow["uint32 PACKETS"]) | ||
self.statistics["flows_recv"] += 1 | ||
|
||
#Determine other statistics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does it mean Determine other statistics
? Do you mean "compute statistics for ... client? + Doc should be written according to https://www.python.org/dev/peps/pep-0257/
continue | ||
thresholds_reached = 0; | ||
clients[key].process() | ||
if (float(clients[key].statistics['bytes_per_pkt_sent']) > 187.1207): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These constants should be loaded from configuration file as well.
@@ -0,0 +1,131 @@ | |||
#include "FileHandler.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing licence and author.
@@ -0,0 +1,61 @@ | |||
#ifndef UNTITLED1_FILEHANDLER_H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing licence and author
@@ -0,0 +1,12 @@ | |||
/************* THIS IS AUTOMATICALLY GENERATED FILE, DO NOT EDIT *************/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fields.c file should not be versioned in git repo, it should be generated automatically by Makefile
@@ -0,0 +1,13 @@ | |||
#ifndef _UR_FIELDS_H_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fields.h file should not be versioned in git repo, it should be generated automatically by Makefile
@@ -0,0 +1,316 @@ | |||
import csv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing licence and author
No description provided.