aquasecurity / kube-hunter

Hunt for security weaknesses in Kubernetes clusters
Apache License 2.0
4.72k stars 581 forks source link

Log levels broken #292

Closed invidian closed 4 years ago

invidian commented 4 years ago

What happened

It seems that since fe3dba90d8cc6f947846e6a099a2562e7c2f88b1, --log DEBUG has no effect when running kube-hunter.

Steps to reproduce:

  1. Checkout repository
  2. docker run -it $(docker build . | tail -n 1 | cut -d" " -f3) --log DEBUG --pod

Reverting to fd4d79a8534fe3967162c18770a208871d8403c9 restores proper logging behavior.

Expected behavior

Debug messages should show up when --log DEBUG is specified.

iyehuda commented 4 years ago

Hi @invidian !

Thanks for reporting! This is surely a regression since #283. The bug origins in a call to logging.basicConfig being done before the configuration set. We should avoid using logging default logger and use a custom one to prevent unexpected behavior.