From 76692a36d76fe1b085b4b9915744017090e2b37e Mon Sep 17 00:00:00 2001 From: oriagmon Date: Sun, 21 Oct 2018 10:53:50 +0300 Subject: [PATCH] Finished with the left of the PR comments. --- kube-hunter.py | 4 ---- src/core/events/types/common.py | 2 -- src/modules/report/collector.py | 4 ---- src/modules/report/plain.py | 1 - 4 files changed, 11 deletions(-) diff --git a/kube-hunter.py b/kube-hunter.py index 2d8548c..cd43b88 100755 --- a/kube-hunter.py +++ b/kube-hunter.py @@ -93,15 +93,11 @@ def list_hunters(): global hunt_started_lock hunt_started_lock = threading.Lock() -hunt_started_lock.acquire() hunt_started = False -hunt_started_lock.release() def main(): - hunt_started_lock.acquire() global hunt_started - hunt_started_lock.release() scan_options = [ config.pod, config.cidr, diff --git a/src/core/events/types/common.py b/src/core/events/types/common.py index efb778c..1822f12 100644 --- a/src/core/events/types/common.py +++ b/src/core/events/types/common.py @@ -77,9 +77,7 @@ event_id_count_lock.release() class NewHostEvent(Event): def __init__(self, host, cloud=None): - event_id_count_lock.acquire() global event_id_count - event_id_count_lock.release() self.host = host self.cloud = cloud event_id_count_lock.acquire() diff --git a/src/modules/report/collector.py b/src/modules/report/collector.py index c816039..a26ef6b 100644 --- a/src/modules/report/collector.py +++ b/src/modules/report/collector.py @@ -48,12 +48,8 @@ class Collector(object): def execute(self): """function is called only when collecting data""" - services_lock.acquire() global services - services_lock.release() - vulnerabilities_lock.acquire() global vulnerabilities - vulnerabilities_lock.release() bases = self.event.__class__.__mro__ if Service in bases: services_lock.acquire() diff --git a/src/modules/report/plain.py b/src/modules/report/plain.py index c474656..d9ff4cd 100644 --- a/src/modules/report/plain.py +++ b/src/modules/report/plain.py @@ -4,7 +4,6 @@ from prettytable import ALL, PrettyTable from __main__ import config from collector import services, vulnerabilities,services_lock, vulnerabilities_lock -import threading EVIDENCE_PREVIEW = 40 MAX_TABLE_WIDTH = 20