Skip to content

Commit 735d499

Browse files
authored
Merge pull request #35772 from ravisantoshgudimetla/psp-restricted
Update pod security standards to use PodOS field
2 parents ca02c59 + a1f6615 commit 735d499

File tree

1 file changed

+27
-20
lines changed

1 file changed

+27
-20
lines changed

content/en/docs/concepts/security/pod-security-standards.md

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ fail validation.
326326
<tr>
327327
<td style="white-space: nowrap">Privilege Escalation (v1.8+)</td>
328328
<td>
329-
<p>Privilege escalation (such as via set-user-ID or set-group-ID file mode) should not be allowed.</p>
329+
<p>Privilege escalation (such as via set-user-ID or set-group-ID file mode) should not be allowed. <em><a href="#policies-specific-to-linux">This is Linux only policy</a> in v1.25+ <code>(spec.os.name != windows)</code></em></p>
330330
<p><strong>Restricted Fields</strong></p>
331331
<ul>
332332
<li><code>spec.containers[*].securityContext.allowPrivilegeEscalation</code></li>
@@ -381,7 +381,7 @@ fail validation.
381381
<tr>
382382
<td style="white-space: nowrap">Seccomp (v1.19+)</td>
383383
<td>
384-
<p>Seccomp profile must be explicitly set to one of the allowed values. Both the <code>Unconfined</code> profile and the <em>absence</em> of a profile are prohibited.</p>
384+
<p>Seccomp profile must be explicitly set to one of the allowed values. Both the <code>Unconfined</code> profile and the <em>absence</em> of a profile are prohibited. <em><a href="#policies-specific-to-linux">This is Linux only policy</a> in v1.25+ <code>(spec.os.name != windows)</code></em></p>
385385
<p><strong>Restricted Fields</strong></p>
386386
<ul>
387387
<li><code>spec.securityContext.seccompProfile.type</code></li>
@@ -407,7 +407,7 @@ fail validation.
407407
<td>
408408
<p>
409409
Containers must drop <code>ALL</code> capabilities, and are only permitted to add back
410-
the <code>NET_BIND_SERVICE</code> capability.
410+
the <code>NET_BIND_SERVICE</code> capability. <em><a href="#policies-specific-to-linux">This is Linux only policy</a> in v1.25+ <code>(.spec.os.name != "windows")</code></em>
411411
</p>
412412
<p><strong>Restricted Fields</strong></p>
413413
<ul>
@@ -461,6 +461,30 @@ Other alternatives for enforcing policies are being developed in the Kubernetes
461461
- [Kyverno](https://kyverno.io/policies/pod-security/)
462462
- [OPA Gatekeeper](https://github.com/open-policy-agent/gatekeeper)
463463

464+
## Pod OS field
465+
466+
Kubernetes lets you use nodes that run either Linux or Windows. You can mix both kinds of
467+
node in one cluster.
468+
Windows in Kubernetes has some limitations and differentiators from Linux-based
469+
workloads. Specifically, many of the Pod `securityContext` fields
470+
[have no effect on Windows](/docs/concepts/windows/intro/#compatibility-v1-pod-spec-containers-securitycontext).
471+
472+
{{< note >}}
473+
Kubelets prior to v1.24 don't enforce the pod OS field, and if a cluster has nodes on versions earlier than v1.24 the restricted policies should be pinned to a version prior to v1.25.
474+
{{< /note >}}
475+
476+
### Restricted Pod Security Standard changes
477+
Another important change, made in Kubernetes v1.25 is that the _restricted_ Pod security
478+
has been updated to use the `pod.spec.os.name` field. Based on the OS name, certain policies that are specific
479+
to a particular OS can be relaxed for the other OS.
480+
481+
482+
#### OS-specific policy controls
483+
Restrictions on the following controls are only required if `.spec.os.name` is not `windows`:
484+
- Privilege Escalation
485+
- Seccomp
486+
- Linux Capabilities
487+
464488
## FAQ
465489

466490
### Why isn't there a profile between privileged and baseline?
@@ -484,23 +508,6 @@ as well as other related parameters outside the Security Context. As of July 202
484508
[Pod Security Policies](/docs/concepts/security/pod-security-policy/) are deprecated in favor of the
485509
built-in [Pod Security Admission Controller](/docs/concepts/security/pod-security-admission/).
486510

487-
### What profiles should I apply to my Windows Pods?
488-
489-
Windows in Kubernetes has some limitations and differentiators from standard Linux-based
490-
workloads. Specifically, many of the Pod SecurityContext fields
491-
[have no effect on Windows](/docs/concepts/windows/intro/#compatibility-v1-pod-spec-containers-securitycontext).
492-
As such, no standardized Pod Security profiles currently exist.
493-
494-
If you apply the restricted profile for a Windows pod, this **may** have an impact on the pod
495-
at runtime. The restricted profile requires enforcing Linux-specific restrictions (such as seccomp
496-
profile, and disallowing privilege escalation). If the kubelet and / or its container runtime ignore
497-
these Linux-specific values, then the Windows pod should still work normally within the restricted
498-
profile. However, the lack of enforcement means that there is no additional restriction, for Pods
499-
that use Windows containers, compared to the baseline profile.
500-
501-
The use of the HostProcess flag to create a HostProcess pod should only be done in alignment with the privileged policy.
502-
Creation of a Windows HostProcess pod is blocked under the baseline and restricted policies,
503-
so any HostProcess pod should be considered privileged.
504511

505512
### What about sandboxed Pods?
506513

0 commit comments

Comments
 (0)