Slide 1

Slide 1 text

TRACK: DEVSECOPS NOVEMBER 10, 2022 Madhu Akula, Pragmatic Security Leader Scaling Kubernetes Security with Kubernetes Goat

Slide 2

Slide 2 text

TRACK: DEVSECOPS Welcome to Amazing All Day DevOps DevSecOps Track 2022 ๐ŸŽ‰

Slide 3

Slide 3 text

TRACK: DEVSECOPS ๐Ÿ™ About - Madhu Akula โ— Founder, Advisor & Pragmatic Security Leader โ— Creator of Kubernetes Goat, Hacker Container, tools.tldr.run, many other OSS projects. โ— Speaker & Trainer at Blackhat, DEFCON, GitHub, USENIX, OWASP, All Day DevOps, SANS, DevSecCon, CNCF, c0c0n, Nullcon, SACON, null, many others. โ— Author of Security Automation with Ansible2, OWASP KSTG, whitepapers, etc. โ— Technical reviewer (multiple books) & Review board member of multiple conferences, organizations, communities, etc. โ— Found security vulnerabilities in 200+ organizations and products including Google, Microsoft, AT&T, Adobe, WordPress, Ntop, etc. โ— Certi๏ฌed Kubernetes (CKA/CKS), O๏ฌ€ensive Security Certi๏ฌed Professional (OSCP), etc. โ— Never ending learner!

Slide 4

Slide 4 text

TRACK: DEVSECOPS Why Kubernetes Security? https://www.microsoft.com/security/blog/2021/03/23/secure-containerized-environments-with-updated-threat-matrix-for-kubernetes/ @madhuakula

Slide 5

Slide 5 text

TRACK: DEVSECOPS Why Kubernetes Security? https://github.com/cncf/๏ฌnancial-user-group/blob/master/projects/k8s-threat-model/AttackTrees/AccessSensitiveData.md @madhuakula

Slide 6

Slide 6 text

TRACK: DEVSECOPS What is Kubernetes Goat ๐Ÿ Kubernetes Goat is an interactive Kubernetes security learning playground. Intentionally vulnerable by design scenarios to showcase the common miscon๏ฌgurations, real-world vulnerabilities, and security issues in Kubernetes clusters, containers, and cloud native environments. @madhuakula

Slide 7

Slide 7 text

TRACK: DEVSECOPS Kubernetes Goat has intentionally created vulnerabilities, applications, and con๏ฌgurations to attack and gain access to your cluster and workloads. Please DO NOT run alongside your production environments and infrastructure. So we highly recommend running this in a safe and isolated environment. Kubernetes Goat is used for educational purposes only, do not test or apply these attacks on any systems without permission. Kubernetes Goat comes with absolutely no warranties, by using it you take full responsibility for all the outcomes. ๐Ÿšจ Disclaimer @madhuakula

Slide 8

Slide 8 text

TRACK: DEVSECOPS Can I use from Kubernetes Goat ๐Ÿค” Kubernetes Goat is intended for a variety of audiences and end-users. Which includes hackers, attackers, defenders, developers, architects, DevOps teams, engineers, researchers, products, vendors, and anyone interested in learning about Kubernetes Security. Below are some of the very high-level categories of audience ๐Ÿ’ฅ Attackers & Red Teams ๐Ÿ›ก Defenders & Blue Teams ๐Ÿงฐ Products & Vendors ๐Ÿ” Developers & DevOps Teams ๐Ÿ’ก Interested in Kubernetes Security @madhuakula

Slide 9

Slide 9 text

TRACK: DEVSECOPS ๐Ÿ”ฅ Kubernetes Goat Audience @madhuakula

Slide 10

Slide 10 text

TRACK: DEVSECOPS 1. Sensitive keys in codebases 2. DIND (docker-in-docker) exploitation 3. SSRF in the Kubernetes (K8S) world 4. Container escape to the host system 5. Docker CIS benchmarks analysis 6. Kubernetes CIS benchmarks analysis 7. Attacking private registry 8. NodePort exposed services 9. Helm v2 tiller to PwN the cluster - [Deprecated] 10. Analyzing crypto miner container 11. Kubernetes namesapces bypass 12. Gaining environment information 13. DoS the memory/cpu resources 14. Hacker Container preview 15. Hidden in layers 16. RBAC Least Privileges Miscon๏ฌguration 17. KubeAudit - Audit Kubernetes Clusters 18. Sysdig Falco - Runtime Security Monitoring & Detection 19. Popeye - A Kubernetes Cluster Sanitizer 20. Secure network boundaries using NSP Scenarios in Kubernetes Goat ๐Ÿš€ 15+ more scenarios releasing soonโ€ฆ โค Scenarios going to be updated with defenders, developers, tools & vendor sections for reach scenario ๐Ÿฅณ @madhuakula

Slide 11

Slide 11 text

TRACK: DEVSECOPS ๐Ÿš€ Katacoda Playground - Free Online in-browser โ˜ธ Vanilla Kubernetes Cluster โ˜ AWS Kubernetes (EKS) โ˜ GCP Kubernetes (GKE) โ˜ Azure Kubernetes (AKS) โ˜ธ Kubernetes IN Docker (KiND) โ˜ธ Lightweight Kubernetes (K3S) - Coming soon ๐Ÿ‘€ โ˜ธ Digital Ocean, Vagrant, Many othersโ€ฆ โš™ How can I setup Kubernetes Goat @madhuakula

Slide 12

Slide 12 text

