SlideShare a Scribd company logo
Submit Search
Upload
KCD Munich 2022: How to Prevent Your Kubernetes Cluster From Being Hacked
Report
Share
Nico Meisenzahl
Cloud Solution Architect | Head of DevOps Consulting & Operations
Follow
•
0 likes
•
53 views
1
of
26
KCD Munich 2022: How to Prevent Your Kubernetes Cluster From Being Hacked
•
0 likes
•
53 views
Report
Share
Download Now
Download to read offline
Technology
How to Prevent Your Kubernetes Cluster From Being Hacked
Read more
Nico Meisenzahl
Cloud Solution Architect | Head of DevOps Consulting & Operations
Follow
Recommended
How to Prevent Your Kubernetes Cluster From Being Hacked by
How to Prevent Your Kubernetes Cluster From Being Hacked
Nico Meisenzahl
53 views
•
26 slides
Container Days: Hijack a Kubernetes Cluster - a Walkthrough by
Container Days: Hijack a Kubernetes Cluster - a Walkthrough
Nico Meisenzahl
16 views
•
25 slides
Hijack a Kubernetes Cluster - a Walkthrough by
Hijack a Kubernetes Cluster - a Walkthrough
Nico Meisenzahl
70 views
•
22 slides
Hijack a Kubernetes Cluster - a Walkthrough by
Hijack a Kubernetes Cluster - a Walkthrough
Nico Meisenzahl
125 views
•
22 slides
ContainerConf 2022: Hijack Kubernetes by
ContainerConf 2022: Hijack Kubernetes
Nico Meisenzahl
58 views
•
24 slides
Microsoft DevOps Forum 2021 – DevOps & Security by
Microsoft DevOps Forum 2021 – DevOps & Security
Nico Meisenzahl
248 views
•
23 slides
More Related Content
Similar to KCD Munich 2022: How to Prevent Your Kubernetes Cluster From Being Hacked
KCD Munich 2022: Hijack a Kubernetes Cluster - a Walkthrough by
KCD Munich 2022: Hijack a Kubernetes Cluster - a Walkthrough
Nico Meisenzahl
15 views
•
15 slides
Container Day Security: How to Prevent Your Kubernetes Cluster From Being Hacked by
Container Day Security: How to Prevent Your Kubernetes Cluster From Being Hacked
Nico Meisenzahl
30 views
•
14 slides
DevOpsCon London: How containerized Pipelines can boost your CI/CD by
DevOpsCon London: How containerized Pipelines can boost your CI/CD
Nico Meisenzahl
221 views
•
20 slides
ContainerConf 2022: Kubernetes is awesome - but... by
ContainerConf 2022: Kubernetes is awesome - but...
Nico Meisenzahl
194 views
•
29 slides
Virtual GitLab Meetup: How Containerized Pipelines and Kubernetes Can Boost Y... by
Virtual GitLab Meetup: How Containerized Pipelines and Kubernetes Can Boost Y...
Nico Meisenzahl
206 views
•
18 slides
DevOpsCon Berlin: Helm vs Operators – Do I Need to Decide? by
DevOpsCon Berlin: Helm vs Operators – Do I Need to Decide?
Nico Meisenzahl
113 views
•
23 slides
Similar to KCD Munich 2022: How to Prevent Your Kubernetes Cluster From Being Hacked
(20)
KCD Munich 2022: Hijack a Kubernetes Cluster - a Walkthrough by Nico Meisenzahl
KCD Munich 2022: Hijack a Kubernetes Cluster - a Walkthrough
Nico Meisenzahl
•
15 views
Container Day Security: How to Prevent Your Kubernetes Cluster From Being Hacked by Nico Meisenzahl
Container Day Security: How to Prevent Your Kubernetes Cluster From Being Hacked
Nico Meisenzahl
•
30 views
DevOpsCon London: How containerized Pipelines can boost your CI/CD by Nico Meisenzahl
DevOpsCon London: How containerized Pipelines can boost your CI/CD
Nico Meisenzahl
•
221 views
ContainerConf 2022: Kubernetes is awesome - but... by Nico Meisenzahl
ContainerConf 2022: Kubernetes is awesome - but...
Nico Meisenzahl
•
194 views
Virtual GitLab Meetup: How Containerized Pipelines and Kubernetes Can Boost Y... by Nico Meisenzahl
Virtual GitLab Meetup: How Containerized Pipelines and Kubernetes Can Boost Y...
Nico Meisenzahl
•
206 views
DevOpsCon Berlin: Helm vs Operators – Do I Need to Decide? by Nico Meisenzahl
DevOpsCon Berlin: Helm vs Operators – Do I Need to Decide?
Nico Meisenzahl
•
113 views
GitLab London Meetup: How Containerized Pipelines and Kubernetes Can Boost Yo... by Nico Meisenzahl
GitLab London Meetup: How Containerized Pipelines and Kubernetes Can Boost Yo...
Nico Meisenzahl
•
138 views
Effiziente CI/CD-Pipelines – mit den richtigen Tools klappt das by Nico Meisenzahl
Effiziente CI/CD-Pipelines – mit den richtigen Tools klappt das
Nico Meisenzahl
•
48 views
Kubernetes and container security by Volodymyr Shynkar
Kubernetes and container security
Volodymyr Shynkar
•
2.5K views
DevOps Gathering - How Containerized Pipelines Can Boost Your CI/CD by Nico Meisenzahl
DevOps Gathering - How Containerized Pipelines Can Boost Your CI/CD
Nico Meisenzahl
•
380 views
Cloud Love Conference: Kubernetes is awesome, but... by Nico Meisenzahl
Cloud Love Conference: Kubernetes is awesome, but...
Nico Meisenzahl
•
11 views
FestiveTechCalendar2021 - Have Yourself An Azure Container Registry by Philip Welz
FestiveTechCalendar2021 - Have Yourself An Azure Container Registry
Philip Welz
•
116 views
Containerized Build & Deployment Pipelines by Nico Meisenzahl
Containerized Build & Deployment Pipelines
Nico Meisenzahl
•
158 views
Festive Tech Calendar: Festive time with AKS networking by Nico Meisenzahl
Festive Tech Calendar: Festive time with AKS networking
Nico Meisenzahl
•
23 views
Azure Rosenheim Meetup: Azure Service Operator by Nico Meisenzahl
Azure Rosenheim Meetup: Azure Service Operator
Nico Meisenzahl
•
61 views
Azure Meetup Hamburg: Production-Ready Terraform Deployments on Azure by Nico Meisenzahl
Azure Meetup Hamburg: Production-Ready Terraform Deployments on Azure
Nico Meisenzahl
•
287 views
Secure Your Code Implement DevSecOps in Azure by kloia
Secure Your Code Implement DevSecOps in Azure
kloia
•
266 views
Microservices & Serverless Architecture Principles Applied - Cisco Live Orlan... by Cisco DevNet
Microservices & Serverless Architecture Principles Applied - Cisco Live Orlan...
Cisco DevNet
•
309 views
Kubernetes Security by Karthik Gaekwad
Kubernetes Security
Karthik Gaekwad
•
1.3K views
10 tips for Cloud Native Security by Karthik Gaekwad
10 tips for Cloud Native Security
Karthik Gaekwad
•
261 views
More from Nico Meisenzahl
Cloud-Native & Sustainability: How and Why to Build Sustainable Workloads by
Cloud-Native & Sustainability: How and Why to Build Sustainable Workloads
Nico Meisenzahl
51 views
•
50 slides
Azure Zürich User Group: Azure Kubernetes Service – more than just a managed ... by
Azure Zürich User Group: Azure Kubernetes Service – more than just a managed ...
Nico Meisenzahl
94 views
•
47 slides
azdevcom - Hijack a Kubernetes Cluster by
azdevcom - Hijack a Kubernetes Cluster
Nico Meisenzahl
138 views
•
5 slides
Continuous Lifecycle: Enhance Your Compliance and Governance With Policy-Base... by
Continuous Lifecycle: Enhance Your Compliance and Governance With Policy-Base...
Nico Meisenzahl
164 views
•
15 slides
Continuous Lifecycle: Hijack Kubernetes by
Continuous Lifecycle: Hijack Kubernetes
Nico Meisenzahl
53 views
•
5 slides
Hijack a Kubernetes Cluster - a Walkthrough by
Hijack a Kubernetes Cluster - a Walkthrough
Nico Meisenzahl
102 views
•
5 slides
More from Nico Meisenzahl
(14)
Cloud-Native & Sustainability: How and Why to Build Sustainable Workloads by Nico Meisenzahl
Cloud-Native & Sustainability: How and Why to Build Sustainable Workloads
Nico Meisenzahl
•
51 views
Azure Zürich User Group: Azure Kubernetes Service – more than just a managed ... by Nico Meisenzahl
Azure Zürich User Group: Azure Kubernetes Service – more than just a managed ...
Nico Meisenzahl
•
94 views
azdevcom - Hijack a Kubernetes Cluster by Nico Meisenzahl
azdevcom - Hijack a Kubernetes Cluster
Nico Meisenzahl
•
138 views
Continuous Lifecycle: Enhance Your Compliance and Governance With Policy-Base... by Nico Meisenzahl
Continuous Lifecycle: Enhance Your Compliance and Governance With Policy-Base...
Nico Meisenzahl
•
164 views
Continuous Lifecycle: Hijack Kubernetes by Nico Meisenzahl
Continuous Lifecycle: Hijack Kubernetes
Nico Meisenzahl
•
53 views
Hijack a Kubernetes Cluster - a Walkthrough by Nico Meisenzahl
Hijack a Kubernetes Cluster - a Walkthrough
Nico Meisenzahl
•
102 views
GitLab Commit: Enhance your Compliance with Policy-Based CI/CD by Nico Meisenzahl
GitLab Commit: Enhance your Compliance with Policy-Based CI/CD
Nico Meisenzahl
•
586 views
GitLab Commit DevOps: How GitLab Can Save your Kubernetes environment from Be... by Nico Meisenzahl
GitLab Commit DevOps: How GitLab Can Save your Kubernetes environment from Be...
Nico Meisenzahl
•
87 views
GitHub Actions 101 by Nico Meisenzahl
GitHub Actions 101
Nico Meisenzahl
•
112 views
Azure Saturday Hamburg: Containerize Your .NET Microservice - the Right Way! by Nico Meisenzahl
Azure Saturday Hamburg: Containerize Your .NET Microservice - the Right Way!
Nico Meisenzahl
•
249 views
Cloud Native Day: Cloud-native Anwendungsentwicklung im Jahr 2021 by Nico Meisenzahl
Cloud Native Day: Cloud-native Anwendungsentwicklung im Jahr 2021
Nico Meisenzahl
•
145 views
Die Evolution von Container Image Builds by Nico Meisenzahl
Die Evolution von Container Image Builds
Nico Meisenzahl
•
223 views
Azure Service Operator - Provision Your Resources in a Cloud-Native Way by Nico Meisenzahl
Azure Service Operator - Provision Your Resources in a Cloud-Native Way
Nico Meisenzahl
•
224 views
GitLab Commit: Your Attackers Won't Be Happy! How GitLab Can Help You Secure ... by Nico Meisenzahl
GitLab Commit: Your Attackers Won't Be Happy! How GitLab Can Help You Secure ...
Nico Meisenzahl
•
103 views
Recently uploaded
HTTP headers that make your website go faster - devs.gent November 2023 by
HTTP headers that make your website go faster - devs.gent November 2023
Thijs Feryn
19 views
•
151 slides
SAP Automation Using Bar Code and FIORI.pdf by
SAP Automation Using Bar Code and FIORI.pdf
Virendra Rai, PMP
19 views
•
38 slides
Case Study Copenhagen Energy and Business Central.pdf by
Case Study Copenhagen Energy and Business Central.pdf
Aitana
12 views
•
3 slides
Black and White Modern Science Presentation.pptx by
Black and White Modern Science Presentation.pptx
maryamkhalid2916
14 views
•
21 slides
Spesifikasi Lengkap ASUS Vivobook Go 14 by
Spesifikasi Lengkap ASUS Vivobook Go 14
Dot Semarang
35 views
•
1 slide
Scaling Knowledge Graph Architectures with AI by
Scaling Knowledge Graph Architectures with AI
Enterprise Knowledge
24 views
•
15 slides
Recently uploaded
(20)
HTTP headers that make your website go faster - devs.gent November 2023 by Thijs Feryn
HTTP headers that make your website go faster - devs.gent November 2023
Thijs Feryn
•
19 views
SAP Automation Using Bar Code and FIORI.pdf by Virendra Rai, PMP
SAP Automation Using Bar Code and FIORI.pdf
Virendra Rai, PMP
•
19 views
Case Study Copenhagen Energy and Business Central.pdf by Aitana
Case Study Copenhagen Energy and Business Central.pdf
Aitana
•
12 views
Black and White Modern Science Presentation.pptx by maryamkhalid2916
Black and White Modern Science Presentation.pptx
maryamkhalid2916
•
14 views
Spesifikasi Lengkap ASUS Vivobook Go 14 by Dot Semarang
Spesifikasi Lengkap ASUS Vivobook Go 14
Dot Semarang
•
35 views
Scaling Knowledge Graph Architectures with AI by Enterprise Knowledge
Scaling Knowledge Graph Architectures with AI
Enterprise Knowledge
•
24 views
From chaos to control: Managing migrations and Microsoft 365 with ShareGate! by sammart93
From chaos to control: Managing migrations and Microsoft 365 with ShareGate!
sammart93
•
9 views
Perth MeetUp November 2023 by Michael Price
Perth MeetUp November 2023
Michael Price
•
15 views
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson
•
33 views
6g - REPORT.pdf by Liveplex
6g - REPORT.pdf
Liveplex
•
9 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software
•
225 views
Special_edition_innovator_2023.pdf by WillDavies22
Special_edition_innovator_2023.pdf
WillDavies22
•
16 views
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... by Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker
•
26 views
Vertical User Stories by Moisés Armani Ramírez
Vertical User Stories
Moisés Armani Ramírez
•
11 views
handbook for web 3 adoption.pdf by Liveplex
handbook for web 3 adoption.pdf
Liveplex
•
19 views
Empathic Computing: Delivering the Potential of the Metaverse by Mark Billinghurst
Empathic Computing: Delivering the Potential of the Metaverse
Mark Billinghurst
•
470 views
The Research Portal of Catalonia: Growing more (information) & more (services) by CSUC - Consorci de Serveis Universitaris de Catalunya
The Research Portal of Catalonia: Growing more (information) & more (services)
CSUC - Consorci de Serveis Universitaris de Catalunya
•
73 views
20231123_Camunda Meetup Vienna.pdf by Phactum Softwareentwicklung GmbH
20231123_Camunda Meetup Vienna.pdf
Phactum Softwareentwicklung GmbH
•
28 views
Report 2030 Digital Decade by Massimo Talia
Report 2030 Digital Decade
Massimo Talia
•
14 views
Piloting & Scaling Successfully With Microsoft Viva by Richard Harbridge
Piloting & Scaling Successfully With Microsoft Viva
Richard Harbridge
•
10 views
KCD Munich 2022: How to Prevent Your Kubernetes Cluster From Being Hacked
1.
SPONSORS Speakers: Philip Welz,
Nico Meisenzahl Company: white duck How to Prevent Your Kubernetes Cluster From Being Hacked
2.
Who we are ©
white duck GmbH 2022 Nico Meisenzahl (Head of DevOps Consulting and Operations, Cloud Solution Architect, Azure & Developer Technologies MVP, GitLab Hero) Email: nico.meisenzahl@whiteduck.de Twitter: @nmeisenzahl LinkedIn: https://www.linkedin.com/in/nicomeisenzahl/ Philip Welz (Senior Kubernetes & DevOps Engineer, GitLab Hero, CKA, CKAD & CKS) Twitter: @philip_welz LinkedIn: https://www.linkedin.com/in/philip-welz
3.
Security quick wins
through the DevOps cycle © white duck GmbH 2022
4.
You should think
about • ensure secure application / deployment code • build secure container images • implement Kubernetes policies • introduce Kubernetes network policies • rely on Container Runtime Security • many more… © white duck GmbH 2022
5.
Ensure secure application
/ deployment code • your cluster is a shared resource • a single compromised application can be enough • automate and enforce code checks (shift left!) • scan your code as well as your dependencies • application code • Dockerfiles • deployment manifests © white duck GmbH 2022
6.
Examples • vulnerable code
and dependencies • missing Dockerfile best practices • unsecure Kubernetes manifests They all can lead to someone gaining access to your cluster! © white duck GmbH 2022
7.
SAST in general •
Static Application Security Testing (SAST) can help validate you with • application code • Dockerfiles • Kubernetes Manifests • and more • use your existing tooling (GitHub, GitLab) for easy start • there is also a big ecosystem available © white duck GmbH 2022
8.
Software Bill of
Materials (SBOM) • “list of ingredients” for all your software and dependencies • supports hierarchy and therefore multi-level dependencies • without you don’t have the full visibility • in an ideal world you would only need to care about your own stuff • SBOMs can be the baseline for your vulnerability scanning © white duck GmbH 2022
9.
Tooling: syft and
grype • syft helps you to create Software Bill of Materials (SBOM) • https://github.com/anchore/syft • can also be used via “docker sbom” • grype allows to scan SBOMs for vulnerability • https://github.com/anchore/grype • both • support a large list of programming languages and ecosystems • are easy to integrate into CI • can be integrated with K8s via Operators • https://github.com/ckotzbauer/sbom-operator • https://github.com/ckotzbauer/vulnerability-operator © white duck GmbH 2022
10.
Demo: Vulnerability scanning
with SBOM • we will create an SBOM for an existing container image using syft • then analyzing the exported SBOM with grype to detect possible vulnerabilities © white duck GmbH 2022
11.
Further K8s-related tooling •
Ensure best practices and detect misconfiguration on clusters • kube-bench: https://github.com/aquasecurity/kube-bench • Kubescape: https://github.com/kubescape/kubescape • Popeye: https://github.com/derailed/popeye • Scan Dockerfiles, K8s manifests or Helm Charts • Checkov: https://github.com/bridgecrewio/checkov • Trivy: https://github.com/aquasecurity/trivy • kics: https://github.com/Checkmarx/kics © white duck GmbH 2022
12.
Implement Kubernetes policies •
allows you to enforce what is allowed and what is not • enables you to define guardrails for your user • can limit attackers from gaining further access © white duck GmbH 2022
13.
Examples • attacker spins
up a privileged container to escape • someone mounts the nodes disk via hostPath • then gains access to the secret of the underlying cloud identity • exposing a service via LoadBalancer service © white duck GmbH 2022
14.
Tooling: Built-in, OPA
or Kyverno • Pod Security Admission • stable since 1.25 • admission controller to enforce the Pod Security Standards • define different isolation levels (profiles) for Pods • Open Policy Agent Gatekeeper • “jack of all trades” • can become quite complex – Rego J • https://open-policy-agent.github.io/gatekeeper • Kyverno • easy to start • Kubernetes-only (which can be a plus) • https://kyverno.io © white duck GmbH 2022
15.
Introduce Kubernetes network
policies • once again: K8s is a shared resource • you need to define guard rails • think about • egress traffic into the internet • east-west traffic between applications and namespaces • traffic into your internal network and/or cloud resources © white duck GmbH 2022
16.
Examples • malicious code
gets loaded from the internet • attacker talking to the Cloud provider matadata service • and retrieve cloud identity secret • vulnerable application has access to other apps backends • and dumps, changes, deletes data © white duck GmbH 2022
17.
Tooling: There are
many… • grab the one that suits your needs • go for a managed solution in managed Clusters • Cilium • based on eBPF • allows Domain name-based policies • https://editor.cilium.io J • https://cilium.io • Calico • supports standard Linux networking or eBPF "now" • Domain name-based policies only via Calico Enterprise • widely adopted (AKS, GKE,…) © white duck GmbH 2022
18.
Rely on Container
Runtime Security • gives you awareness into your cluster • without that you won't know what is going on • alerts you on malicious events and workloads • based on the defined rules • real-time enforcement © white duck GmbH 2022
19.
Examples • undetected untrusted
process within container • Untrusted shells running inside a container • container process mounting a sensitive path • a process making outbound network connections © white duck GmbH 2022
20.
Tooling: Falco or
Tetragon • Falco • parses Linux system calls from the kernel at runtime • “the known one” • https://falco.org • Tetragon • eBPF-based analysis • Process execution events • System call activity • I/O activity including network & file access • “the new one” • https://github.com/cilium/tetragon © white duck GmbH 2022
21.
Demo: Tetragon • we
will inject into a Pod via Log4Shell • we will use Tetragon (pre-installed via Helm) to observe the process execution • and finally block it © white duck GmbH 2022
22.
Service Account Token •
got more secure with Kubernetes 1.24 • you now must create a token when you need one • do not • share service accounts between applications • enable higher access levels for the default service account if not required • mount service account token if not required (prior 1.24) • https://kubernetes.io/docs/tasks/configure-pod-container/configure- service-account/#use-the-default-service-account-to-access-the-api- server © white duck GmbH 2022
23.
Web Application Firewall
(WAF) • helps you to further secure your application • most of them enforce OWASP 10 by default • https://owasp.org/www-project-top-ten • implement further rules based on your needs • put it in front of your workload as • dedicated WAF • as part of your Ingress Controller • not more than 5 lines to get started with Ingress Nginx © white duck GmbH 2022
24.
Don’t miss your
running workload • while shifting left, don’t miss running workload • you have multiple options • run Trivy Operator • https://github.com/aquasecurity/trivy-operator • or Trivy regularly in your cluster with Estafette • https://github.com/estafette/estafette-vulnerability-scanner • or with Jetstack version checker • https://github.com/jetstack/version-checker © white duck GmbH 2022
25.
Links & further
details • there are many more projects • we have shown only a very small portion • “Hijack Kubernetes” demo • https://github.com/nmeisenzahl/hijack-kubernetes • Slides • https://www.slideshare.net/nmeisenzahl © white duck GmbH 2022
26.
Questions? © white duck
GmbH 2022 Nico Meisenzahl (Head of DevOps Consulting and Operations, Cloud Solution Architect, Azure & Developer Technologies MVP, GitLab Hero) Email: nico.meisenzahl@whiteduck.de Twitter: @nmeisenzahl LinkedIn: https://www.linkedin.com/in/nicomeisenzahl/ Philip Welz (Senior Kubernetes & DevOps Engineer, GitLab Hero, CKA, CKAD & CKS) Twitter: @philip_welz LinkedIn: https://www.linkedin.com/in/philip-welz