SlideShare a Scribd company logo
Hardening against
Kubernetes Hacks
Eric Smalling
Senior Developer Advocate @ Snyk
@ericsmalling
Eric Smalling
● Senior Developer Advocate @ Snyk
● Based in Dallas/Fort Worth, Texas
● 20+ years enterprise software development
● 10+ years build/test/deploy automation (CI/CD)
● Docker user since 2013 (v0.6)
● 2018 Jenkins Ambassador
● Docker Captain
● CKA, CKAD & CKS Certified
@ericsmalling
https://github.com/snyk-labs/kubernetes-goof
https://github.com/snyk-labs/kubernetes-goof
Exploit
=
App Vulns + Misconfiguration
https://github.com/snyk-labs/kubernetes-goof
What do we know ?
80
https://github.com/snyk-labs/kubernetes-goof
Timeline of Doom
Time
Scope
Initial Exploit
App Vuln
Allows RCE in
container
https://github.com/snyk-labs/kubernetes-goof
What do we know ?
80
Internal IP
5000
https://github.com/snyk-labs/kubernetes-goof
What do we know ?
80
Internal IP
IP Address
5000
https://github.com/snyk-labs/kubernetes-goof
Timeline of Doom
Time
Scope
Initial Exploit
App Vuln
Allows RCE in
container
Credentials
Pod Token
Available
inside pod
https://github.com/snyk-labs/kubernetes-goof
What do we know ?
80
Internal IP
IP Address
5000
External IP
https://github.com/snyk-labs/kubernetes-goof
Timeline of Doom
Time
Scope
Initial Exploit
App Vuln
Allows RCE in
container
Credentials
Pod Token
Available
inside pod
Permissions
Pod Token
Allows access
to endpoints
API
https://github.com/snyk-labs/kubernetes-goof
What do we know ?
80
Internal IP
External IP
5000
https://github.com/snyk-labs/kubernetes-goof
What do we know ?
80
Internal IP
External IP
Default
Secure
IP Address
5000
https://github.com/snyk-labs/kubernetes-goof
confidential apiVersion: v1
kind: ServiceAccount
metadata: name: insecure
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: allow_pod_read
rules:
- apiGroups:
- '*'
resources:
- '*'
verbs: ["create", "get", "watch", "list", "patch",
"delete", "deletecollection", "update"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: allow_pod_read_bind
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: allow_pod_read
subjects:
- kind: ServiceAccount
name: insecure
● Allows service account too many permissions
● Likely bound to the ‘secure’ namespace
○ No permissions in the default namespace
Insecure Role
https://github.com/snyk-labs/kubernetes-goof
Timeline of Doom
Time
Scope
Initial Exploit
App Vuln
Allows RCE in
container
Roles
Role
Gives service
account too
many
permissions in
namespace
Permissions
Pod Token
Allows access
to endpoints
API
Credentials
Pod Token
Available
inside pod
https://github.com/snyk-labs/kubernetes-goof
apiVersion: v1
kind: Pod
# ...
metadata:
annotations:
seccomp.security.alpha.kubernetes.io/pod:
runtime/default
spec:
containers:
- name: readonlyroot
securityContext:
readOnlyRootFilesystem: true
● Allows an attacker to modify the container
○ Download software
○ Change configuration
● Configure securityContext
○ readOnlyRootFilesystem: true
Read Write Filesystem
https://github.com/snyk-labs/kubernetes-goof
What do we know ?
80
Internal IP
External IP
IP Address
Secure Default
5000
https://github.com/snyk-labs/kubernetes-goof
confidential spec:
privileged: false
# Required to prevent escalations to root.
# allowPrivilegeEscalation: false
# This is redundant with non-root + disallow privilege
escalation,
# but we can provide it for defense in depth.
volumes:
- '*'
runAsUser:
# Require the container to run without root
privileges.
rule: 'MustRunAsNonRoot'
seLinux:
# This policy assumes the nodes are using AppArmor
rather than SELinux.
rule: 'RunAsAny'
supplementalGroups:
rule: 'MustRunAs'
ranges:
# Forbid adding the root group.
- min: 1
max: 65535
fsGroup:
rule: 'MustRunAs'
ranges:
# Forbid adding the root group.
- min: 1
max: 65535
● Allows service account too many permissions
● Likely bound to the ‘secure’ namespace
○ No permissions in the default namespace
● allowPrivilegeEscalation is NOT redundant
Pod Security Policy
https://github.com/snyk-labs/kubernetes-goof
Timeline of Doom
Time
Scope
Initial Exploit
App Vuln
Allows RCE in
container
Roles
Role
Gives service
account too
many
permissions in
namespace
Credentials
Pod Token
Available
inside pod
Permissions
Pod Token
Allows access
to endpoints
API
Permissions
PSP
Did not
disallow
privilege
escalation
https://github.com/snyk-labs/kubernetes-goof
What do we know ?
80
Internal IP
External IP
5000
Default
Secure
IP Address
IP Address
8080
https://github.com/snyk-labs/kubernetes-goof
Timeline of Doom
Time
Scope
Initial Exploit
App Vuln
Allows RCE in
container
Roles
Role
Gives service
account too
many
permissions in
namespace
Credentials
Pod Token
Available
inside pod
Permissions
Pod Token
Allows access
to endpoints
API
Policy
Network
No network
controls in
place
Permissions
PSP
Did not
disallow
privilege
escalation
https://github.com/snyk-labs/kubernetes-goof
What do we know ?
80
Internal IP
External IP
5000
Default
Secure
IP Address
IP Address
5001
8080
https://github.com/snyk-labs/kubernetes-goof
What do we know ?
80
Internal IP
External IP
5000
Default
Secure
IP Address IP Address
8080
https://github.com/snyk-labs/kubernetes-goof
What do we know ?
80
Internal IP
External IP
5000
Default
Secure
IP Address IP Address
8080
PRIVILEGED
HOST
https://github.com/snyk-labs/kubernetes-goof
Timeline of Doom
Time
Scope
Initial Exploit
App Vuln
Allows RCE in
container
Roles
Role
Gives service
account too
many
permissions in
namespace
Credentials
Pod Token
Available
inside pod
Permissions
Pod Token
Allows access
to endpoints
API
Permissions
PSP
Did not
disallow
privilege
escalation
Policy
Network
No network
controls in
place
Permissions
PSP
No
restrictions
in default ns
https://github.com/snyk-labs/kubernetes-goof
What do we know ?
5000
5000
Default
Secure
IP Address IP Address
8080
PRIVILEGED
Kube-System
HOST
https://github.com/snyk-labs/kubernetes-goof
What do we know ?
80
5000
Default
Secure
IP Address IP Address
8080
PRIVILEGED
Kube-System
HOST
https://github.com/snyk-labs/kubernetes-goof
Timeline of Doom
Time
Scope
Initial Exploit
App Vuln
Allows RCE in
container
Roles
Role
Gives service
account too
many
permissions in
namespace
Credentials
Pod Token
Available
inside pod
Permissions
Pod Token
Allows access
to endpoints
API
Permissions
PSP
Did not
disallow
privilege
escalation
Policy
Network
No network
controls in
place
Permissions
PSP
No
restrictions
in default ns
Game Over
Cluster
Cluster
admin
rights
gained
https://github.com/snyk-labs/kubernetes-goof
KubeCon NA 2022 - Hardening against Kubernetes Hacks.pdf
confidential
● Scan your application code
● Scan your container images
● Scan your Kubernetes YAML
● Don’t trust defaults / Be explicit
● Use Network Policies
● Use Admission Controls
How could we have
prevented this ?
With thanks and props to :
Mark Manning ( @antitree ), Ian Coldwater ( @iancoldwater ),
Duffie Cooley ( @mauilion ) , Rory McCune ( @raesene )
K8s SIG-Security, CNCF TAG-Security, OpenSSF,
and many others in the Kubernetes Security community
@ericsmalling

More Related Content

PDF
SCaLE 19x - Eric Smalling - Hardening against Kubernetes Hacks
PDF
DevOpsDays Chicago 2022 - Hands-on hacking containers and ways to prevent it
PDF
Kubernetes 101 for_penetration_testers_-_null_mumbai
PPTX
Kubernetes and container security
PPTX
The State of Kubernetes Security
PDF
Kubernetes - Security Journey
PPTX
Secure development on Kubernetes by Andreas Falk
PPTX
12 Ways Not to get 'Hacked' your Kubernetes Cluster
SCaLE 19x - Eric Smalling - Hardening against Kubernetes Hacks
DevOpsDays Chicago 2022 - Hands-on hacking containers and ways to prevent it
Kubernetes 101 for_penetration_testers_-_null_mumbai
Kubernetes and container security
The State of Kubernetes Security
Kubernetes - Security Journey
Secure development on Kubernetes by Andreas Falk
12 Ways Not to get 'Hacked' your Kubernetes Cluster

Similar to KubeCon NA 2022 - Hardening against Kubernetes Hacks.pdf (20)

PDF
CloudNativeTurkey - Lines of Defence.pdf
PDF
Control Plane: Continuous Kubernetes Security (DevSecOps - London Gathering, ...
PPTX
Three Years of Lessons Running Potentially Malicious Code Inside Containers
PDF
DockerCon 2023 - Live Demo_Hardening Against Kubernetes Hacks.pdf
PDF
Lines of Defense - Securing your Kubernetes Clusters by Koray Oksay
PDF
Hardening Kubernetes by Securing Pods
PPTX
Kubernetes Security Act Now Before It’s Too Late
PPTX
Security best practices for kubernetes deployment
PPTX
Security best practices for kubernetes deployment
PDF
Securing Containerized Applications: A Primer
PDF
Attacking and Defending Kubernetes - Nithin Jois
PDF
Behind the Code 'September 2022 // by Exness
PDF
Vincent Ruijter - ~Securing~ Attacking Kubernetes
PDF
Who is afraid of privileged containers ?
PDF
Kubernetes Security Best Practices for DevOps
PDF
DevOpsDaysRiga 2018: Andrew Martin - Continuous Kubernetes Security
PDF
Kubernetes Summit 2019 - Harden Your Kubernetes Cluster
PDF
Batten Down the Hatches: A Practical Guide to Securing Kubernetes - RMISC 2019
PPTX
Kubernetes security
PDF
Defense in Depth: Securing your new Kubernetes cluster from the challenges th...
CloudNativeTurkey - Lines of Defence.pdf
Control Plane: Continuous Kubernetes Security (DevSecOps - London Gathering, ...
Three Years of Lessons Running Potentially Malicious Code Inside Containers
DockerCon 2023 - Live Demo_Hardening Against Kubernetes Hacks.pdf
Lines of Defense - Securing your Kubernetes Clusters by Koray Oksay
Hardening Kubernetes by Securing Pods
Kubernetes Security Act Now Before It’s Too Late
Security best practices for kubernetes deployment
Security best practices for kubernetes deployment
Securing Containerized Applications: A Primer
Attacking and Defending Kubernetes - Nithin Jois
Behind the Code 'September 2022 // by Exness
Vincent Ruijter - ~Securing~ Attacking Kubernetes
Who is afraid of privileged containers ?
Kubernetes Security Best Practices for DevOps
DevOpsDaysRiga 2018: Andrew Martin - Continuous Kubernetes Security
Kubernetes Summit 2019 - Harden Your Kubernetes Cluster
Batten Down the Hatches: A Practical Guide to Securing Kubernetes - RMISC 2019
Kubernetes security
Defense in Depth: Securing your new Kubernetes cluster from the challenges th...

More from Eric Smalling (17)

PDF
KubeHuddle NA 2023 - Why should devs care about container security - Eric Sma...
PDF
ATO 2022 - Why should devs care about container security.pdf
PDF
Look Ma' - Building Java and Go based container images without Dockerfiles
PDF
Container Stranger Danger - Why should devs care about container security
PDF
DockerCon 2022 - From legacy to Kubernetes, securely & quickly
PDF
Python Web Conference 2022 - Why should devs care about container security.pdf
PDF
Why should developers care about container security?
PDF
AWS live hack: Docker + Snyk Container on AWS
PDF
AWS live hack: Atlassian + Snyk OSS on AWS
PDF
Hacking into your containers, and how to stop it!
PDF
DevSecCon Lightning 2021- Container defaults are a hackers best friend
PDF
LFX Nov 16, 2021 - Find vulnerabilities before security knocks on your door
PDF
So. many. vulnerabilities. Why are containers such a mess and what to do abou...
PDF
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
PDF
Best Practices for Developing & Deploying Java Applications with Docker
PDF
Docker 101 Workshop slides (JavaOne 2017)
PPTX
Simply your Jenkins Projects with Docker Multi-Stage Builds
KubeHuddle NA 2023 - Why should devs care about container security - Eric Sma...
ATO 2022 - Why should devs care about container security.pdf
Look Ma' - Building Java and Go based container images without Dockerfiles
Container Stranger Danger - Why should devs care about container security
DockerCon 2022 - From legacy to Kubernetes, securely & quickly
Python Web Conference 2022 - Why should devs care about container security.pdf
Why should developers care about container security?
AWS live hack: Docker + Snyk Container on AWS
AWS live hack: Atlassian + Snyk OSS on AWS
Hacking into your containers, and how to stop it!
DevSecCon Lightning 2021- Container defaults are a hackers best friend
LFX Nov 16, 2021 - Find vulnerabilities before security knocks on your door
So. many. vulnerabilities. Why are containers such a mess and what to do abou...
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
Best Practices for Developing & Deploying Java Applications with Docker
Docker 101 Workshop slides (JavaOne 2017)
Simply your Jenkins Projects with Docker Multi-Stage Builds

Recently uploaded (20)

PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Big Data Technologies - Introduction.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Modernizing your data center with Dell and AMD
PDF
KodekX | Application Modernization Development
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Big Data Technologies - Introduction.pptx
Machine learning based COVID-19 study performance prediction
Review of recent advances in non-invasive hemoglobin estimation
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Mobile App Security Testing_ A Comprehensive Guide.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Building Integrated photovoltaic BIPV_UPV.pdf
Approach and Philosophy of On baking technology
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Unlocking AI with Model Context Protocol (MCP)
Modernizing your data center with Dell and AMD
KodekX | Application Modernization Development
Chapter 3 Spatial Domain Image Processing.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf

KubeCon NA 2022 - Hardening against Kubernetes Hacks.pdf

  • 1. Hardening against Kubernetes Hacks Eric Smalling Senior Developer Advocate @ Snyk @ericsmalling
  • 2. Eric Smalling ● Senior Developer Advocate @ Snyk ● Based in Dallas/Fort Worth, Texas ● 20+ years enterprise software development ● 10+ years build/test/deploy automation (CI/CD) ● Docker user since 2013 (v0.6) ● 2018 Jenkins Ambassador ● Docker Captain ● CKA, CKAD & CKS Certified @ericsmalling https://github.com/snyk-labs/kubernetes-goof
  • 4. Exploit = App Vulns + Misconfiguration https://github.com/snyk-labs/kubernetes-goof
  • 5. What do we know ? 80 https://github.com/snyk-labs/kubernetes-goof
  • 6. Timeline of Doom Time Scope Initial Exploit App Vuln Allows RCE in container https://github.com/snyk-labs/kubernetes-goof
  • 7. What do we know ? 80 Internal IP 5000 https://github.com/snyk-labs/kubernetes-goof
  • 8. What do we know ? 80 Internal IP IP Address 5000 https://github.com/snyk-labs/kubernetes-goof
  • 9. Timeline of Doom Time Scope Initial Exploit App Vuln Allows RCE in container Credentials Pod Token Available inside pod https://github.com/snyk-labs/kubernetes-goof
  • 10. What do we know ? 80 Internal IP IP Address 5000 External IP https://github.com/snyk-labs/kubernetes-goof
  • 11. Timeline of Doom Time Scope Initial Exploit App Vuln Allows RCE in container Credentials Pod Token Available inside pod Permissions Pod Token Allows access to endpoints API https://github.com/snyk-labs/kubernetes-goof
  • 12. What do we know ? 80 Internal IP External IP 5000 https://github.com/snyk-labs/kubernetes-goof
  • 13. What do we know ? 80 Internal IP External IP Default Secure IP Address 5000 https://github.com/snyk-labs/kubernetes-goof
  • 14. confidential apiVersion: v1 kind: ServiceAccount metadata: name: insecure --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: allow_pod_read rules: - apiGroups: - '*' resources: - '*' verbs: ["create", "get", "watch", "list", "patch", "delete", "deletecollection", "update"] --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: allow_pod_read_bind roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: allow_pod_read subjects: - kind: ServiceAccount name: insecure ● Allows service account too many permissions ● Likely bound to the ‘secure’ namespace ○ No permissions in the default namespace Insecure Role https://github.com/snyk-labs/kubernetes-goof
  • 15. Timeline of Doom Time Scope Initial Exploit App Vuln Allows RCE in container Roles Role Gives service account too many permissions in namespace Permissions Pod Token Allows access to endpoints API Credentials Pod Token Available inside pod https://github.com/snyk-labs/kubernetes-goof
  • 16. apiVersion: v1 kind: Pod # ... metadata: annotations: seccomp.security.alpha.kubernetes.io/pod: runtime/default spec: containers: - name: readonlyroot securityContext: readOnlyRootFilesystem: true ● Allows an attacker to modify the container ○ Download software ○ Change configuration ● Configure securityContext ○ readOnlyRootFilesystem: true Read Write Filesystem https://github.com/snyk-labs/kubernetes-goof
  • 17. What do we know ? 80 Internal IP External IP IP Address Secure Default 5000 https://github.com/snyk-labs/kubernetes-goof
  • 18. confidential spec: privileged: false # Required to prevent escalations to root. # allowPrivilegeEscalation: false # This is redundant with non-root + disallow privilege escalation, # but we can provide it for defense in depth. volumes: - '*' runAsUser: # Require the container to run without root privileges. rule: 'MustRunAsNonRoot' seLinux: # This policy assumes the nodes are using AppArmor rather than SELinux. rule: 'RunAsAny' supplementalGroups: rule: 'MustRunAs' ranges: # Forbid adding the root group. - min: 1 max: 65535 fsGroup: rule: 'MustRunAs' ranges: # Forbid adding the root group. - min: 1 max: 65535 ● Allows service account too many permissions ● Likely bound to the ‘secure’ namespace ○ No permissions in the default namespace ● allowPrivilegeEscalation is NOT redundant Pod Security Policy https://github.com/snyk-labs/kubernetes-goof
  • 19. Timeline of Doom Time Scope Initial Exploit App Vuln Allows RCE in container Roles Role Gives service account too many permissions in namespace Credentials Pod Token Available inside pod Permissions Pod Token Allows access to endpoints API Permissions PSP Did not disallow privilege escalation https://github.com/snyk-labs/kubernetes-goof
  • 20. What do we know ? 80 Internal IP External IP 5000 Default Secure IP Address IP Address 8080 https://github.com/snyk-labs/kubernetes-goof
  • 21. Timeline of Doom Time Scope Initial Exploit App Vuln Allows RCE in container Roles Role Gives service account too many permissions in namespace Credentials Pod Token Available inside pod Permissions Pod Token Allows access to endpoints API Policy Network No network controls in place Permissions PSP Did not disallow privilege escalation https://github.com/snyk-labs/kubernetes-goof
  • 22. What do we know ? 80 Internal IP External IP 5000 Default Secure IP Address IP Address 5001 8080 https://github.com/snyk-labs/kubernetes-goof
  • 23. What do we know ? 80 Internal IP External IP 5000 Default Secure IP Address IP Address 8080 https://github.com/snyk-labs/kubernetes-goof
  • 24. What do we know ? 80 Internal IP External IP 5000 Default Secure IP Address IP Address 8080 PRIVILEGED HOST https://github.com/snyk-labs/kubernetes-goof
  • 25. Timeline of Doom Time Scope Initial Exploit App Vuln Allows RCE in container Roles Role Gives service account too many permissions in namespace Credentials Pod Token Available inside pod Permissions Pod Token Allows access to endpoints API Permissions PSP Did not disallow privilege escalation Policy Network No network controls in place Permissions PSP No restrictions in default ns https://github.com/snyk-labs/kubernetes-goof
  • 26. What do we know ? 5000 5000 Default Secure IP Address IP Address 8080 PRIVILEGED Kube-System HOST https://github.com/snyk-labs/kubernetes-goof
  • 27. What do we know ? 80 5000 Default Secure IP Address IP Address 8080 PRIVILEGED Kube-System HOST https://github.com/snyk-labs/kubernetes-goof
  • 28. Timeline of Doom Time Scope Initial Exploit App Vuln Allows RCE in container Roles Role Gives service account too many permissions in namespace Credentials Pod Token Available inside pod Permissions Pod Token Allows access to endpoints API Permissions PSP Did not disallow privilege escalation Policy Network No network controls in place Permissions PSP No restrictions in default ns Game Over Cluster Cluster admin rights gained https://github.com/snyk-labs/kubernetes-goof
  • 30. confidential ● Scan your application code ● Scan your container images ● Scan your Kubernetes YAML ● Don’t trust defaults / Be explicit ● Use Network Policies ● Use Admission Controls How could we have prevented this ?
  • 31. With thanks and props to : Mark Manning ( @antitree ), Ian Coldwater ( @iancoldwater ), Duffie Cooley ( @mauilion ) , Rory McCune ( @raesene ) K8s SIG-Security, CNCF TAG-Security, OpenSSF, and many others in the Kubernetes Security community @ericsmalling