From e1f441b921f2f7352bc13626d88919af4e85d751 Mon Sep 17 00:00:00 2001 From: Gioacchino Vino <gioacchino.vino@infn.it> Date: Mon, 29 Apr 2024 13:41:28 +0200 Subject: [PATCH] Added logic accepted/know issues during oid validation --- files/gvm_library.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/files/gvm_library.py b/files/gvm_library.py index bb8739b..40a1669 100644 --- a/files/gvm_library.py +++ b/files/gvm_library.py @@ -464,9 +464,17 @@ class Task: glob_threat = 'None' for o, s, t, p in zip(o_ids, severities, treats, ports): logging.debug(f"Detected oid: {o}, severity: {s}, threat: {t} and port: {p}") - if (o not in accepted_issues) and (o in known_issues): - logging.debug(f"Oid {o}, not accepted but known") - continue + + if s >= 4: + if o in accepted_issues: + logging.debug(f"Oid {o} ACCEPTED") + else: + if o in known_issues: + logging.debug(f"Oid {o} DROPPED (not accepted but known)") + continue + else: + logging.debug(f"Oid {o} NEW (not accepted and not known)") + if p in report: if s > report[p]['severity']: report[p] = {'severity': s, 'threat': t} -- GitLab