Files
kube-hunter/modules/discovery/proxy.py
daniel_sagi faa7571127 1. Added an --active flag, to allow optional "Proof" result, which will do an active hunting of a found vulnerability
2. Added a --remote flag to specify remote clusters/machines for hunting.
3. Improved a bit of the architecture, (Services)

Note:
The reporter module, will gather vulnerabilities before their active hunting will start.
This is not an issue, as we can access all of the attributes of the event directly from the active hunter (event.previous), which we will proccess on the end in the report
2018-06-10 19:34:12 +03:00

29 lines
781 B
Python

import logging
from collections import defaultdict
from ..types import Hunter
from requests import get
from ..events import handler
from ..events.types import Service, Event, OpenPortEvent
class KubeProxyEvent(Event, Service):
"""proxies from a localhost address to the Kubernetes apiserver"""
def __init__(self):
Service.__init__(self, name="Kubernetes Proxy")
@handler.subscribe(OpenPortEvent, predicate=lambda x: x.port == 8001)
class KubeProxy(Hunter):
def __init__(self, event):
self.event = event
self.host = event.host
self.port = event.port or 8001
@property
def accesible(self):
return True
def execute(self):
if self.accesible:
self.publish_event(KubeProxyEvent())