How Do I use LDAP / Active Directory Users with Rootless Podman, Buildah or Skopeo?
How Do I use LDAP / Active Directory Users with Rootless Podman, Buildah or Skopeo?
Environment
- Red Hat Enterprise Linux 7
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
Issue
- I have a system which uses LDAP or Active Directory for user management and authentication.
- How do we ensure users can use rootless podman and other container-tools even when they are not local users?
Resolution
- Currently, no automatic method of adding the necessary subuid or subgid ranges to allow for rootless containerisation exists.
- For each user that logs in, a separate entry to the
/etc/subuidand/etc/subgidfiles must be added in order for rootless podman to function, in order to allocate user namespaces to the rootless user. - For information on how to properly update the
/etc/subuidand/etc/subgidranges, please refer to the following articles: - In the below “Root Cause” section, the current efforts to automate this process is discussed. No solution exists at the time of writing this article, but solutions are being explored.
Root Cause
- The
container-toolsutilities such aspodman,buildah, orskopeorely on thenewuidmapandnewgidmapbinaries provided by theshadow-utilspackage in order to allocate user namespace ranges for rootless users. - Currently, the
shadow-utilspackage does not support automatic adding or updating sub-UID or sub-GID ranges automatically for non-local users. When creating a local user viaadduseroruseradd, the ranges can be automatically updated; however, no such process exists for remote users. - A Github Request for Feature Enhancement to Podman was added discussing allowing
podmanto support such a system to allow remote users access to user namespaces automatically, where it was noted that first theshadow-utilspackage must first accommodate any utilities that desire this automation. - A Github Issue against the
shadow-maintpackage discusses the issue in more detail, specifically how the new addition oflibsubidwill allow utilities such asnewuidmapandnewgidmapto allow for mapping ranges of user ID’s without needing to manually configure files. - The addition of
libsubidwas added toshadow-maintin this Github Commit. - A new release of
shadow-utilswith the abovelibsubidaddition is necessary upstream first, and when that is completed, the corecontainers/storagepackage thatpodman,skopeo, andbuildahrely on can take advantage oflibsubidvia this Github discussion. - Effectively, the steps to involve automatically allocated user namespace ID’s to remote users can only be added when:
- A new version of
shadow-utilsis shipped upstream withlibsubidsupport. - The container library
containers/storageadopts the usage oflibsubid. - Red Hat has ample time to QA and test the above additions prior to releasing them into a version of container tooling that is available to customers.
- A new version of
-
Attempts to keep this article updated with upstream developments will be made as this feature nears closer to release.
- Product(s)
- Component
- buildah
- container-tools
- podman
- Category
- Tags
- active_directory
- buildah
- containers
- ldap
- podman
- skopeo