SESSION ID: CSV-W02 Kubernetes Practical Attack and Defense Jay Beale CTO InGuardians @jaybeale and @inguardians #RSAC #RSAC What Will You See Today? • • • • • • • • Attack Surface of a Kubernetes Cluster Demonstration of a Full Attack Path on Kubernetes Defense Demonstration to Break the Attack Path Counter-Attack to Break the Defense Demo Demo of an Attack Leveraging Cloud APIs to Defeat Kubernetes Demonstration of Defenses for Cloud API Attacks Discussion of Additional Defenses Release of New Versions of Two Open Source Tools 2 What Can We Attack on a Master Node? • • • • • API Server: • Receives requests and and serves as first point of contact etcd Server • Stores the state of the cluster, alerts subscribed components Controller Manager • Runs control loops to bring state to parity with etcd Scheduler • Bin-packs containers onto nodes Kube-DNS • Gives every requested network endpoint a name 3 #RSAC What Can We Attack on a Worker Node? • Kubelet: Ties the node back to the master components • Container Runtime (e.g. Docker): Instruct the Linux kernel to create containers • Host Operating System • Filesystem • Network • Kernel • Workloads: Containers on the system • Kube-Proxy: forwards traffic to each pod in a load-balanced network service 4 #RSAC #RSAC Demonstration Attacking Bust-a-Kube CI/CD Scenario Summary: Attack Bust-a-Kube CI/CD Scenario We achieved remote code execution via the front-end application. We explored that application’s service account privileges. Attacked other applications on the cluster to move laterally. Gained remote code execution in a microservice container. Attacked and gained remote code execution in another microservice. Used the final container’s privileges to compromise the entire cluster. 6 #RSAC #RSAC Demonstration Defending the Bust-a-Kube CI/CD Scenario Summary: Defending the Bust-a-Kube CI/CD Scenario #RSAC We forced every non-control plane pod in the cluster to run with an AppArmor profile, via a pod security policy (PSP). We used a volume whitelist PSP to block an attack. Arms-race style: we ran a PVC-based attack to evade the PSP. Counter-defense: break the evasion with root capability limits. 8 #RSAC Demonstration Attacking a Kubernetes Cluster via its Public Cloud Provider Summary: Attacking Kubernetes via Its Cloud Provider Gain remote code execution in a front end application Access the metadata API to gain public cloud credentials Abuse the storage API to gain full administrative access to the cluster 10 #RSAC #RSAC Demonstration Defending the Cluster from Cloud API-based Attacks Summary: Defending K8S Against Cloud API Attacks #RSAC We deployed workload identity, which gives each pod in the cluster a lesser GCP service account than the nodes. – This mapping from Kubernetes service accounts to Cloud provider IAM accounts can happen via a number of cloud features and OS software. We configured the pod service accounts for little or no cloud API privilege. 12 #RSAC Additional Defenses (ToC) Seccomp System Call Whitelists Read-only Root Filesystems Service Meshes 13 Seccomp System Call Filtering • • Filtering system calls (syscalls) with seccomp has two purposes: • Restrict a compromised program's behavior to the system calls in its profile • Reduce the kernel’s attack surface Generate the syscall list with strace, then tell Docker or Kubernetes to confine the pod to the known list. 14 #RSAC #RSAC Read-only Root Filesystems • Microservices lend themselves to this design pattern • Shore up the need for writeable or persistent storage via PersistentVolumes 15 #RSAC Service Meshes • Strong centralized control over network flow and encryption • Accomplished via sidecar containers in every pod (Larger version of this on next slide) 16 #RSAC Service Mesh Example: Istio 17 #RSAC Peirates The attacks here have been manual. We develop an open source tool: Peirates. Let’s see some demos! You can use Peirates: https://www.inguardians.com/peirates/ You can help develop Peirates! https://github.com/inguardians/peirates 18 #RSAC Bust-a-Kube You can get the same cluster that we’ve used in this talk’s demos! Called Bust-a-Kube, it’s an open source project. We use Bust-a-Kube to teach and help people train themselves on Kubernetes attack and defense. Download it here: https://www.bustakube.com 19 Apply: Check Yourself Before Someone Wrecks Yourself Audit Your Authorization – Kubernetes RBAC – Clou

pdf文档 2020_USA20_CSV-W02_01_Kubernetes Practical Attack and Defense

安全研究库 > 国外研究报告 > 云安全和虚拟化 > 文档预览
23 页 0 下载 40 浏览 0 评论 0 收藏 3.0分
温馨提示:如果当前文档出现乱码或未能正常浏览,请先下载原文档进行浏览。
2020_USA20_CSV-W02_01_Kubernetes Practical Attack and Defense 第 1 页 2020_USA20_CSV-W02_01_Kubernetes Practical Attack and Defense 第 2 页 2020_USA20_CSV-W02_01_Kubernetes Practical Attack and Defense 第 3 页 2020_USA20_CSV-W02_01_Kubernetes Practical Attack and Defense 第 4 页 2020_USA20_CSV-W02_01_Kubernetes Practical Attack and Defense 第 5 页
下载文档到电脑,方便使用
还有 18 页可预览,继续阅读
本文档由 张玉竹2022-04-08 10:19:41上传分享
给文档打分
您好可以输入 255 个字符
安信天行文库的中文名是什么?( 答案:安信天行 )
评论列表
  • 暂时还没有评论,期待您的金玉良言