aquasecurity / kube-hunter

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

Configuration is not initialized" when running kube-hunter in cluster #505

Closed aizada92 closed 2 years ago

aizada92 commented 2 years ago

What happened

I am getting this error: Trying to run inside a cluster ,created cronjob.yaml,and job that will run kube-hunter in a pod.Pod is not running and the logs showing "Configuration is not initialized" error:


  File "/usr/local/bin/kube-hunter", line 5, in <module>
    from kube_hunter.__main__ import main
  File "/usr/local/lib/python3.8/site-packages/kube_hunter/__main__.py", line 14, in <module>
    pm = initialize_plugin_manager()
  File "/usr/local/lib/python3.8/site-packages/kube_hunter/plugins/__init__.py", line 16, in initialize_plugin_manager
    pm.load_setuptools_entrypoints("kube_hunter")
  File "/usr/local/lib/python3.8/site-packages/pluggy/_manager.py", line 287, in load_setuptools_entrypoints
    plugin = ep.load()
  File "/usr/local/lib/python3.8/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/usr/local/lib/python3.8/site-packages/kube_hunter_arp_spoof.py", line 4, in <module>
    from kube_hunter.core.types import KubernetesCluster, ARPPoisoningTechnique
  File "/usr/local/lib/python3.8/site-packages/kube_hunter/core/__init__.py", line 3, in <module>
    from . import events
  File "/usr/local/lib/python3.8/site-packages/kube_hunter/core/events/__init__.py", line 2, in <module>
    from .handler import EventQueue, handler
  File "/usr/local/lib/python3.8/site-packages/kube_hunter/core/events/handler.py", line 369, in <module>
    config = get_config()
  File "/usr/local/lib/python3.8/site-packages/kube_hunter/conf/__init__.py", line 60, in get_config
    raise ValueError("Configuration is not initialized")
ValueError: Configuration is not initialized```
<!---
  Please explain in detail steps you took and what happened.
-->

### Expected behavior

<!---
  What should happen, ideally?
-->