mirror of
https://github.com/aquasecurity/kube-hunter.git
synced 2026-05-10 19:26:49 +00:00
2. Started adding kubelet scanning. 3. Changed events architecture. All events are inheriting from "Event" class. when instantiating and defining a new event class, attributes other than what is important for that perticular event are not needed. the event handler will be stacking the events, so that each event will have all the attributes of its successors. This proccess is invisible to the developer, but needs to be acknowledged. *note: from now on, all executors needs to set self.event to given arg on init* Example (pseudo): @subscribe(NewHostEvent) def PortScan(event): publish(OpenPortEvent(port="8080")) @subscribe(OpenPortEvent) def print(event): print(event.host) publish(NewHostEvent(host="0.0.0.0")) >> output: 0.0.0.0 the print function recieves an open port event. even though when publishing the OpenPortEvent we did not specify a host, the print function can access the "host" attribute, as the OpenPortEvent successor was NewHostEvent. if "host" was not defined on the succesors, it is "None"