diff --git a/hardeneks/namespace_based/security/pod_security.py b/hardeneks/namespace_based/security/pod_security.py index 43f11c6..2165cbe 100644 --- a/hardeneks/namespace_based/security/pod_security.py +++ b/hardeneks/namespace_based/security/pod_security.py @@ -144,6 +144,8 @@ def check(self, namespaced_resources: NamespacedResources): offenders = [] for pod in namespaced_resources.pods: for container in pod.spec.containers: + if container.security_context is None: + offenders.append(pod) if ( container.security_context and not container.security_context.read_only_root_filesystem