aquasecurity / kube-hunter

Hunt for security weaknesses in Kubernetes clusters
Apache License 2.0
4.66k stars 578 forks source link

Split hunter definition and registration #339

Open iyehuda opened 4 years ago

iyehuda commented 4 years ago

What would you like to be added

Separate the logic of new hunter definition and their registration to an event handler. The current implementation of subscribing new hunters is being made through handler - a global instance of EventQueue object. In the moment we define a hunter class, the handler singleton executes code that registers it into some data structures. This practice is bad since it is hard to test, it depends in a single global instance and it makes all hunters depend on it.

We can split it:

Why is this needed

iyehuda commented 4 years ago

This is a major one so I'd like to get your opinion @lizrice @itaysk