Skip to content

Commit 2a2a886

Browse files
committed
Add Pod Security Standards to User Namespaces KEP
This KEP update outlines the required changes for Pod Security Standards in relation to the User Namespaces support. Planned graduation to beta is v1.28, which is now reflected in `kep.yaml` as well. Updating the PRR for it will follow in another PR. Signed-off-by: Sascha Grunert <[email protected]>
1 parent 7cb9920 commit 2a2a886

File tree

2 files changed

+45
-8
lines changed

2 files changed

+45
-8
lines changed

keps/sig-node/127-user-namespaces/README.md

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
- [Example without idmap mounts](#example-without-idmap-mounts)
2525
- [Example with idmap mounts](#example-with-idmap-mounts)
2626
- [Regarding the previous implementation for volumes](#regarding-the-previous-implementation-for-volumes)
27+
- [Pod Security Standards (PSS) integration](#pod-security-standards-pss-integration)
2728
- [Unresolved](#unresolved)
2829
- [Test Plan](#test-plan)
2930
- [Prerequisite testing updates](#prerequisite-testing-updates)
@@ -130,7 +131,7 @@ Here we use UIDs, but the same applies for GIDs.
130131
the pod (not valid in the host).
131132
- Benefit from the security hardening that user namespaces provide against some
132133
of the future unknown runtime and kernel vulnerabilities.
133-
- Support only stateless pods
134+
- Initially support stateless pods.
134135

135136
### Non-Goals
136137

@@ -141,7 +142,6 @@ Here we use UIDs, but the same applies for GIDs.
141142
- Implement all the very nice use cases that user namespaces allows. The goal
142143
here is to allow them as incremental improvements, not implement all the
143144
possible ideas related with user namespaces.
144-
- Support stateful pods
145145

146146
[kubelet-userns]: https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2033-kubelet-in-userns-aka-rootless
147147

@@ -329,7 +329,7 @@ way, the Kubelet can read all the allocated mappings if it restarts.
329329
During alpha, to make sure we don't exhaust the host UID namespace, we will
330330
limit the number of pods using user namespaces to `min(maxPods, 1024)`. This
331331
leaves us plenty of host UID space free and this limits is probably never hit in
332-
practice. See UNRESOLVED for more some UNRESOLVED info we still have on this.
332+
practice. See the [Unresolved section](#unresolved) for more details on this.
333333

334334
### Handling of stateless volumes
335335

@@ -422,6 +422,38 @@ components that implement the interface.
422422

423423
[kubeletVolumeHost-interface]: https://github.com/kubernetes/kubernetes/blob/36450ee422d57d53a3edaf960f86b356578fe996/pkg/volume/plugins.go#L322
424424

425+
### Pod Security Standards (PSS) integration
426+
427+
[Pod Security Standards](https://k8s.io/docs/concepts/security/pod-security-standards)
428+
define three different policies to broadly cover the whole security spectrum of
429+
Kubernetes, while the User Namespaces feature should integrate into them. This
430+
will happen only if the feature is graduated to GA, which _may_ result in
431+
changing the `Restricted` profile to disallow host user namespaces for stateless
432+
Pods.
433+
434+
With graduating the feature to beta, the Pod Security will relax in a controlled
435+
way for pods which enable user namespaces. This behavior can be controlled by an API
436+
Server Feature Gate, which allows an early opt-in for end users. The overall
437+
burden to ensure that all nodes will honor user namespaces is on the cluster
438+
admin, though. The relaxation in detail means, that if user namespaces are
439+
enabled, then the following fields won't be restricted any more because they
440+
always have to refer to the user inside the container:
441+
442+
- `spec.securityContext.runAsNonRoot`
443+
- `spec.containers[*].securityContext.runAsNonRoot`
444+
- `spec.initContainers[*].securityContext.runAsNonRoot`
445+
- `spec.ephemeralContainers[*].securityContext.runAsNonRoot`
446+
- `spec.securityContext.runAsUser`
447+
- `spec.containers[*].securityContext.runAsUser`
448+
- `spec.initContainers[*].securityContext.runAsUser`
449+
- `spec.ephemeralContainers[*].securityContext.runAsUser`
450+
- `spec.containers[*].securityContext.allowPrivilegeEscalation`
451+
- `spec.initContainers[*].securityContext.allowPrivilegeEscalation`
452+
- `spec.ephemeralContainers[*].securityContext.allowPrivilegeEscalation`
453+
454+
A serial test will be added to validate the functionality with the enabled
455+
feature gate.
456+
425457
### Unresolved
426458

427459
Here is a list of considerations raised in PRs discussion that hasn't yet
@@ -551,16 +583,20 @@ use container runtime versions that have the needed changes.
551583

552584
##### Beta
553585

554-
- Make plans on whether, when, and how to enable by default
586+
- Gather and address feedback from the community
587+
- Add API Server feature flag to integrate into [Pod Security Standards (PSS)](#pod-security-standards-pss-integration)
588+
- Get review from VM container runtimes maintainers
589+
590+
###### Open Questions
591+
555592
- Should we reconsider making the mappings smaller by default?
556593
- Should we allow any way for users to for "more" IDs mapped? If yes, how many more and how?
557594
- Should we allow the user to ask for specific mappings?
558-
- Get review from VM container runtimes maintainers
559-
- Gather and address feedback from the community
560595

561596
##### GA
562597

563598
- Gather and address feedback from the community
599+
- Fully integrate into [Pod Security Standards (PSS)](#pod-security-standards-pss-integration)
564600

565601
### Upgrade / Downgrade Strategy
566602

keps/sig-node/127-user-namespaces/kep.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
title: Support User Namespaces
1+
title: Support User Namespaces in stateless pods
22
kep-number: 127
33
authors:
44
- "@rata"
55
- "@giuseppe"
6+
- "@saschagrunert"
67
owning-sig: sig-node
78
participating-sigs: []
89
status: implementable
@@ -15,7 +16,7 @@ approvers:
1516
- "@derekwaynecarr"
1617

1718
stage: alpha
18-
latest-milestone: "v1.27"
19+
latest-milestone: "v1.28"
1920
milestone:
2021
alpha: "v1.25"
2122

0 commit comments

Comments
 (0)