We recently published a blog post - the first of a nine-part series - on the Kubernetes attack matrix and the representative threat vectors that organizations must consider to adequately secure their Kubernetes environments. The tactics and techniques that comprise the matrix are partly based on observations of attacks occurring “in the wild.” This post takes a closer look at one of the most prevalent attacks on container environments throughout the last several years: cryptojacking Kubernetes clusters.
Real-world Cryptojacking Attacks
Cryptojacking describes the scenario where an attacker gains access to and hijacks compute resources to mine cryptocurrency. Some real-world examples of cryptojacking attacks in Kubernetes environments that have been disclosed include the following:
- A Kubernetes Dashboard was configured insecurely in Tesla’s cloud environment, allowing attackers to gain access to cloud account credentials and mine cryptocurrency.
- Backdoored container images that contained malicious code for mining cryptocurrency were publicly available on Docker Hub and downloaded more than five million times.
- A cryptojacking worm named Graboid was observed to spread to more than 2,000 Docker hosts using containers in the community version of the Docker Engine.
- Microsoft Azure disclosed a large-scale campaign against Kubernetes clusters that abused exposed Kubernetes dashboards to carry out cryptomining attacks and was notable for its scale.
- Kubeflow, a framework for running machine learning (ML) workloads on Kubernetes, was discovered to serve as an access vector for cryptojacking attacks.
- As recently as last week, additional malicious images intended to mine cryptocurrency were publicly hosted on Docker Hub and downloaded more than two millions times.
These examples share several notable patterns. First, several of these attacks arose from downloading compromised images that were accessible from public repositories. In examples 2, 4, 5, and 6, the images contained a miner for the Monero cryptocurrency, and in at least one instance it was likely that malicious actors were actively scanning the Internet for exposed Docker APIs that would enable them to use the images to launch containers on hosts.
Second, at least two attack campaigns involved the Kubernetes Dashboard being exploited to gain access to clusters to mine cryptocurrency. In example 4, attackers used the Dashboard’s service account to launch the malicious containers. And similarly in example 5, these cryptojacking attacks stemmed from misconfigured Kubeflow Dashboards, whose incoming traffic is managed by the Istio ingress gateway, that were exposed directly to the Internet.
Third, these examples demonstrate the ability of attackers to move laterally within environments. In both examples 3 and 4, malicious containers ended up being run on thousands of Docker hosts and dozens of Kubernetes clusters.
Cryptojacking: Tactics and Techniques
The Kubernetes attack matrix provides a helpful reference when evaluating the tactics and techniques that comprise these various attacks. Specifically, we can see that most cryptopjacking attacks involve some combination of the following techniques:
- Initial Access
- Compromised images in registry
- Exposed Dashboard
- Execution
- New container
- Persistence
- Backdoor container
- Discovery
- Access Kubernetes Dashboard
- Lateral Movement
- Container service account
- Access Kubernetes Dashboard
- Impact
- Resource Hijacking
Mitigating Cryptomining Attacks in Kubernetes
This breakdown serves as a basis to formulate a blueprint for mitigating against these cryptojacking attacks. Organizations should implement the following key protections:
- Ensure images are secure
- Avoid risks associated with the Kubernetes Dashboard risks
- Leverage Kubernetes Role-based Access Control (RBAC) to ensure least privilege for service accounts
To start, organizations should set controls on the images that can be used to run containers, which may include allowing images only from trusted registries to be used, restricting images from public registries such as Docker Hub, configuring access controls on trusted and/or private registries, and requiring developers to use only trusted base images when building containerized applications. For more details, read our blog post on image security.
Next, organizations should take steps to mitigate threat vectors arising from the Kubernetes Dashboard. If the Dashboard is not needed, administrators should ensure that it is deleted from the environment entirely or disabled (which most Kubernetes platforms now do by default). If the Dashboard is needed and deployed, then ensure it has no elevated service account privileges, remove any bindings to its service account, and block ingress traffic using Kubernetes Network Policies. Check out our blog post on Kubernetes Network Policies for more details.
Organizations can then also take steps to prevent malicious containers from being launched by configuring Kubernetes Role-Based Access Control (RBAC) to restrict permissions to create pods and/or abstractions (such as Deployments, DaemonSets, ReplicaSets, and others) that also create pods. Administrators should adopt a least-privilege model for service accounts and their role bindings, as described in this blog post on mistakes to avoid when using Kubernetes RBAC.
How StackRox Secures Organizations From Cryptojacking
The StackRox Kubernetes Security Platform automatically protects organizations from cryptojacking attacks with several built-in capabilities. It enforces policies on images that can be used to launch containers and identifies issues, including vulnerabilities and problematic packages, in image layers separate from the underlying base operating system (OS) image.
StackRox also provides a built-in policy that alerts you when the Kubernetes Dashboard is deployed.
In addition, StackRox monitors RBAC privileges on service accounts and can identify whether elevated privileges have been granted.
저자 소개
Wei Lien Dang is Senior Director of Product and Marketing for Red Hat Advanced Cluster Security for Kubernetes. He was a co-founder at StackRox, which was acquired by Red Hat. Before his time at StackRox, Dang was Head of Product at CoreOS and held senior product management roles for security and cloud infrastructure at Amazon Web Services, Splunk, and Bracket Computing. He was also part of the investment team at the venture capital firm Andreessen Horowitz.
Dang holds an MBA with high distinction from Harvard Business School and a BS in Applied Physics with honors from Caltech.
유사한 검색 결과
채널별 검색
오토메이션
기술, 팀, 인프라를 위한 IT 자동화 최신 동향
인공지능
고객이 어디서나 AI 워크로드를 실행할 수 있도록 지원하는 플랫폼 업데이트
오픈 하이브리드 클라우드
하이브리드 클라우드로 더욱 유연한 미래를 구축하는 방법을 알아보세요
보안
환경과 기술 전반에 걸쳐 리스크를 감소하는 방법에 대한 최신 정보
엣지 컴퓨팅
엣지에서의 운영을 단순화하는 플랫폼 업데이트
인프라
세계적으로 인정받은 기업용 Linux 플랫폼에 대한 최신 정보
애플리케이션
복잡한 애플리케이션에 대한 솔루션 더 보기
오리지널 쇼
엔터프라이즈 기술 분야의 제작자와 리더가 전하는 흥미로운 스토리
제품
- Red Hat Enterprise Linux
- Red Hat OpenShift Enterprise
- Red Hat Ansible Automation Platform
- 클라우드 서비스
- 모든 제품 보기
툴
체험, 구매 & 영업
커뮤니케이션
Red Hat 소개
Red Hat은 Linux, 클라우드, 컨테이너, 쿠버네티스 등을 포함한 글로벌 엔터프라이즈 오픈소스 솔루션 공급업체입니다. Red Hat은 코어 데이터센터에서 네트워크 엣지에 이르기까지 다양한 플랫폼과 환경에서 기업의 업무 편의성을 높여 주는 강화된 기능의 솔루션을 제공합니다.