mirror of
https://github.com/aquasecurity/kube-hunter.git
synced 2026-08-23 22:26:23 +00:00
Merge pull request #135 from aquasecurity/fix_get_random_pod
Fixed not finding open debug handlers
This commit is contained in:
@@ -299,12 +299,14 @@ class SecureKubeletPortHunter(Hunter):
|
||||
if not pod_data:
|
||||
pod_data = next((pod_data for pod_data in pods_data if is_kubesystem_pod(pod_data)), None)
|
||||
|
||||
container_data = (container_data for container_data in pod_data["spec"]["containers"]).next()
|
||||
return {
|
||||
"name": pod_data["metadata"]["name"],
|
||||
"container": container_data["name"],
|
||||
"namespace": pod_data["metadata"]["namespace"]
|
||||
}
|
||||
if pod_data:
|
||||
container_data = next((container_data for container_data in pod_data["spec"]["containers"]), None)
|
||||
if container_data:
|
||||
return {
|
||||
"name": pod_data["metadata"]["name"],
|
||||
"container": container_data["name"],
|
||||
"namespace": pod_data["metadata"]["namespace"]
|
||||
}
|
||||
|
||||
@handler.subscribe(ExposedRunHandler)
|
||||
class ProveRunHandler(ActiveHunter):
|
||||
|
||||
Reference in New Issue
Block a user