Back to all scenarios
Scenario #262
Security
Kubernetes v1.22, EKS
Privileged Containers Without Security Context
Containers were running with elevated privileges without defined security contexts, increasing the risk of host compromise.
Find this helpful?
What Happened
Several pods were deployed with the privileged: true flag but lacked defined security contexts. This configuration allowed containers to perform operations that could compromise the host system.
Diagnosis Steps
- 1Inspected pod specifications for security context configurations.
- 2Identified containers running with elevated privileges.
- 3Assessed potential risks associated with these configurations.
Root Cause
Absence of defined security contexts for privileged containers.
Fix/Workaround
• Defined appropriate security contexts for all containers.
• Removed unnecessary privileged access where possible.
• Implemented Pod Security Policies to enforce security standards.
Lessons Learned
Clearly define security contexts for all containers, especially those requiring elevated privileges.
How to Avoid
- 1Implement and enforce Pod Security Policies.
- 2Regularly review and update security contexts for all deployments.