mirror of
https://github.com/aquasecurity/kube-hunter.git
synced 2026-05-13 12:47:20 +00:00
added requirements.txt
This commit is contained in:
@@ -61,7 +61,7 @@ def print_results():
|
||||
vuln_table.padding_width=1
|
||||
vuln_table.header_style="upper"
|
||||
for vuln in vulnerabilities:
|
||||
row = ["{}:{}".format(vuln.host, vuln.port), vuln.component.name, vuln.get_name(), vuln.explain()]
|
||||
row = ["{}:{}".format(vuln.host, vuln.port) if vuln.host else "", vuln.component.name, vuln.get_name(), vuln.explain()]
|
||||
if config.active:
|
||||
evidence = str(vuln.evidence)[:EVIDENCE_PREVIEW] + "..." if len(str(vuln.evidence)) > EVIDENCE_PREVIEW else str(vuln.evidence)
|
||||
row.append(evidence)
|
||||
|
||||
@@ -3,4 +3,5 @@ netifaces
|
||||
enum34
|
||||
scapy
|
||||
requests
|
||||
PrettyTable
|
||||
PrettyTable
|
||||
urllib3
|
||||
@@ -4,6 +4,7 @@ from collections import defaultdict
|
||||
from Queue import Queue
|
||||
from threading import Lock, Thread
|
||||
|
||||
import time
|
||||
from __main__ import config
|
||||
from ..types import ActiveHunter
|
||||
|
||||
@@ -23,6 +24,10 @@ class EventQueue(Queue, object):
|
||||
t.daemon = True
|
||||
t.start()
|
||||
self.workers.append(t)
|
||||
t = Thread(target=self.notifier)
|
||||
t.daemon = True
|
||||
t.start()
|
||||
|
||||
|
||||
# decorator wrapping for easy subscription
|
||||
def subscribe(self, event, hook=None, predicate=None):
|
||||
@@ -60,6 +65,12 @@ class EventQueue(Queue, object):
|
||||
self.task_done()
|
||||
logging.debug("closing thread...")
|
||||
|
||||
def notifier(self):
|
||||
time.sleep(2)
|
||||
while self.unfinished_tasks > 0:
|
||||
logging.debug("{} tasks left".format(self.unfinished_tasks))
|
||||
time.sleep(3)
|
||||
|
||||
# stops execution of all daemons
|
||||
def free(self):
|
||||
self.running = False
|
||||
|
||||
@@ -18,6 +18,7 @@ from ..hunting.aks import Azure
|
||||
|
||||
|
||||
class AzureMetadataApi(Vulnerability, Event):
|
||||
"""Access to Azure Metadata API exposes sensitive information about the machines associated with the cluster"""
|
||||
def __init__(self, cidr):
|
||||
Vulnerability.__init__(self, Azure, "Azure Metadata Exposure")
|
||||
self.cidr = cidr
|
||||
|
||||
@@ -70,4 +70,4 @@ class ProveAzureSpnExposure(ActiveHunter):
|
||||
self.event.aadClientId = subscription["aadClientId"]
|
||||
self.event.aadClientSecret = subscription["aadClientSecret"]
|
||||
self.event.tenantId = subscription["tenantId"]
|
||||
self.event.evidence = "id: {}".format(self.event.subscriptionId)
|
||||
self.event.evidence = "subscription: {}".format(self.event.subscriptionId)
|
||||
|
||||
Reference in New Issue
Block a user