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
Enables support for fine-grained SupplementalGroups control.
14
+
For more details, see [Configure fine-grained SupplementalGroups control for a Pod](/content/en/docs/tasks/configure-pod-container/security-context/#supplementalgroupspolicy).
This feature can be enabled by setting the `SupplementalGroupsPolicy`
237
+
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) for kubelet and
238
+
kube-apiserver, and setting the `.spec.securityContext.supplementalGroupsPolicy` field for a pod.
239
+
240
+
**supplementalGroupsPolicy** - `supplementalGroupsPolicy` defines behavior for calculating
241
+
supplementary groups for the container processes in a pod.
242
+
243
+
*_Merge_: The group membership defined in `/etc/group` for the container's primary user will be merged. If not specified, this policy will be applied.
244
+
245
+
*_Strict_: it only attaches group IDs in `fsGroup`, `supplementalGroups`, or `runAsGroup` fields as the supplementary groups of the container processess. This means no group membership defined in `/etc/group` for the container's primary user will be merged.
246
+
247
+
When the feature is enabled, it also exposes the process identity attached to the first container process of the container
248
+
in `.status.containerStatuses[].user.linux` field. It would be helpful to detect if implicit group ID's are attached.
This pod manifest defines `supplementalGroupsPolicy=Strict`. You can see no group membership defined in `/etc/group` will be merged to the supplementary groups for container processes.
You can see `status.containerStatuses[].user.linux` field exposes the process identitiy
285
+
attached to the first container process.
286
+
287
+
```none
288
+
...
289
+
status:
290
+
containerStatuses:
291
+
- name: sec-ctx-demo
292
+
user:
293
+
linux:
294
+
gid: 3000
295
+
supplementalGroups:
296
+
- 3000
297
+
- 4000
298
+
uid: 1000
299
+
...
300
+
```
301
+
302
+
{{<note>}}
303
+
Please note that the values in `status.containerStatuses[].user.linux` field is _the firstly attached_
304
+
process identity to the first container process in the container. If the container has sufficient privilege
305
+
to call system calls related to process identity (e.g. [`setuid(2)`](https://man7.org/linux/man-pages/man2/setuid.2.html), [`setgid(2)`](https://man7.org/linux/man-pages/man2/setgid.2.html) or [`setgroups(2)`](https://man7.org/linux/man-pages/man2/setgroups.2.html), etc.),
306
+
the container process can change its identity. Thus, the _actual_ process identity will be dynamic.
0 commit comments