cyberark / KubiScan

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

ConnectionRefusedError: [Errno 61] Connection refused #26

Closed secmesh closed 3 years ago

secmesh commented 3 years ago

Summary

Kubiscan used to work perfectly, but have been constantly, for the past few weeks, been getting "ConnectionRefusedError".

Steps to Reproduce

  1. Run any command, example kubiscan -rb

Expected Results

Get a list of all risky rolebindings

Actual Results (including error logs, if applicable)

Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 169, in _new_conn conn = connection.create_connection( File "/usr/local/lib/python3.9/site-packages/urllib3/util/connection.py", line 96, in create_connection raise err File "/usr/local/lib/python3.9/site-packages/urllib3/util/connection.py", line 86, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen httplib_response = self._make_request( File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 394, in _make_request conn.request(method, url, **httplib_request_kw) File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 234, in request super(HTTPConnection, self).request(method, url, body=body, headers=headers) File "/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1255, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1301, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1250, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1010, in _send_output self.send(msg) File "/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 950, in send self.connect() File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 200, in connect conn = self._new_conn() File "/usr/local/lib/python3.9/site-packages/urllib3/connection.py", line 181, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x109dcac70>: Failed to establish a new connection: [Errno 61] Connection refused

Reproducible

Version/Tag number

v1.5

Environment setup

  1. Cloud provider - AWS EKS
  2. Running Kubiscan locally on my laptop
  3. I have full RO permissions to the Clusters

Additional Information

Looks like kubiscan is not automatically picking up the configs from ~/.kube/config file. I tried adding the master IP and port and that didn't work either

secmesh commented 3 years ago

Looks like it was a local issue. Closing this Issue