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
Add --group-add keep-groups: suplimentary groups into container
Currently we have rootless users who want to leak their groups access
into containers, but this group access is only able to be pushed in by
a hard to find OCI Runtime annotation. This PR makes this option a lot
more visable and hides the complexity within the podman client.
This option is only really needed for local rootless users. It makes
no sense for remote clients, and probably makes little sense for
rootfull containers.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Copy file name to clipboardExpand all lines: docs/source/markdown/podman-create.1.md
+31-12Lines changed: 31 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -261,8 +261,8 @@ Note: if _host_device_ is a symbolic link then it will be resolved first.
261
261
The container will only store the major and minor numbers of the host device.
262
262
263
263
Note: if the user only has access rights via a group, accessing the device
264
-
from inside a rootless container will fail. The **crun**(1) runtime offers a
265
-
workaround for this by adding the option **\-\-annotation run.oci.keep_original_groups=1**.
264
+
from inside a rootless container will fail. Use the `--group-add keep-groups`
265
+
flag to pass the user's supplementary group access into the container.
266
266
267
267
Podman may load kernel modules required for using the specified
268
268
device. The devices that podman will load modules when necessary are:
@@ -361,9 +361,17 @@ GID map for the user namespace. Using this flag will run the container with user
361
361
362
362
The following example maps uids 0-2000 in the container to the uids 30000-31999 on the host and gids 0-2000 in the container to the gids 30000-31999 on the host. `--gidmap=0:30000:2000`
363
363
364
-
#### **\-\-group-add**=*group*
364
+
#### **\-\-group-add**=*group|keep-groups*
365
365
366
-
Add additional groups to run as
366
+
Add additional groups to assign to primary user running within the container process.
367
+
368
+
-`keep-groups` is a special flag that tells Podman to keep the supplementary group access.
369
+
370
+
Allows container to use the user's supplementary group access. If file systems or
371
+
devices are only accessible by the rootless user's group, this flag tells the OCI
372
+
runtime to pass the group access into the container. Currently only available
373
+
with the `crun` OCI runtime. Note: `keep-groups` is exclusive, you cannot add any other groups
374
+
with this flag. (Not available for remote commands)
-**container:**_id_: reuse another container's network stack;
636
644
-**host**: use the Podman host network stack. Note: the host mode gives the container full access to local system services such as D-bus and is therefore considered insecure;
637
-
-_network-id_: connect to a user-defined network, multiple networks should be commaseparated;
645
+
-_network-id_: connect to a user-defined network, multiple networks should be comma-separated;
638
646
-**ns:**_path_: path to a network namespace to join;
639
647
-**private**: create a new namespace for the container (default)
640
648
-**slirp4netns[:OPTIONS,...]**: use **slirp4netns**(1) to create a user network stack. This is the default for rootless containers. It is possible to specify these additional options:
@@ -861,6 +869,8 @@ Security Options
861
869
-`label=filetype:TYPE` : Set the label file type for the container files
862
870
-`label=disable` : Turn off label separation for the container
863
871
872
+
Note: Labeling can be disabled for all containers by setting label=false in the **containers.conf** (`/etc/containers/containers.conf` or `$HOME/.config/containers/containers.conf`) file.
873
+
864
874
-`mask=/path/1:/path/2` : The paths to mask separated by a colon. A masked path
865
875
cannot be accessed inside the container.
866
876
@@ -869,13 +879,13 @@ Security Options
869
879
-`seccomp=unconfined` : Turn off seccomp confinement for the container
870
880
-`seccomp=profile.json` : White listed syscalls seccomp Json file to be used as a seccomp filter
871
881
882
+
-`proc-opts=OPTIONS` : Comma-separated list of options to use for the /proc mount. More details for the
883
+
possible mount options are specified in the **proc(5)** man page.
884
+
872
885
-`unmask=ALL or /path/1:/path/2` : Paths to unmask separated by a colon. If set to **ALL**, it will
873
886
unmask all the paths that are masked or made read only by default.
874
887
The default masked paths are **/proc/acpi, /proc/kcore, /proc/keys, /proc/latency_stats, /proc/sched_debug, /proc/scsi, /proc/timer_list, /proc/timer_stats, /sys/firmware, and /sys/fs/selinux.** The default paths that are read only are **/proc/asound, /proc/bus, /proc/fs, /proc/irq, /proc/sys, /proc/sysrq-trigger, /sys/fs/cgroup**.
875
888
876
-
-`proc-opts=OPTIONS` : Comma separated list of options to use for the /proc mount. More details for the
877
-
possible mount options are specified at **proc(5)** man page.
878
-
879
889
Note: Labeling can be disabled for all containers by setting label=false in the **containers.conf** (`/etc/containers/containers.conf` or `$HOME/.config/containers/containers.conf`) file.
880
890
881
891
#### **\-\-shm-size**=*size*
@@ -1093,9 +1103,9 @@ Create a bind mount. If you specify, ` -v /HOST-DIR:/CONTAINER-DIR`, Podman
1093
1103
bind mounts `/HOST-DIR` in the host to `/CONTAINER-DIR` in the Podman
1094
1104
container. Similarly, `-v SOURCE-VOLUME:/CONTAINER-DIR` will mount the volume
1095
1105
in the host to the container. If no such named volume exists, Podman will
1096
-
create one. The `OPTIONS` are a comma delimited list and can be: <sup>[[1]](#Footnote1)</sup> (Note when using the remote client, the volumes will be mounted from the remote server, not necessarly the client machine.)
1106
+
create one. The `OPTIONS` are a comma-separated list and can be: <sup>[[1]](#Footnote1)</sup> (Note when using the remote client, the volumes will be mounted from the remote server, not necessarly the client machine.)
1097
1107
1098
-
The _options_ is a comma delimited list and can be:
1108
+
The _options_ is a comma-separated list and can be:
1099
1109
1100
1110
***rw**|**ro**
1101
1111
***z**|**Z**
@@ -1185,7 +1195,7 @@ host into the container to allow speeding up builds.
1185
1195
Content mounted into the container is labeled with the private label.
1186
1196
On SELinux systems, labels in the source directory must be readable
1187
1197
by the container label. Usually containers can read/execute `container_share_t`
1188
-
and can read/write `container_file_t`. If you can not change the labels on a
1198
+
and can read/write `container_file_t`. If you cannot change the labels on a
1189
1199
source volume, SELinux container separation must be disabled for the container
1190
1200
to work.
1191
1201
- The source directory mounted into the container with an overlay mount
@@ -1245,10 +1255,14 @@ will convert /foo into a `shared` mount point. Alternatively one can directly
1245
1255
change propagation properties of source mount. Say `/` is source mount for
1246
1256
`/foo`, then use `mount --make-shared /` to convert `/` into a `shared` mount.
1247
1257
1258
+
Note: if the user only has access rights via a group, accessing the volume
1259
+
from inside a rootless container will fail. Use the `--group-add keep-groups`
1260
+
flag to pass the user's supplementary group access into the container.
Copy file name to clipboardExpand all lines: docs/source/markdown/podman-pod-create.1.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,7 +125,7 @@ If another pod with the same name already exists, replace and remove it. The de
125
125
126
126
#### **\-\-share**=*namespace*
127
127
128
-
A comma delimited list of kernel namespaces to share. If none or "" is specified, no namespaces will be shared. The namespaces to choose from are ipc, net, pid, uts.
128
+
A comma-separated list of kernel namespaces to share. If none or "" is specified, no namespaces will be shared. The namespaces to choose from are ipc, net, pid, uts.
129
129
130
130
The operator can identify a pod in three ways:
131
131
UUID long identifier (“f78375b1c487e03c9438c729345e54db9d20cfa2ac1fc3494b6eb60872e74778”)
Copy file name to clipboardExpand all lines: docs/source/markdown/podman-run.1.md
+35-10Lines changed: 35 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -299,8 +299,8 @@ Note: if _host_device_ is a symbolic link then it will be resolved first.
299
299
The container will only store the major and minor numbers of the host device.
300
300
301
301
Note: if the user only has access rights via a group, accessing the device
302
-
from inside a rootless container will fail. The **crun**(1) runtime offers a
303
-
workaround for this by adding the option **\-\-annotation run.oci.keep_original_groups=1**.
302
+
from inside a rootless container will fail. Use the `--group-add keep-groups`
303
+
flag to pass the user's supplementary group access into the container.
304
304
305
305
Podman may load kernel modules required for using the specified
306
306
device. The devices that Podman will load modules when necessary are:
@@ -405,9 +405,17 @@ Meaning **groupname** is initially mapped to gid **100000** which is referenced
405
405
above: The group **groupname** is mapped to group **100000** of the initial namespace then the
406
406
**30000**st id of this namespace (which is gid 130000 in this namespace) is mapped to container namespace group id **0**. (groupname -> 100000 / 30000 -> 0)
407
407
408
-
#### **\-\-group-add**=*group*
408
+
#### **\-\-group-add**=*group|keep-groups*
409
409
410
-
Add additional groups to run as
410
+
Add additional groups to assign to primary user running within the container process.
411
+
412
+
-`keep-groups` is a special flag that tells Podman to keep the supplementary group access.
413
+
414
+
Allows container to use the user's supplementary group access. If file systems or
415
+
devices are only accessible by the rootless user's group, this flag tells the OCI
416
+
runtime to pass the group access into the container. Currently only available
417
+
with the `crun` OCI runtime. Note: `keep-groups` is exclusive, you cannot add any other groups
418
+
with this flag. (Not available for remote commands)
-**container:**_id_: reuse another container's network stack;
672
680
-**host**: use the Podman host network stack. Note: the host mode gives the container full access to local system services such as D-bus and is therefore considered insecure;
673
-
-_network-id_: connect to a user-defined network, multiple networks should be commaseparated;
681
+
-_network-id_: connect to a user-defined network, multiple networks should be comma-separated;
674
682
-**ns:**_path_: path to a network namespace to join;
675
683
-**private**: create a new namespace for the container (default)
676
684
-**slirp4netns[:OPTIONS,...]**: use **slirp4netns**(1) to create a user network stack. This is the default for rootless containers. It is possible to specify these additional options:
@@ -905,19 +913,27 @@ Security Options
905
913
906
914
-**apparmor=unconfined** : Turn off apparmor confinement for the container
907
915
-**apparmor**=_your-profile_ : Set the apparmor confinement profile for the container
916
+
908
917
-**label=user:**_USER_: Set the label user for the container processes
909
918
-**label=role:**_ROLE_: Set the label role for the container processes
910
919
-**label=type:**_TYPE_: Set the label process type for the container processes
911
920
-**label=level:**_LEVEL_: Set the label level for the container processes
912
921
-**label=filetype:**TYPE_: Set the label file type for the container files
913
922
-**label=disable**: Turn off label separation for the container
923
+
924
+
Note: Labeling can be disabled for all containers by setting label=false in the **containers.conf** (`/etc/containers/containers.conf` or `$HOME/.config/containers/containers.conf`) file.
925
+
914
926
-**mask**=_/path/1:/path/2_: The paths to mask separated by a colon. A masked path
915
927
cannot be accessed inside the container.
928
+
916
929
-**no-new-privileges**: Disable container processes from gaining additional privileges
930
+
917
931
-**seccomp=unconfined**: Turn off seccomp confinement for the container
918
932
-**seccomp**=_profile.json_: Allowed syscall list seccomp JSON file to be used as a seccomp filter
919
-
-**proc-opts**=_OPTIONS_ : Comma separated list of options to use for the /proc mount. More details
920
-
for the possible mount options are specified at **proc(5)** man page.
933
+
934
+
-**proc-opts**=_OPTIONS_ : Comma-separated list of options to use for the /proc mount. More details
935
+
for the possible mount options are specified in the **proc(5)** man page.
936
+
921
937
-**unmask**=_ALL_ or _/path/1:/path/2_: Paths to unmask separated by a colon. If set to **ALL**, it will
922
938
unmask all the paths that are masked or made read only by default.
923
939
The default masked paths are **/proc/acpi, /proc/kcore, /proc/keys, /proc/latency_stats, /proc/sched_debug, /proc/scsi, /proc/timer_list, /proc/timer_stats, /sys/firmware, and /sys/fs/selinux.**. The default paths that are read only are **/proc/asound**, **/proc/bus**, **/proc/fs**, **/proc/irq**, **/proc/sys**, **/proc/sysrq-trigger**, **/sys/fs/cgroup**.
@@ -1164,7 +1180,7 @@ container. Similarly, _SOURCE-VOLUME_:_/CONTAINER-DIR_ will mount the volume
1164
1180
in the host to the container. If no such named volume exists, Podman will
1165
1181
create one. (Note when using the remote client, the volumes will be mounted from the remote server, not necessarly the client machine.)
1166
1182
1167
-
The _options_ is a comma delimited list and can be: <sup>[[1]](#Footnote1)</sup>
1183
+
The _options_ is a comma-separated list and can be: <sup>[[1]](#Footnote1)</sup>
1168
1184
1169
1185
***rw**|**ro**
1170
1186
***z**|**Z**
@@ -1252,7 +1268,7 @@ host into the container to allow speeding up builds.
1252
1268
Content mounted into the container is labeled with the private label.
1253
1269
On SELinux systems, labels in the source directory must be readable
1254
1270
by the container label. Usually containers can read/execute `container_share_t`
1255
-
and can read/write `container_file_t`. If you can not change the labels on a
1271
+
and can read/write `container_file_t`. If you cannot change the labels on a
1256
1272
source volume, SELinux container separation must be disabled for the container
1257
1273
to work.
1258
1274
- The source directory mounted into the container with an overlay mount
@@ -1314,10 +1330,14 @@ will convert /foo into a shared mount point. Alternatively, one can directly
1314
1330
change propagation properties of source mount. Say, if _/_ is source mount for
1315
1331
_/foo_, then use **mount --make-shared /** to convert _/_ into a shared mount.
1316
1332
1333
+
Note: if the user only has access rights via a group, accessing the volume
1334
+
from inside a rootless container will fail. Use the `--group-add keep-groups`
1335
+
flag to pass the user's supplementary group access into the container.
0 commit comments