Skip to content
Snippets Groups Projects
Commit 87edc204 authored by Gioacchino Vino's avatar Gioacchino Vino
Browse files

New oids classification

parent a7ce55bc
No related branches found
No related tags found
1 merge request!151Debug paas ci
......@@ -684,7 +684,7 @@ class ReportManager():
self.REPORT_THREAT: self.DEFAULT_THREAT}
self.oids = dict()
def init_host_vars(self,host: str): #, r: ResultReport):
def init_host_vars(self,host: str):
self.oids[host] = {self.OID_ACCEPTED: [],
self.OID_DROPPED: [],
self.OID_NEW: []}
......@@ -693,8 +693,6 @@ class ReportManager():
self.oids[host][self.OID_OS] = []
self.report[host] = dict()
#self.report[host][r.port] = {self.REPORT_SEVERITY: self.DEFAULT_SEVERITY,
# self.REPORT_THREAT: self.DEFAULT_THREAT}
self.report[host][self.REPORT_GLOBAL] = {self.REPORT_SEVERITY: self.DEFAULT_SEVERITY,
self.REPORT_THREAT: self.DEFAULT_THREAT}
......@@ -722,14 +720,13 @@ class ReportManager():
for host, host_report in self.imported_oids.items():
# Init aggregated variables per host
self.init_host_vars(host)#,res_report)
self.init_host_vars(host)
for res_report in host_report:
logging.debug(res_report)
# Skip if oid is not relevant
if res_report.severity < self.SEVERITY_THR:
self.update_summary(host, res_report)
logging.debug("LOW SEVERITY -> SKIPPED")
continue
......@@ -760,8 +757,6 @@ class ReportManager():
else:
self.report[self.REPORT_GLOBAL] = self.MSG_NOK
logging.debug(pretty_json(self.report))
def get_summary(self) -> str:
return pretty_json(self.report)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment