Red Teaming Kubernetes
From App-Level CVEs to Full Cluster Takeover
1
Lenin Alevski
About Me
Agenda
What Is Kubernetes Anyways?
Kubernetes Application
Kubernetes Components
Control Plane Components
Node Components
Kubernetes Threat Model: If An Attacker Controls ...
Control plane nodes: Attacker controls your cluster. They can modify, access and destroy everything
Pod / Container: Attacker controls application and may be able to escape and attack the node
Kubelet: Attacker controls running pods
Worker nodes: Attacker controls running pods. They can attack master nodes
OWASP Kubernetes Risks Top (2022)
Kubernetes Most Common Attack Techniques
Threat Matrix For Kubernetes (2022)
Initial Access
Kubeconfig File - Hunting For .kube/config Files
Application Vulnerabilities
A01:2021 | Broken Access Control |
A02:2021 | Cryptographic Failures |
A03:2021 | Injection |
A04:2021 | Insecure Design |
A05:2021 | Security Misconfiguration |
A06:2021 | Vulnerable and Outdated Components |
A07:2021 | Identification and Authentication Failures |
A08:2021 | Software and Data Integrity Failures |
A09:2021 | Security Logging and Monitoring Failures |
A10:2021 | Server-Side Request Forgery |
Application Vulnerabilities
Execution
Exec Into The Container
Credential Access
Access managed identity credential
Discovery
Kubernetes Service
Lateral Movement
Lateral Movement and Credential Theft in Kubernetes
Privilege Escalation
Privileged Container
A Container That Doesn't Contain Anything
Cluster-Admin Binding
Hands-on 🙌💻🏴☠️
Ingress-nightmare Lab
https://github.com/Alevsk/dvka/tree/master/workshop/labs/ingress-nightmare
Escenario:
Thanks