You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
to ensure pods don't run alongside untrusted or less-trusted Pods. Pay especial attention to
60
+
situations where less-trustworthy Pods are not meeting the **Restricted** Pod Security Standard.
61
61
62
62
### Hardening
63
63
64
-
Kubernetes defaults to providing access which may not be required in every cluster. Reviewing
64
+
Kubernetes defaults to providing access which may not be required in every cluster. Reviewing
65
65
the RBAC rights provided by default can provide opportunities for security hardening.
66
-
In general, changes should not be made to rights provided to `system:` accounts some options
66
+
In general, changes should not be made to rights provided to `system:` accounts some options
67
67
to harden cluster rights exist:
68
68
69
69
- Review bindings for the `system:unauthenticated` group and remove them where possible, as this gives
@@ -76,7 +76,7 @@ to harden cluster rights exist:
76
76
77
77
### Periodic review
78
78
79
-
It is vital to periodically review the Kubernetes RBAC settings for redundant entries and
79
+
It is vital to periodically review the Kubernetes RBAC settings for redundant entries and
80
80
possible privilege escalations.
81
81
If an attacker is able to create a user account with the same name as a deleted user,
82
82
they can automatically inherit all the rights of the deleted user, especially the
@@ -87,7 +87,7 @@ rights assigned to that user.
87
87
Within Kubernetes RBAC there are a number of privileges which, if granted, can allow a user or a service account
88
88
to escalate their privileges in the cluster or affect systems outside the cluster.
89
89
90
-
This section is intended to provide visibility of the areas where cluster operators
90
+
This section is intended to provide visibility of the areas where cluster operators
91
91
should take care, to ensure that they do not inadvertently allow for more access to clusters than intended.
92
92
93
93
### Listing secrets
@@ -125,7 +125,7 @@ If someone - or some application - is allowed to create arbitrary PersistentVolu
125
125
includes the creation of `hostPath` volumes, which then means that a Pod would get access
126
126
to the underlying host filesystem(s) on the associated node. Granting that ability is a security risk.
127
127
128
-
There are many ways a container with unrestricted access to the host filesystem can escalate privileges, including
128
+
There are many ways a container with unrestricted access to the host filesystem can escalate privileges, including
129
129
reading data from other containers, and abusing the credentials of system services, such as Kubelet.
130
130
131
131
You should only allow access to create PersistentVolume objects for:
@@ -135,56 +135,56 @@ You should only allow access to create PersistentVolume objects for:
135
135
that are configured for automatic provisioning.
136
136
This is usually setup by the Kubernetes provider or by the operator when installing a CSI driver.
137
137
138
-
Where access to persistent storage is required trusted administrators should create
138
+
Where access to persistent storage is required trusted administrators should create
139
139
PersistentVolumes, and constrained users should use PersistentVolumeClaims to access that storage.
140
140
141
141
### Access to `proxy` subresource of Nodes
142
142
143
-
Users with access to the proxy sub-resource of node objects have rights to the Kubelet API,
144
-
which allows for command execution on every pod on the node(s) to which they have rights.
145
-
This access bypasses audit logging and admission control, so care should be taken before
143
+
Users with access to the proxy sub-resource of node objects have rights to the Kubelet API,
144
+
which allows for command execution on every pod on the node(s) to which they have rights.
145
+
This access bypasses audit logging and admission control, so care should be taken before
146
146
granting rights to this resource.
147
147
148
148
### Escalate verb
149
149
150
-
Generally, the RBAC system prevents users from creating clusterroles with more rights than the user possesses.
150
+
Generally, the RBAC system prevents users from creating clusterroles with more rights than the user possesses.
151
151
The exception to this is the `escalate` verb. As noted in the [RBAC documentation](/docs/reference/access-authn-authz/rbac/#restrictions-on-role-creation-or-update),
152
152
users with this right can effectively escalate their privileges.
153
153
154
154
### Bind verb
155
155
156
-
Similar to the `escalate` verb, granting users this right allows for the bypass of Kubernetes
157
-
in-built protections against privilege escalation, allowing users to create bindings to
156
+
Similar to the `escalate` verb, granting users this right allows for the bypass of Kubernetes
157
+
in-built protections against privilege escalation, allowing users to create bindings to
158
158
roles with rights they do not already have.
159
159
160
160
### Impersonate verb
161
161
162
-
This verb allows users to impersonate and gain the rights of other users in the cluster.
163
-
Care should be taken when granting it, to ensure that excessive permissions cannot be gained
162
+
This verb allows users to impersonate and gain the rights of other users in the cluster.
163
+
Care should be taken when granting it, to ensure that excessive permissions cannot be gained
164
164
via one of the impersonated accounts.
165
165
166
166
### CSRs and certificate issuing
167
167
168
-
The CSR API allows for users with `create` rights to CSRs and `update` rights on `certificatesigningrequests/approval`
169
-
where the signer is `kubernetes.io/kube-apiserver-client` to create new client certificates
170
-
which allow users to authenticate to the cluster. Those client certificates can have arbitrary
168
+
The CSR API allows for users with `create` rights to CSRs and `update` rights on `certificatesigningrequests/approval`
169
+
where the signer is `kubernetes.io/kube-apiserver-client` to create new client certificates
170
+
which allow users to authenticate to the cluster. Those client certificates can have arbitrary
171
171
names including duplicates of Kubernetes system components. This will effectively allow for privilege escalation.
172
172
173
173
### Token request
174
174
175
-
Users with `create` rights on `serviceaccounts/token` can create TokenRequests to issue
176
-
tokens for existing service accounts.
175
+
Users with `create` rights on `serviceaccounts/token` can create TokenRequests to issue
176
+
tokens for existing service accounts.
177
177
178
178
### Control admission webhooks
179
179
180
-
Users with control over `validatingwebhookconfigurations` or `mutatingwebhookconfigurations`
181
-
can control webhooks that can read any object admitted to the cluster, and in the case of
180
+
Users with control over `validatingwebhookconfigurations` or `mutatingwebhookconfigurations`
181
+
can control webhooks that can read any object admitted to the cluster, and in the case of
182
182
mutating webhooks, also mutate admitted objects.
183
183
184
-
185
184
## Kubernetes RBAC - denial of service risks {#denial-of-service-risks}
to validate bearer tokens using your own validation service.
259
258
* Provide your own identities to Pods.
260
-
*[Use the SPIFFE CSI driver plugin to provide SPIFFE SVIDs as X.509 certificate pairs to Pods](https://cert-manager.io/docs/projects/csi-driver-spiffe/).
259
+
*[Use the SPIFFE CSI driver plugin to provide SPIFFE SVIDs as X.509 certificate pairs to Pods](https://cert-manager.io/docs/projects/csi-driver-spiffe/).
261
260
{{% thirdparty-content single="true" %}}
262
-
*[Use a service mesh such as Istio to provide certificates to Pods](https://istio.io/latest/docs/tasks/security/cert-management/plugin-ca-cert/).
261
+
*[Use a service mesh such as Istio to provide certificates to Pods](https://istio.io/latest/docs/tasks/security/cert-management/plugin-ca-cert/).
263
262
* Authenticate from outside the cluster to the API server without using service account tokens:
264
-
*[Configure the API server to accept OpenID Connect (OIDC) tokens from your identity provider](/docs/reference/access-authn-authz/authentication/#openid-connect-tokens).
265
-
* Use service accounts or user accounts created using an external Identity
266
-
and Access Management (IAM) service, such as from a cloud provider, to
267
-
authenticate to your cluster.
268
-
*[Use the CertificateSigningRequest API with client certificates](/docs/tasks/tls/managing-tls-in-a-cluster/).
263
+
*[Configure the API server to accept OpenID Connect (OIDC) tokens from your identity provider](/docs/reference/access-authn-authz/authentication/#openid-connect-tokens).
264
+
* Use service accounts or user accounts created using an external Identity
265
+
and Access Management (IAM) service, such as from a cloud provider, to
266
+
authenticate to your cluster.
267
+
*[Use the CertificateSigningRequest API with client certificates](/docs/tasks/tls/managing-tls-in-a-cluster/).
269
268
*[Configure the kubelet to retrieve credentials from an image registry](/docs/tasks/administer-cluster/kubelet-credential-provider/).
270
269
* Use a Device Plugin to access a virtual Trusted Platform Module (TPM), which
0 commit comments