cyberark / KubiScan

A tool to scan Kubernetes cluster for risky permissions
GNU General Public License v3.0
1.31k stars 130 forks source link

Fixed bug with missing configuration object when using token #30

Closed 2niknatan closed 2 years ago

2niknatan commented 2 years ago

Desired Outcome

When calling KubiScan like that:

kubiscan -ho 192.168.58.2:8443 -t /home/natan/token -rs

Receiving multiple errors such as:

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='192.168.58.2', port=8443): Max retries exceeded with url: /apis/rbac.authorization.k8s.io/v1/roles (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f9f8c7826b0>: Failed to establish a new connection: [Errno 113] No route to host'))

Implemented Changes

The problem was that the Configuration object was with default fields although it was initialized in the BearerTokenLoader(..).load_and_set() function.
We fixed it by returning the configuration to ApiClientTemp().

Changelog

Behavior