Files
kube-hunter/modules/discovery/proxy.py
daniel_sagi 36e87807e6 1. completely transferred all event types to their corresponding module
2. started working on results table.
3. *added convention* from now on, every vulnerability/service event, should have a __doc__ that describes them. notice the new get_name(), component, and explain() attributes that needs to be implemented as well.
2018-06-10 16:43:05 +03:00

28 lines
710 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):
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())