Skip to main content

MITRE ATT&CK

๐Ÿ“ TL ; DRโ€‹

Initial AccessExecutionPersistencePrivilege EscalationDefense EvasionCredential AccessDiscoveryLateral MovementCollectionImpact
Using Cloud credentialsExec into containerBackdoor containerPrivileged containerClear container logsList K8S secretsAccess the K8S API serverAccess cloud resourcesImages from a private registryData Destruction
Compromised images in registrybash/cmd inside containerWritable hostPath mountCluster-admin bindingDelete K8S eventsMount service principalAccess Kubelet APIContainer service accountResource Hijacking
Kubeconfig fileNew containerKubernetes CronJobhostPath mountPod / container name similarityAccess container service accountNetwork mappingCluster internal networkingDenial of service
Application vulnerabilityApplication exploit (RCE)Malicious admission controllerAccess cloud resourcesConnect from Proxy serverApplications credentials in configuration filesAccess Kubernetes dashboardApplications credentials in configuration files
Exposed DashboardSSH server running inside containerAccess managed identity credentialInstance Metadata APIWritable volume mounts on the host
Exposed sensitive interfacesSidecar injectionMalicious admission controllerAccess Kubernetes dashboard
Access tiller endpoint
CoreDNS poisoning
ARP poisoning and IP spoofing

The MITRE ATT&CKยฎ (Adversarial Tactics, Techniques and Common Knowledge) framework is a globally-accessible knowledge base of adversary tactics and techniques based on real-world observations. In this framework, here we cover the Tactics, Techniques, and Procedures (TTPs) to map Kubernetes Security risks and also the related Kubernetes Goat scenarios.

๐Ÿ”ฅ Tactic - Initial Accessโ€‹

The initial access tactic consists of techniques that are used for gaining access to the resource. In containerized environments, those techniques enable first access to the cluster. This access can be achieved directly via the cluster management layer or, alternatively, by gaining access to a malicious or vulnerable resource that is deployed on the cluster.

๐Ÿงฐ Techniques๐Ÿ Kubernetes Goat Scenarios
Using cloud credentials
Compromised image in registryโŽˆ Attacking private registry
Kubeconfig file
Application vulnerabilityโŽˆ SSRF in the Kubernetes (K8S) world โŽˆ DIND (docker-in-docker) exploitation
Exposed sensitive interfacesโŽˆ NodePort exposed services

๐Ÿ”ฅ Tactic - Executionโ€‹

The execution tactic consists of techniques that are used by attackers to run their code inside a cluster.

๐Ÿงฐ Techniques๐Ÿ Kubernetes Goat Scenarios
Exec into containerโŽˆ Gaining environment information
bash/cmd inside containerโŽˆ Gaining environment information
New containerโŽˆ Hacker container preview
Application exploit (RCE)โŽˆ DIND (docker-in-docker) exploitation
SSH server running inside container
Sidecar injection

๐Ÿ”ฅ Tactic - Persistenceโ€‹

The persistence tactic consists of techniques that are used by attackers to keep access to the cluster in case their initial foothold is lost.

๐Ÿงฐ Techniques๐Ÿ Kubernetes Goat Scenarios
Backdoor containerโŽˆ Analyzing crypto miner container
Writable hostPath mountโŽˆ Container escape to the host system
Kubernetes CronJobโŽˆ Hidden in layers
Malicious admission controller
Container service accountโŽˆ Helm v2 tiller to PwN the cluster - [Deprecated] โŽˆ RBAC least privileges misconfiguration
Static pods

๐Ÿ”ฅ Tactic - Privilege Escalationโ€‹

The privilege escalation tactic consists of techniques that are used by attackers to get higher privileges in the environment than those they currently have. In containerized environments, this can include getting access to the node from a container, gaining higher privileges in the cluster, and even getting access to the cloud resources.

๐Ÿงฐ Techniques๐Ÿ Kubernetes Goat Scenarios
Privileged containerโŽˆ Container escape to the host system
Cluster-admin bindingโŽˆ Helm v2 tiller to PwN the cluster - [Deprecated]
hostPath mountโŽˆ Container escape to the host system
Access cloud resourcesโŽˆ SSRF in the Kubernetes (K8S) world

๐Ÿ”ฅ Tactic - Defense Evasionโ€‹

The defense evasion tactic consists of techniques that are used by attackers to avoid detection and hide their activity.

๐Ÿงฐ Techniques๐Ÿ Kubernetes Goat Scenarios
Clear container logsโŽˆ Container escape to the host system
Delete K8S eventsโŽˆ Helm v2 tiller to PwN the cluster - [Deprecated]
Pod / container name similarityโŽˆ Hacker container preview
Connect from proxy server

๐Ÿ”ฅ Tactic - Credential Accessโ€‹

The credential access tactic consists of techniques that are used by attackers to steal credentials. In containerized environments, this includes credentials of the running application, identities, secrets stored in the cluster, or cloud credentials.

๐Ÿงฐ Techniques๐Ÿ Kubernetes Goat Scenarios
List K8S secretsโŽˆ RBAC least privileges misconfiguration
Mount service principal
Container service accountโŽˆ RBAC least privileges misconfiguration
Application credentials in configuration files
Access managed identity credentials
Malicious admission controller

๐Ÿ”ฅ Tactic - Discoveryโ€‹

The discovery tactic consists of techniques that are used by attackers to explore the environment to which they gained access. This exploration helps the attackers to perform lateral movement and gain access to additional resources.

๐Ÿงฐ Techniques๐Ÿ Kubernetes Goat Scenarios
Access Kubernetes API serverโŽˆ KubeAudit - Audit Kubernetes clusters
Access Kubelet APIโŽˆ Container escape to the host system
Network mappingโŽˆ Kubernetes namespaces bypass
Exposed sensitive interfacesโŽˆ Kubernetes namespaces bypass โŽˆ NodePort exposed services
Instance Metadata APIโŽˆ SSRF in the Kubernetes (K8S) world

๐Ÿ”ฅ Tactic - Lateral Movementโ€‹

The lateral movement tactic consists of techniques that are used by attackers to move through the victimโ€™s environment. In containerized environments, this includes gaining access to various resources in the cluster from a given access to one container, gaining access to the underlying node from a container, or gaining access to the cloud environment.

๐Ÿงฐ Techniques๐Ÿ Kubernetes Goat Scenarios
Access cloud resourcesโŽˆ SSRF in the Kubernetes (K8S) world
Container service account
Cluster internal networkingโŽˆ Kubernetes namespaces bypass
Application credentials in configuration files
Writable hostPath mountโŽˆ Container escape to the host system
CoreDNS poisoning
ARP poisoning and IP spoofingโŽˆ Kubernetes namespaces bypass

๐Ÿ”ฅ Tactic - Collectionโ€‹

Collection in Kubernetes consists of techniques that are used by attackers to collect data from the cluster or through using the cluster.

๐Ÿงฐ Techniques๐Ÿ Kubernetes Goat Scenarios
Images from a private registryโŽˆ Attacking private registry
Collecting data from podโŽˆ Gaining environment information

๐Ÿ”ฅ Tactic - Impactโ€‹

The Impact tactic consists of techniques that are used by attackers to destroy, abuse, or disrupt the normal behavior of the environment.

๐Ÿงฐ Techniques๐Ÿ Kubernetes Goat Scenarios
Data destructionโŽˆ DIND (docker-in-docker) exploitation โŽˆ Container escape to the host system
Resource hijackingโŽˆ DoS the Memory/CPU resources
Denial of serviceโŽˆ DoS the Memory/CPU resources

๐Ÿ”– Referencesโ€‹