aquasecurity / kube-hunter

Hunt for security weaknesses in Kubernetes clusters
Apache License 2.0
4.75k stars 585 forks source link

Split command line and configuration #341

Closed iyehuda closed 4 years ago

iyehuda commented 4 years ago

What would you like to be added

Define a Config data class with all configuration values. This class should be consumed by hunters and every other usage. Make the main function instantiate the Config object with values parsed from command line.

Why is this needed

Currently the configuration object is a argparse.Namespace object, which tightly couples configration handling to argparse. Another problem is catching bugs like https://github.com/aquasecurity/kube-hunter/issues/336 when referencing invalid configuration properties. Defining a class for it will help us catch such bugs in linting.