Cryptojacking is the unauthorized use of computing power to mine cryptocurrency. In a Kubernetes environment, it can turn a compromised workload into a launch point for mining deployments, consuming cluster capacity and extending an intrusion beyond the original container. section 5.1.3
Investigate suspected cryptojacking as an intrusion chain, not only a resource-use anomaly:
- Correlate runtime alerts for a Kubernetes client executed inside a container with unexpected connections from that container to the Kubernetes API server. section 5.1.3
- Identify deployment commands and images associated with mining; a command creating web-front from miningcontainers/xmrig is direct evidence of a mining workload. section 5.1.3
- List pods across namespaces and inspect newly created or abnormal workloads, including repeated evicted pods bearing the deployment name. section 5.1.3
- Preserve findings and hand the case to incident response for containment and coordination, while providing detection and prevention recommendations. section 5.1.3
Container escape to mining deployment
A compromised portal container runs kubectl, contacts the API server, and creates a web-front deployment using an XMRig mining image. The resulting web-front pods across the cluster confirm the cryptojacking hypothesis alongside unauthorized Kubernetes access. section 5.1.3
Listing 5.20 Falco event 1
10:51:03.656093989: Warning Docker or kubernetes client executed in container (user=root user_loginuid=-1 k8s.ns=chapter5 k8s.pod=portal-5647ffc5d7-bd9pv container=b362c11601d6 parent=bash cmdline=kubectl create deployment web-front --image=miningcontainers/xmrig -n chapter5 image=docker.io/dvyakimov/vuln-wheezy:latest) k8s.ns=chapter5 k8s.pod=portal-5647ffc5d7-bd9pv container=b362c11601d6
This alert records the mining deployment command, the affected portal pod, and the mining image, linking container activity directly to cryptojacking. section 5.1.3