TRACK: DEVSECOPS โ— Make sure you have Kubernetes cluster with cluster-admin privileges. Also kubectl and helm installed in your system before running the following commands to setup the Kubernetes Goat โŽˆ Setting up in your Kubernetes Cluster $ git clone https://github.com/madhuakula/kubernetes-goat.git $ cd kubernetes-goat $ bash setup-kubernetes-goat.sh $ bash access-kubernetes-goat.sh โ— Now you can access the Kubernetes Goat by navigating to http://127.0.0.1:1234 @madhuakula

Slide 13

Slide 13 text

TRACK: DEVSECOPS โšก Get Started with Kubernetes Goat ๐Ÿ @madhuakula

Slide 14

Slide 14 text

TRACK: DEVSECOPS โšก Get Started with Kubernetes Goat ๐Ÿ @madhuakula

Slide 15

Slide 15 text

TRACK: DEVSECOPS โšก Get Started with Kubernetes Goat ๐Ÿ @madhuakula https://madhuakula.com/kubernetes-goat

Slide 16

Slide 16 text

TRACK: DEVSECOPS โ˜ธ ๐Ÿ Demo Time ๐Ÿคž ๐Ÿ™ @madhuakula

Slide 17

Slide 17 text

TRACK: DEVSECOPS @madhuakula Why do we need to scale Kubernetes Security? โ— Nature of immutable infrastructure โ— Matching the speed of containers, infrastructure with security โ— Frequency of deployments and workloads โ— Size of the teams, deployments from both dev, ops, engineering and security โ— How frequently and repetitively we ๏ฌx certain issues โ— Education, knowledge and skill gap โ— Maturity of the security and the alignment with stakeholders โ— Many othersโ€ฆ

Slide 18

Slide 18 text

TRACK: DEVSECOPS @madhuakula What should we do & how should we go about it? โ— I think there is no single answer, approach here โ— Always look at the core problem and root cause and ๏ฌx at that layer โ— Try to be self-service model by providing patterns in an actionable way โ— Be an helping hand for DevOps, SRE and Engineering teams rather pointing just issues โ—‹ Helping them to create secure and safe Helm charts, Docker๏ฌles, Templates, etc. โ—‹ Removing the blockers by being pragmatic and empathetic โ—‹ Eliminate the possible things early and at scale โ— Repeat after me: Education, Education, Education โ—‹ Most people donโ€™t even understand the technology, leave about security. So educating them by teaching and practicing is the way to go ๐Ÿš€

Slide 19

Slide 19 text

TRACK: DEVSECOPS โ˜ธ ๐Ÿ Demo Time ๐Ÿคž ๐Ÿ™ @madhuakula

Slide 20

Slide 20 text

TRACK: DEVSECOPS ๐Ÿš€ Key Takeaways @madhuakula โœ… Security is everyoneโ€™s responsibility (Dev, Ops, Security, Management, etc.) โš  Threat model your architecture and identify risks/threats ๐Ÿ™Œ Follow and apply secure defaults ๐Ÿ“šKnow what you have (Inventory of assets) ๐ŸงฑAdopt zero trust model (Zoning, Containment & Segmentation) ๐ŸŽฏApply security at each layer (Defense in depth strategy) ๐ŸšจFollow least privilege principle ๐Ÿ‘ฎAuthN & AuthZ ๐Ÿ”Encryption at REST & TRANSIT ๐Ÿ›กProactive monitoring & Active defense ๐Ÿ”Continuously analyse and apply feedback loops ๐Ÿ‘‰ Crawl ๐Ÿข, Walk ๐Ÿšถ, Run ๐Ÿƒ, Fly โœˆ

Slide 21

Slide 21 text

TRACK: DEVSECOPS ๐Ÿ‘‰ https://madhuakula.com/content ๐Ÿ‘‰ https://kubernetes.io ๐Ÿ‘‰ https://github.com/madhuakula/hacker-container ๐Ÿ‘‰ https://kubernetes-security.info ๐Ÿ‘‰ https://github.com/kelseyhightower/kubernetes-the-hard-way ๐Ÿ‘‰ https://container.training ๐Ÿ‘‰ https://github.com/freach/kubernetes-security-best-practice ๐Ÿ‘‰ https://kubernetes.io/docs/tasks/administer-cluster/securing-a-cluster ๐Ÿ‘‰ https://github.com/docker/labs ๐Ÿ‘‰ https://labs.play-with-docker.com ๐Ÿ‘‰ https://labs.play-with-k8s.com ๐Ÿ‘‰ https://landscape.cncf.io ๐Ÿ”– Resources & References @madhuakula ๐Ÿ‘‰ https://github.com/cncf/sig-security/tree/master/security-whitepaper ๐Ÿ‘‰ https://tools.tldr.run ๐Ÿ‘‰ https://github.com/magnologan/awesome-k8s-security ๐Ÿ‘‰ https://github.com/ramitsurana/awesome-kubernetes ๐Ÿ‘‰ https://github.com/tomhuang12/awesome-k8s-resources ๐Ÿ‘‰ CNCF Slack ๐Ÿ‘‰ Kubernetes Slack ๐Ÿ‘‰ https://k8s.af ๐Ÿ‘‰ https://contained.af ๐Ÿ‘‰ https://github.com/genuinetools/img ๐Ÿ‘‰ https://github.com/genuinetools/bane ๐Ÿ‘‰ https://github.com/genuinetools/amicontained ๐Ÿ‘‰ CNCF YouTube Playlists for the KubeCon

Slide 22

Slide 22 text

TRACK: DEVSECOPS Thank you ๐Ÿ™ @madhuakula https://madhuakula.com @madhuakula https://madhuakula.com Want to learn more, have some idea, or just wanted to say ๐Ÿ‘‹

Slide 23

Slide 23 text

TRACK: DEVSECOPS