Back to all scenarios
Scenario #259
Security
K8s v1.19, Azure AKS
Malicious Container Image from Untrusted Source
A malicious container image from an untrusted source was deployed, leading to a security breach in the cluster.
Find this helpful?
What Happened
A container image from an untrusted registry was pulled and deployed. The image contained malicious code, which was executed once the container started. The attacker used this to gain unauthorized access to the cluster.
Diagnosis Steps
- 1Analyzed the container image and identified malicious scripts that were executed during the container startup.
- 2Detected abnormal activity in the cluster, including unauthorized API calls and data exfiltration.
Root Cause
The use of an untrusted container registry allowed the deployment of a malicious container image, which compromised the cluster.
Fix/Workaround
• Removed the malicious container image from the cluster and quarantined the affected pods.
• Scanned all images for known vulnerabilities before redeploying containers.
• Configured image admission controllers to only allow images from trusted registries.
Lessons Learned
Only use container images from trusted sources, and always scan images for vulnerabilities before deployment.
How to Avoid
- 1Use image signing and validation tools to ensure only trusted images are deployed.
- 2Implement an image scanning process in the CI/CD pipeline to detect vulnerabilities and malware before deployment.