SlideShare a Scribd company logo
Copyright©2018 NTT Corp. All Rights Reserved.
Akihiro Suda ( @_AkihiroSuda_ )
NTT Software Innovation Center
Usernetes: Kubernetes as a non-root user
Kubernetes & Cloud Native Meetup (Oct 25, 2018)
https://slideshare.net/AkihiroSuda
2
Copyright©2018 NTT Corp. All Rights Reserved.
• Software engineer at NTT (The largest telco in Japan)
• A maintainer of Moby (former Docker Engine), BuildKit,
containerd, and etc...
• An organizer of Docker Tokyo meetup
• github: @AkihiroSuda
• Twitter: @_AkihiroSuda_
Who am I
3
Copyright©2018 NTT Corp. All Rights Reserved.
• Run kubelet, dockerd (or crio), and everything as a non-root
user
• Don't confuse with securityContext.runAsUser and "Node-
level UserNS" (milestone: v1.13)
• Binary releases are available: https://github.com/rootless-
containers/usernetes
• Just unpack the archive under your $HOME, and you're all set
Usernetes: Kubernetes as a non-root user
$ tar xjvf usernetes-x86_64.tbz
$ cd usernetes
$ ./run.sh
4
Copyright©2018 NTT Corp. All Rights Reserved.
Motivation
User application
Kubernetes
CRI runtimes (Docker/containerd/CRI-O)
OCI runtimes (runc)
Kernel
VM
Hardware
Out of scope of container
security, basically
(e.g. Meltdown)
Can be hardened with
containers
5
Copyright©2018 NTT Corp. All Rights Reserved.
Motivation
User application
Kubernetes
CRI runtimes (Docker/containerd/CRI-O)
OCI runtimes (runc)
Kernel
VM
Hardware
Can we really rely on
them...?
6
Copyright©2018 NTT Corp. All Rights Reserved.
• Kubernetes CVE-2017-1002101
• A malicious container can access the host filesystems due to a
volumeMounts.subPath symlink issue
• Kubernetes CVE-2017-1002102
• A malicious containers ca remove files on the host filesystems due to a
secret/configMap/downwardAPI volume issue
Kubernetes CVEs
https://kubernetes.io/blog/2018/04/04/fixing-subpath-volume-vulnerability/
https://github.com/kubernetes/kubernetes/issues/60814
7
Copyright©2018 NTT Corp. All Rights Reserved.
• Docker CVE-2014-9357
• A malicious container can execute arbitrary binaries on the host due to an LZMA archive
issue
• containerd #2001
• A malicious container image can remove /tmp on the host when pulled (not when
launched!) due to an image layer issue
• CRI-O CVE-2018-1000400
• A malicious user in a container can gain the root in the container due to a capability
issue
• runc CVE-2016-9962
• A malicious container can gain the FDs of additional `runc exec` processes before it is
fully placed in the container due to a process initialization issue
• runc CVE-2016-3697
• A malicious container can gain unexpected UID due to a UID strconv issue
• And more!
Runtime CVEs
8
Copyright©2018 NTT Corp. All Rights Reserved.
• Execute container runtimes and orchestrators as well as
containers as an unprivileged user, by using User
Namespaces
• Can mitigate the security risk effectively, although not
panacea
• Kernel might still have security bugs that can't be mitigated... but we have
more "eyeballs" for the kernel
• Officially adopted by runc, img, BuildKit, Buildah, Podman,
and CRI-O
• Patch available for Docker/Moby, containerd, and Kubernetes
Our approach: Rootless containers
9
Copyright©2018 NTT Corp. All Rights Reserved.
• An unprivileged user can create Network Namespaces along
with a User Namespace, but cannot set up the VETH pair
across the parent and the child namespaces
• i.e. No internet connection
Challenge: Networking
The Internet
Host (“parent”)
UserNS + NetNS (“child”)
NetNS NetNS
10
Copyright©2018 NTT Corp. All Rights Reserved.
• Prior work: LXC uses SETUID binary (lxc-user-nic) for
setting up the VETH pair across the parent and the child
namespaces
• Problem: SETUID binary can be dangerous!
• CVE-2017-5985: netns privilege escalation
• CVE-2018-6556: arbitrary file open(2)
Challenge: Networking
11
Copyright©2018 NTT Corp. All Rights Reserved.
Challenge: Networking
• Our approach: use usermode network (“Slirp”) with a TAP
device (https://github.com/rootless-containers/slirp4netns)
• Similar to `qemu –netdev user`
• Completely unprivileged
• iperf3 benchmark on Travis: 9.21 Gbps
The Internet
Host
UserNS + NetNS
NetNS NetNS
TAP
“Slirp” TAPFD
“sendfd” (SCM_RIGHTS cmsg over socketpair)
12
Copyright©2018 NTT Corp. All Rights Reserved.
• OverlayFS
• Kernel-mode overlayfs cannot be used in User Namespaces (except on
Ubuntu kernel)
• But FUSE implementation of overlayfs can be used (Kernel >= 4.18)
• Even without overlayfs, copy_file_range(2) can be still used for file
deduplication on XFS
• Cgroups
• pam_cgfs.so can be used for delegating Cgroups configuration to an
unprivileged user
• But not recommended by systemd maintainers, due to potential DOS
• Cgroups v2 supports delegation properly (nsdelegate), but not adopted in
OCI/Kubernetes ecosystem yet
• Usernetes can be executed without access to Cgroups, except some
features like `kubectl top`
Other challenges
13
Copyright©2018 NTT Corp. All Rights Reserved.
• Based on Kubernetes 1.12 and Docker 18.09
• Supports both Docker and CRI-O
• Support for containerd is also on plan
• Multi-node cluster will be supported soon
• Binary available:
https://github.com/rootless-containers/usernetes
Current status of Usernetes
$ tar xjvf usernetes-x86_64.tbz
$ cd usernetes
$ ./run.sh
14
Copyright©2018 NTT Corp. All Rights Reserved.
Demo

More Related Content

PDF
Rootless Kubernetes
PDF
Rootless Containers
PDF
Comparing Next-Generation Container Image Building Tools
PDF
The State of Rootless Containers
PDF
ISC HPCW talks
PDF
[DockerCon 2020] Hardening Docker daemon with Rootless Mode
PDF
[KubeCon EU 2021] Introduction and Deep Dive Into Containerd
PDF
[Paris Container Day 2021] nerdctl: yet another Docker & Docker Compose imple...
Rootless Kubernetes
Rootless Containers
Comparing Next-Generation Container Image Building Tools
The State of Rootless Containers
ISC HPCW talks
[DockerCon 2020] Hardening Docker daemon with Rootless Mode
[KubeCon EU 2021] Introduction and Deep Dive Into Containerd
[Paris Container Day 2021] nerdctl: yet another Docker & Docker Compose imple...

What's hot (20)

PDF
[KubeCon NA 2020] containerd: Rootless Containers 2020
PDF
[DockerCon 2019] Hardening Docker daemon with Rootless mode
PDF
Rootless Containers & Unresolved issues
PDF
[KubeConUS2019 Docker, Inc. Booth] Distributed Builds on Kubernetes with Bui...
PDF
[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKit
PDF
[KubeCon EU 2020] containerd Deep Dive
ODP
Docker engine - Indroduc
PDF
[FOSDEM 2020] Lazy distribution of container images
PDF
Introduction and Deep Dive Into Containerd
PDF
Docker and OpenStack Boston Meetup
PDF
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
PPTX
Docker open stack boston
PDF
Docker 101: An Introduction
PDF
App container rkt
PDF
Podman, Buildah, and Quarkus - The Latest in Linux Containers Technologies
PDF
Upstate DevOps - Containers 101 - March 28, 2019
PDF
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
PDF
LXC, Docker, and the future of software delivery | LinuxCon 2013
PPTX
A deep dive into container technology - Vietnam Web Summit 2020 (18/12/2020)
PDF
[KubeCon NA 2020] containerd: Rootless Containers 2020
[DockerCon 2019] Hardening Docker daemon with Rootless mode
Rootless Containers & Unresolved issues
[KubeConUS2019 Docker, Inc. Booth] Distributed Builds on Kubernetes with Bui...
[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKit
[KubeCon EU 2020] containerd Deep Dive
Docker engine - Indroduc
[FOSDEM 2020] Lazy distribution of container images
Introduction and Deep Dive Into Containerd
Docker and OpenStack Boston Meetup
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Docker open stack boston
Docker 101: An Introduction
App container rkt
Podman, Buildah, and Quarkus - The Latest in Linux Containers Technologies
Upstate DevOps - Containers 101 - March 28, 2019
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
LXC, Docker, and the future of software delivery | LinuxCon 2013
A deep dive into container technology - Vietnam Web Summit 2020 (18/12/2020)
Ad

Similar to Usernetes: Kubernetes as a non-root user (20)

PPTX
Being a Moby maintainer
PPTX
Docker Security
PDF
Real-World Docker: 10 Things We've Learned
PPTX
Introducing Container Technology to TSUBAME3.0 Supercomputer
PDF
It's 2018. Are My Containers Secure Yet!?
PPTX
Container Security
PPTX
Cont0519
PDF
Scaling notebooks for Deep Learning workloads
PDF
컨테이너 기술 소개 - Warden, Garden, Docker
PDF
Unikernels: Rise of the Library Hypervisor
PDF
Container Security
PDF
Unikernels: the rise of the library hypervisor in MirageOS
PPTX
Kubernetes 101 VMworld 2019 workshop slides
PDF
Parallelizing CI using Docker Swarm-Mode
PDF
P2P Container Image Distribution on IPFS With containerd and nerdctl
PDF
Rooting Out Root: User namespaces in Docker
PDF
20220406 - SDAN_Presentation1_SDANOverview.pdf
PDF
Securing k8s With Kubernetes Goat
PDF
Docker, Linux Containers (LXC), and security
PPTX
Platform as a Service with Kubernetes and Mesos
Being a Moby maintainer
Docker Security
Real-World Docker: 10 Things We've Learned
Introducing Container Technology to TSUBAME3.0 Supercomputer
It's 2018. Are My Containers Secure Yet!?
Container Security
Cont0519
Scaling notebooks for Deep Learning workloads
컨테이너 기술 소개 - Warden, Garden, Docker
Unikernels: Rise of the Library Hypervisor
Container Security
Unikernels: the rise of the library hypervisor in MirageOS
Kubernetes 101 VMworld 2019 workshop slides
Parallelizing CI using Docker Swarm-Mode
P2P Container Image Distribution on IPFS With containerd and nerdctl
Rooting Out Root: User namespaces in Docker
20220406 - SDAN_Presentation1_SDANOverview.pdf
Securing k8s With Kubernetes Goat
Docker, Linux Containers (LXC), and security
Platform as a Service with Kubernetes and Mesos
Ad

More from Akihiro Suda (20)

PDF
20250617 [KubeCon JP 2025] containerd - Project Update and Deep Dive.pdf
PDF
20250616 [KubeCon JP 2025] VexLLM - Silence Negligible CVE Alerts Using LLM.pdf
PDF
20250403 [KubeCon EU] containerd - Project Update and Deep Dive.pdf
PDF
20250403 [KubeCon EU Pavilion] containerd.pdf
PDF
20250402 [KubeCon EU Pavilion] Lima.pdf_
PDF
20241115 [KubeCon NA Pavilion] Lima.pdf_
PDF
20241113 [KubeCon NA Pavilion] containerd.pdf
PDF
【情報科学若手の会 (2024/09/14】なぜオープンソースソフトウェアにコントリビュートすべきなのか
PDF
【Vuls祭り#10 (2024/08/20)】 VexLLM: LLMを用いたVEX自動生成ツール
PDF
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
PDF
20240321 [KubeCon EU Pavilion] Lima.pdf_
PDF
20240320 [KubeCon EU Pavilion] containerd.pdf
PDF
20240201 [HPC Containers] Rootless Containers.pdf
PDF
[Podman Special Event] Kubernetes in Rootless Podman
PDF
[KubeConNA2023] Lima pavilion
PDF
[KubeConNA2023] containerd pavilion
PDF
[DockerConハイライト] OpenPubKeyによるイメージの署名と検証.pdf
PDF
[CNCF TAG-Runtime] Usernetes Gen2
PDF
[DockerCon 2023] Reproducible builds with BuildKit for software supply chain ...
PDF
The internals and the latest trends of container runtimes
20250617 [KubeCon JP 2025] containerd - Project Update and Deep Dive.pdf
20250616 [KubeCon JP 2025] VexLLM - Silence Negligible CVE Alerts Using LLM.pdf
20250403 [KubeCon EU] containerd - Project Update and Deep Dive.pdf
20250403 [KubeCon EU Pavilion] containerd.pdf
20250402 [KubeCon EU Pavilion] Lima.pdf_
20241115 [KubeCon NA Pavilion] Lima.pdf_
20241113 [KubeCon NA Pavilion] containerd.pdf
【情報科学若手の会 (2024/09/14】なぜオープンソースソフトウェアにコントリビュートすべきなのか
【Vuls祭り#10 (2024/08/20)】 VexLLM: LLMを用いたVEX自動生成ツール
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240321 [KubeCon EU Pavilion] Lima.pdf_
20240320 [KubeCon EU Pavilion] containerd.pdf
20240201 [HPC Containers] Rootless Containers.pdf
[Podman Special Event] Kubernetes in Rootless Podman
[KubeConNA2023] Lima pavilion
[KubeConNA2023] containerd pavilion
[DockerConハイライト] OpenPubKeyによるイメージの署名と検証.pdf
[CNCF TAG-Runtime] Usernetes Gen2
[DockerCon 2023] Reproducible builds with BuildKit for software supply chain ...
The internals and the latest trends of container runtimes

Recently uploaded (20)

PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
assetexplorer- product-overview - presentation
PDF
medical staffing services at VALiNTRY
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
history of c programming in notes for students .pptx
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
iTop VPN Free 5.6.0.5262 Crack latest version 2025
PDF
Digital Systems & Binary Numbers (comprehensive )
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Adobe Illustrator 28.6 Crack My Vision of Vector Design
assetexplorer- product-overview - presentation
medical staffing services at VALiNTRY
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
CHAPTER 2 - PM Management and IT Context
PTS Company Brochure 2025 (1).pdf.......
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
Operating system designcfffgfgggggggvggggggggg
How to Choose the Right IT Partner for Your Business in Malaysia
Which alternative to Crystal Reports is best for small or large businesses.pdf
Odoo POS Development Services by CandidRoot Solutions
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
history of c programming in notes for students .pptx
Design an Analysis of Algorithms I-SECS-1021-03
Odoo Companies in India – Driving Business Transformation.pdf
iTop VPN Free 5.6.0.5262 Crack latest version 2025
Digital Systems & Binary Numbers (comprehensive )
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool

Usernetes: Kubernetes as a non-root user

  • 1. Copyright©2018 NTT Corp. All Rights Reserved. Akihiro Suda ( @_AkihiroSuda_ ) NTT Software Innovation Center Usernetes: Kubernetes as a non-root user Kubernetes & Cloud Native Meetup (Oct 25, 2018) https://slideshare.net/AkihiroSuda
  • 2. 2 Copyright©2018 NTT Corp. All Rights Reserved. • Software engineer at NTT (The largest telco in Japan) • A maintainer of Moby (former Docker Engine), BuildKit, containerd, and etc... • An organizer of Docker Tokyo meetup • github: @AkihiroSuda • Twitter: @_AkihiroSuda_ Who am I
  • 3. 3 Copyright©2018 NTT Corp. All Rights Reserved. • Run kubelet, dockerd (or crio), and everything as a non-root user • Don't confuse with securityContext.runAsUser and "Node- level UserNS" (milestone: v1.13) • Binary releases are available: https://github.com/rootless- containers/usernetes • Just unpack the archive under your $HOME, and you're all set Usernetes: Kubernetes as a non-root user $ tar xjvf usernetes-x86_64.tbz $ cd usernetes $ ./run.sh
  • 4. 4 Copyright©2018 NTT Corp. All Rights Reserved. Motivation User application Kubernetes CRI runtimes (Docker/containerd/CRI-O) OCI runtimes (runc) Kernel VM Hardware Out of scope of container security, basically (e.g. Meltdown) Can be hardened with containers
  • 5. 5 Copyright©2018 NTT Corp. All Rights Reserved. Motivation User application Kubernetes CRI runtimes (Docker/containerd/CRI-O) OCI runtimes (runc) Kernel VM Hardware Can we really rely on them...?
  • 6. 6 Copyright©2018 NTT Corp. All Rights Reserved. • Kubernetes CVE-2017-1002101 • A malicious container can access the host filesystems due to a volumeMounts.subPath symlink issue • Kubernetes CVE-2017-1002102 • A malicious containers ca remove files on the host filesystems due to a secret/configMap/downwardAPI volume issue Kubernetes CVEs https://kubernetes.io/blog/2018/04/04/fixing-subpath-volume-vulnerability/ https://github.com/kubernetes/kubernetes/issues/60814
  • 7. 7 Copyright©2018 NTT Corp. All Rights Reserved. • Docker CVE-2014-9357 • A malicious container can execute arbitrary binaries on the host due to an LZMA archive issue • containerd #2001 • A malicious container image can remove /tmp on the host when pulled (not when launched!) due to an image layer issue • CRI-O CVE-2018-1000400 • A malicious user in a container can gain the root in the container due to a capability issue • runc CVE-2016-9962 • A malicious container can gain the FDs of additional `runc exec` processes before it is fully placed in the container due to a process initialization issue • runc CVE-2016-3697 • A malicious container can gain unexpected UID due to a UID strconv issue • And more! Runtime CVEs
  • 8. 8 Copyright©2018 NTT Corp. All Rights Reserved. • Execute container runtimes and orchestrators as well as containers as an unprivileged user, by using User Namespaces • Can mitigate the security risk effectively, although not panacea • Kernel might still have security bugs that can't be mitigated... but we have more "eyeballs" for the kernel • Officially adopted by runc, img, BuildKit, Buildah, Podman, and CRI-O • Patch available for Docker/Moby, containerd, and Kubernetes Our approach: Rootless containers
  • 9. 9 Copyright©2018 NTT Corp. All Rights Reserved. • An unprivileged user can create Network Namespaces along with a User Namespace, but cannot set up the VETH pair across the parent and the child namespaces • i.e. No internet connection Challenge: Networking The Internet Host (“parent”) UserNS + NetNS (“child”) NetNS NetNS
  • 10. 10 Copyright©2018 NTT Corp. All Rights Reserved. • Prior work: LXC uses SETUID binary (lxc-user-nic) for setting up the VETH pair across the parent and the child namespaces • Problem: SETUID binary can be dangerous! • CVE-2017-5985: netns privilege escalation • CVE-2018-6556: arbitrary file open(2) Challenge: Networking
  • 11. 11 Copyright©2018 NTT Corp. All Rights Reserved. Challenge: Networking • Our approach: use usermode network (“Slirp”) with a TAP device (https://github.com/rootless-containers/slirp4netns) • Similar to `qemu –netdev user` • Completely unprivileged • iperf3 benchmark on Travis: 9.21 Gbps The Internet Host UserNS + NetNS NetNS NetNS TAP “Slirp” TAPFD “sendfd” (SCM_RIGHTS cmsg over socketpair)
  • 12. 12 Copyright©2018 NTT Corp. All Rights Reserved. • OverlayFS • Kernel-mode overlayfs cannot be used in User Namespaces (except on Ubuntu kernel) • But FUSE implementation of overlayfs can be used (Kernel >= 4.18) • Even without overlayfs, copy_file_range(2) can be still used for file deduplication on XFS • Cgroups • pam_cgfs.so can be used for delegating Cgroups configuration to an unprivileged user • But not recommended by systemd maintainers, due to potential DOS • Cgroups v2 supports delegation properly (nsdelegate), but not adopted in OCI/Kubernetes ecosystem yet • Usernetes can be executed without access to Cgroups, except some features like `kubectl top` Other challenges
  • 13. 13 Copyright©2018 NTT Corp. All Rights Reserved. • Based on Kubernetes 1.12 and Docker 18.09 • Supports both Docker and CRI-O • Support for containerd is also on plan • Multi-node cluster will be supported soon • Binary available: https://github.com/rootless-containers/usernetes Current status of Usernetes $ tar xjvf usernetes-x86_64.tbz $ cd usernetes $ ./run.sh
  • 14. 14 Copyright©2018 NTT Corp. All Rights Reserved. Demo

Editor's Notes

  • #2: https://wantedly.connpass.com/event/105371/ 10 minutes