Skip to content

Commit

Permalink
Merge pull request #57 from za/issue-45-pod-security-read-only
Browse files Browse the repository at this point in the history
Added to offenders list if there's no declaration on read only root filesystem config
  • Loading branch information
dorukozturk authored Oct 15, 2024
2 parents 164b51c + 8f53799 commit ddbef9a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hardeneks/namespace_based/security/pod_security.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ddbef9a

Please sign in to comment.