From de764e192fcb459be81dff6ca7fe0c623187be20 Mon Sep 17 00:00:00 2001 From: Daniel Sagi Date: Fri, 26 Jun 2020 14:28:48 +0300 Subject: [PATCH] fixed wrong iteration on list when getting random pod --- kube_hunter/modules/hunting/kubelet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kube_hunter/modules/hunting/kubelet.py b/kube_hunter/modules/hunting/kubelet.py index ce4dd6b..d749dbe 100644 --- a/kube_hunter/modules/hunting/kubelet.py +++ b/kube_hunter/modules/hunting/kubelet.py @@ -425,7 +425,7 @@ class SecureKubeletPortHunter(Hunter): pod_data = next(filter(is_kubesystem_pod, pods_data), None) if pod_data: - container_data = next(pod_data["spec"]["containers"], None) + container_data = pod_data["spec"]["containers"][0] if container_data: return { "name": pod_data["metadata"]["name"],