kube-hunter
kube-hunter copied to clipboard
Enhancing subscribe mechanism
The hunter subscribe mechanism currently support subscribing to one or multiple event. The problem arises when for example we want to run a hunter only if two specific events were published.
One thing we could do is add a new 'queue' dictionary, that will store the 'multiple subscriptions', and on each event that is being published that resides in this queue_dict, adding the event object to the queue. In the case that the list of event objects corresponds to the requirement of the publish, the events will be concatenated, and the hunter hook will execute. This logic would happen each time on the publish_event() method.