Skip to content

Commit c58179f

Browse files
authored
Merge pull request #39131 from mtardy/scdeny-shortcomings
Update doc of admission plugin `SecurityContextDeny` to note shortcomings
2 parents deddc6f + 6c701a7 commit c58179f

File tree

1 file changed

+31
-11
lines changed

1 file changed

+31
-11
lines changed

content/en/docs/reference/access-authn-authz/admission-controllers.md

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -744,17 +744,37 @@ for more information.
744744

745745
### SecurityContextDeny {#securitycontextdeny}
746746

747-
This admission controller will deny any Pod that attempts to set certain escalating
748-
[SecurityContext](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#securitycontext-v1-core)
749-
fields, as shown in the
750-
[Configure a Security Context for a Pod or Container](/docs/tasks/configure-pod-container/security-context/)
751-
task.
752-
If you don't use [Pod Security admission](/docs/concepts/security/pod-security-admission/),
753-
[PodSecurityPolicies](/docs/concepts/security/pod-security-policy/), nor any external enforcement mechanism,
754-
then you could use this admission controller to restrict the set of values a security context can take.
755-
756-
See [Pod Security Standards](/docs/concepts/security/pod-security-standards/) for more context on restricting
757-
pod privileges.
747+
{{< feature-state for_k8s_version="v1.0" state="alpha" >}}
748+
749+
{{< caution >}}
750+
This admission controller plugin is **outdated** and **incomplete**, it may be
751+
unusable or not do what you would expect. It was originally designed to prevent
752+
the use of some, but not all, security-sensitive fields. Indeed, fields like
753+
`privileged`, were not filtered at creation and the plugin was not updated with
754+
the most recent fields, and new APIs like the `ephemeralContainers` field for a
755+
Pod.
756+
757+
The [Pod Security Admission](/docs/concepts/security/pod-security-admission/)
758+
plugin enforcing the [Pod Security Standards](/docs/concepts/security/pod-security-standards/)
759+
`Restricted` profile captures what this plugin was trying to achieve in a better
760+
and up-to-date way.
761+
{{< /caution >}}
762+
763+
This admission controller will deny any Pod that attempts to set the following
764+
[SecurityContext](/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context)
765+
fields:
766+
- `.spec.securityContext.supplementalGroups`
767+
- `.spec.securityContext.seLinuxOptions`
768+
- `.spec.securityContext.runAsUser`
769+
- `.spec.securityContext.fsGroup`
770+
- `.spec.(init)Containers[*].securityContext.seLinuxOptions`
771+
- `.spec.(init)Containers[*].securityContext.runAsUser`
772+
773+
For more historical context on this plugin, see
774+
[The birth of PodSecurityPolicy](/blog/2022/08/23/podsecuritypolicy-the-historical-context/#the-birth-of-podsecuritypolicy)
775+
from the Kubernetes blog article about PodSecurityPolicy and its removal. The
776+
article details the PodSecurityPolicy historical context and the birth of the
777+
`securityContext` field for Pods.
758778

759779
### ServiceAccount {#serviceaccount}
760780

0 commit comments

Comments
 (0)