User namespaces in k8s
Rodrigo Campos, @rata
User namespaces KEP
Proposal - pod.spec changes
| Phase 1 - pods “without” volumes | Phase 2 - pods with volumes | Phase 3 - pods with volumes and inter-pod isolation |
Opt-in with | pod.spec.useHostUsers | pod.spec.useHostUsers | pod.spec.useHostUsers pod.spec.securityContext.userns.pod2podIsolation |
Volumes supported | emptyDir Configmap Secret DownwardsAPI projected | any | any |
Mapping length | 64k | 64k | < 64k (~4k?) |
Mapping overlap? | No - more isolation! | Yes, with any pods with volume | Yes, but only in the namespace or Service Account same namespaces/SA → same mapping |
Works for most workloads? | No, only workloads with these volume types | Yes | No Only pods that need short number of UIDs Can’t share volumes between different k8s namespaces or Service Account (SA). Maybe not very used today? |
Mitigates known vulns | Yes, all! | Yes, all! | Yes, all! |
Notes | | Similar to phase 1, but we just return a fixed mapping (the same) for pods with volumes | Uses heuristics to guess UIDs to map. TBD if we will use per-sa or per-ns mappings. Improvement over phase 2, but with restrictions on the workloads that can use it |
Summary
List of vulns not applicable or partially mitigated by userns referenced in previous slide:
Thanks!
BACKLOG
Intro
Goals and challenges
Challenges
Proposal - phases
Intro
Proposal
Pod.spec changes:
Work: