Update RBAC best practices for workload creation
parent
b76931dd40
commit
6162bcde28
|
@ -99,10 +99,12 @@ includes the contents of all Secrets.
|
||||||
|
|
||||||
### Workload creation
|
### Workload creation
|
||||||
|
|
||||||
Users who are able to create workloads (either Pods, or
|
Permission to create workloads (either Pods, or
|
||||||
[workload resources](/docs/concepts/workloads/controllers/) that manage Pods) will
|
[workload resources](/docs/concepts/workloads/controllers/) that manage Pods) in a namespace
|
||||||
be able to gain access to the underlying node unless restrictions based on the Kubernetes
|
implicitly grants access to many other resources in that namespace, such as Secrets, ConfigMaps, and
|
||||||
[Pod Security Standards](/docs/concepts/security/pod-security-standards/) are in place.
|
PersistentVolumes, which can be mounted into a Pod. Additionally, since Pods can run as any
|
||||||
|
[ServiceAccount](/docs/reference/access-authn-authz/service-accounts-admin/), create workload
|
||||||
|
permissions effectively grants the API access levels of any ServiceAccount in the namespace.
|
||||||
|
|
||||||
Users who can run privileged Pods can use that access to gain node access and potentially to
|
Users who can run privileged Pods can use that access to gain node access and potentially to
|
||||||
further elevate their privileges. Where you do not fully trust a user or other principal
|
further elevate their privileges. Where you do not fully trust a user or other principal
|
||||||
|
@ -111,13 +113,8 @@ with the ability to create suitably secure and isolated Pods, you should enforce
|
||||||
You can use [Pod Security admission](/docs/concepts/security/pod-security-admission/)
|
You can use [Pod Security admission](/docs/concepts/security/pod-security-admission/)
|
||||||
or other (third party) mechanisms to implement that enforcement.
|
or other (third party) mechanisms to implement that enforcement.
|
||||||
|
|
||||||
You can also use the deprecated [PodSecurityPolicy](/docs/concepts/security/pod-security-policy/) mechanism
|
For these reasons, it is considered best practice to generally grant permissions at the namespace
|
||||||
to restrict users' abilities to create privileged Pods (N.B. PodSecurityPolicy is scheduled for removal
|
level, and use caution when subdividing access within a namespace.
|
||||||
in version 1.25).
|
|
||||||
|
|
||||||
Creating a workload in a namespace also grants indirect access to Secrets in that namespace.
|
|
||||||
Creating a pod in kube-system or a similarly privileged namespace can grant a user access to
|
|
||||||
Secrets they would not have through RBAC directly.
|
|
||||||
|
|
||||||
### Persistent volume creation
|
### Persistent volume creation
|
||||||
|
|
||||||
|
@ -186,4 +183,3 @@ to limit the quantity of objects which can be created.
|
||||||
## {{% heading "whatsnext" %}}
|
## {{% heading "whatsnext" %}}
|
||||||
|
|
||||||
* To learn more about RBAC, see the [RBAC documentation](/docs/reference/access-authn-authz/rbac/).
|
* To learn more about RBAC, see the [RBAC documentation](/docs/reference/access-authn-authz/rbac/).
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue