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
Copy file name to clipboardExpand all lines: config.md
+38-10
Original file line number
Diff line number
Diff line change
@@ -226,16 +226,40 @@ The user for the process is a platform-specific structure that allows specific c
226
226
227
227
For POSIX platforms the `user` structure has the following fields:
228
228
229
-
***`uid`** (int, REQUIRED) specifies the user ID (UID) in the [container namespace](glossary.md#container-namespace).
230
-
***`gid`** (int, REQUIRED) specifies the group ID (GID) in the [container namespace](glossary.md#container-namespace).
231
-
***`umask`** (int, OPTIONAL) specifies the [umask][umask_2] of the user. If unspecified, the umask should not be changed from the calling process' umask.
232
-
***`additionalGids`** (array of ints, OPTIONAL) specifies additional group IDs in the [container namespace](glossary.md#container-namespace) to be added to the list of supplementary group IDs.
233
-
234
-
On a POSIX platform, processes have both a 'base' GID (as specified in the `gid` field), and an array of supplementary group IDs as described in [IEEE Std 1003.1-2008][ieee-1003.1.2008-xbd-c3.378].
235
-
Runtimes MUST ensure that all group IDs specified by `gid` and `additionalGids` are present in the array of supplementary group IDs.
236
-
Runtimes SHOULD preserve the order of `additionalGids`; if the base GID (as specified in the `gid` field) is absent from `additionalGids`, it SHOULD be positioned at the start of the supplementary group ID array.
237
-
238
-
Entities which create a container using a runtime on a POSIX platform SHOULD duplicate the base GID (as specified in the `gid` field) as `additionalGids[0]`; this maximizes compatibility and consistency when using runtimes that target a previous version of this specification.
229
+
***`uid`** (int, REQUIRED) specifies a user ID (UID) in the [container namespace](glossary.md#container-namespace).
230
+
The container process MUST be started with the [real user ID, effective user ID and saved set-user-ID][ieee-1003.1-2008-xbd-c3.436] set to the value of `uid`.
231
+
***`gid`** (int, REQUIRED) specifies a group ID (GID) in the [container namespace](glossary.md#container-namespace).
232
+
The conatiner process MUST be started with the [real group ID, effective group ID, and saved set-group-ID][ieee-1003.1-2008-xbd-c3.189] set to the value of `gid`.
233
+
***`umask`** (int, OPTIONAL) specifies the [umask][umask.2] of the user.
234
+
If unspecified, the umask should not be changed from the calling process' umask.
235
+
***`additionalGids`** (array of ints, OPTIONAL) specifies a list of group IDs in the [container namespace](glossary.md#container-namespace)
236
+
to be added to the [supplementary group IDs][ieee-1003.1-2008-xbd-c3.378] of the container process.
237
+
***`sgids`** (array of ints, OPTIONAL) specifies a list of group IDs in the [container namespace](glossary.md#container-namespace).
238
+
This field takes precedence over `additionalGids`:
239
+
if `sgids` is specified, including if set to the empty array,
240
+
the container process MUST be started with its [supplementary group IDs][ieee-1003.1-2008-xbd-c3.378] set
241
+
such that a call to [getgroups][getgroups.2] from the container process
242
+
would return a _grouplist_ which contains all distinct group IDs in `sgids` and no group IDs not in `sgids`.
243
+
The group IDs in _grouplist_ SHOULD be in the same order as `sgids`.
244
+
245
+
When the configuration does not define `sgids`,
246
+
the container process MUST be started with its [supplementary group IDs][ieee-1003.1-2008-xbd-c3.378] set
247
+
such that a call to [getgroups][getgroups.2] from the container process
248
+
would return a _grouplist_ which contains all distinct group IDs specified by `additionalGids`.
249
+
The order of group IDs in `additionalGids` SHOULD be preserved in _grouplist_.
250
+
If the group ID specified by `gid` is not present in `additionalGids`,
251
+
the container process _grouplist_ MUST additionally have `gid` as index 0.
252
+
253
+
_Note: producers of configuration files which wish to be backwards-compatible
254
+
with runtimes that are only compliant with earlier revisions of the specification
255
+
should always include the `gid` group ID as the first item in the `additionalGids` array
256
+
to ensure that `gid` is a supplementary group ID of the container process.
257
+
Otherwise, processes in the container may be able to [bypass certain filesystem access controls.][negative-group-perms]_
258
+
259
+
_Note: producers of configuration files which require full control over the supplementary group IDs of the container process
260
+
should specify `sgids` and omit `additionalGids`,
261
+
and specify a revision of the specification which defines `sgids` as the configuration `ociVersion`.
262
+
As the security implications are subtle, use of the `sgids` field is discouraged._
239
263
240
264
_Note: symbolic name for uid and gid, such as uname and gname respectively, are left to upper levels to derive (i.e. `/etc/passwd` parsing, NSS, etc)_
241
265
@@ -987,12 +1011,16 @@ Here is a full example `config.json` for reference.
0 commit comments