Skip to content

Commit

Permalink
Fixed issue aquasecurity#499 evidence field to display all affected p…
Browse files Browse the repository at this point in the history
…ods and containers
  • Loading branch information
Zeeshan-szf committed Oct 1, 2023
1 parent ff9f2c5 commit 56c7bfc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions kube_hunter/modules/hunting/kubelet.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ def __init__(self, exposed_existing_privileged_containers):


class PrivilegedContainers(Vulnerability, Event):
"""A Privileged container exist on a node
could expose the node/cluster to unwanted root operations"""
"""A Privileged container exists on a node
and could expose the node/cluster to unwanted root operations"""

def __init__(self, containers):
Vulnerability.__init__(
Expand All @@ -185,7 +185,9 @@ def __init__(self, containers):
vid="KHV044",
)
self.containers = containers
self.evidence = f"pod: {containers[0][0]}, " f"container: {containers[0][1]}, " f"count: {len(containers)}"
evidence_list = [f"pod: {pod}, container: {container}" for pod, container in containers]
evidence = ", ".join(evidence_list)
self.evidence = f"{evidence}, count: {len(containers)}"


class ExposedSystemLogs(Vulnerability, Event):
Expand Down

0 comments on commit 56c7bfc

Please sign in to comment.