|
| 1 | +LSB Specification Proposal |
| 2 | + |
| 3 | +Problem Statement: |
| 4 | +------------------ |
| 5 | + |
| 6 | +For administrators and certain types of applications it is important to have |
| 7 | +a cross distribution consistent naming policy for system created users. In |
| 8 | +certain cases it is also important to have a consistent user and group ids |
| 9 | +(UID & GID) for system created users. |
| 10 | + |
| 11 | +The various available cloud frameworks such as OpenStack, openNebula, |
| 12 | +CloudStack, and Eucalyptus come to mind. All cloud frameworks have services |
| 13 | +running on all the nodes in a cluster that comprises the cloud on the hardware |
| 14 | +side. It is generally possible to configure image sharing in these frameworks |
| 15 | +via NFS and thus the user name, UID, and GID need to match on all installations |
| 16 | +to provide the proper access permissions. This requirement reduces to |
| 17 | +consistent user names with NFSv4, but the adoption rate of NFSv4 is unknown. |
| 18 | +Additionally services for cloud frameworks may be configured in an HA |
| 19 | +environment and may not tolerate fail-over with UID transitioning. |
| 20 | + |
| 21 | +In an environment where LDAP is used system administrators may pre-create |
| 22 | +system users through the LDAP mechanism. This is difficult if different |
| 23 | +user names and UID as well as GID implementations exist across various |
| 24 | +distributions. |
| 25 | + |
| 26 | +Last but not least system users, i.e. names created through distribution |
| 27 | +provided packages, may collide with names created for "regular" system |
| 28 | +users. A common pattern for user names on Unix systems is to combine |
| 29 | +letters of the users name, many combinations of first and last name letters |
| 30 | +are in use. This may lead to combinations that may overlap with system user |
| 31 | +names. Sharing a user name between a system user and a person user leads |
| 32 | +to surprising or even security relevant misbehavior as the daemon user |
| 33 | +may write to files in the real user's home or vice versa. |
| 34 | + |
| 35 | +A cross distribution solution will also give upstream projects an avenue to |
| 36 | +determine user names when needed and ensure that distributions are consistent |
| 37 | +eliminating one potential source of issues for upstream projects |
| 38 | + |
| 39 | + |
| 40 | +Proposed Solution: |
| 41 | +-------------------- |
| 42 | + |
| 43 | +The proposal is to adopt a consistent naming an numbering convention across |
| 44 | +Linux distributions. The proposed solution is 3 fold to address 3 distinct |
| 45 | +problems described in the Problem Statement above. |
| 46 | + |
| 47 | +1.) Consistent grouping of system users, system users are defined as those |
| 48 | + users created by distribution packages. |
| 49 | +2.) Create a naming convention for system users |
| 50 | +3.) Create prescribed user IDs for specific system users that need to be |
| 51 | + consistent across distributions. |
| 52 | + |
| 53 | +1.) It is proposed to consider using a grouping similar to the existing |
| 54 | +Debian numbering policy documented here: https://www.debian.org/doc/debian-policy/ch-opersys.html#s9.2.1 . This provides the option of assigning "fixed" UIDs |
| 55 | +for those processes that need them in either the range of 1 - 99 (0 being |
| 56 | +already allocated for root) or in the 60000 - 64999 range. Although is expected |
| 57 | +that only few (famous last words) system users need a consistent UID across |
| 58 | +distributions it is probably best to allocate fixed IDs in the 60000 range to |
| 59 | +avoid interfereing with existing IDs used by various distributions in the |
| 60 | +0-99 range. It should be up to the upstream projects or packagers of |
| 61 | +that code to make a case for a static UID/GID. |
| 62 | + |
| 63 | +Some of the current policies: |
| 64 | + |
| 65 | +Debian |
| 66 | +------ |
| 67 | +https://www.debian.org/doc/debian-policy/ch-opersys.html#s9.2.1 |
| 68 | + |
| 69 | +0-99: |
| 70 | + pre-allocated fixed uids |
| 71 | + http://anonscm.debian.org/gitweb/?p=users/cjwatson/base-passwd.git;a=blob;f=passwd.master;h=7cd4e24bfcb6f4595dec40524fec5cc2f98fe962;hb=HEAD |
| 72 | + |
| 73 | +100-999: |
| 74 | + dynamically allocated system users |
| 75 | + |
| 76 | +1000-59999: |
| 77 | + user accounts |
| 78 | + |
| 79 | +60000-64999: |
| 80 | + reserved fixed uids, created on demand for 'obscure' packages. |
| 81 | + Registry of user names is here: |
| 82 | + http://anonscm.debian.org/gitweb/?p=users/cjwatson/base-passwd.git;a=blob;f=README;h=664277f47e5aec143278d9a3fff3b6c4a7ed4895;hb=HEAD |
| 83 | + |
| 84 | +65000-65533: |
| 85 | + unused |
| 86 | + |
| 87 | +Fedora |
| 88 | +------ |
| 89 | +from |
| 90 | +http://pkgs.fedoraproject.org/cgit/shadow-utils.git/tree/shadow-utils.login.defs |
| 91 | + |
| 92 | +0-200: |
| 93 | + reserved fixed uids, most created on demand |
| 94 | + https://git.fedorahosted.org/cgit/setup.git/tree/passwd |
| 95 | + Registry: |
| 96 | + https://git.fedorahosted.org/cgit/setup.git/tree/uidgid |
| 97 | + looking at that file it seems they are running out of uids there |
| 98 | + |
| 99 | +201-999: |
| 100 | + dynamically allocated system users |
| 101 | + |
| 102 | +1000-60000: |
| 103 | + user accounts |
| 104 | + |
| 105 | +Gentoo |
| 106 | +------ |
| 107 | +login.defs seems to be unmodified from shadow package |
| 108 | + |
| 109 | +0-100: |
| 110 | + reserved fixed uids (+250 which is hardcoded to portage) |
| 111 | + http://sources.gentoo.org/cgi-bin/viewvc.cgi/baselayout/trunk/share.Linux/passwd?revision=3110&view=markup |
| 112 | + Some created on demand but no central registry seems to exist |
| 113 | + |
| 114 | +101-999: |
| 115 | + dynamically allocated system users |
| 116 | + |
| 117 | +1000-60000: |
| 118 | + user accounts |
| 119 | + |
| 120 | +SUSE |
| 121 | +---- |
| 122 | +from /etc/login.defs, pkg shadow |
| 123 | + |
| 124 | +0-99: |
| 125 | + reserved fixed uids, some created on demand by packages but no |
| 126 | + registry for those |
| 127 | + |
| 128 | +100-499: |
| 129 | + dynamically allocated system users |
| 130 | + |
| 131 | +500-999: |
| 132 | + unused |
| 133 | + |
| 134 | +1000-60000: |
| 135 | + user accounts |
| 136 | + |
| 137 | + |
| 138 | +Thanks to Ludwig Nussel for doing the leg work and collecting this information. |
| 139 | +The registry of users could rest with the LSB work group. |
| 140 | + |
| 141 | +2.) We should establish a naming convention for all users created by packages. |
| 142 | +The chosen convention should diminish the collision likelihood between users |
| 143 | +created by the system administrator, i.e. "real" users and system users. In a |
| 144 | +discussion on the openSUSE list it was proposed to prefix system user names |
| 145 | +with an "_" (underscore.) This has precedence in openBSD, the proposal for |
| 146 | +this prefix and a rationale can be found here: |
| 147 | +https://github.com/lnussel/osep_opensuse_usernames/blob/master/opensuse_usernames.txt. Using "_" as a prefix appears to be a reasonable solution |
| 148 | +and thus this is nominated as the solution to adopt. |
| 149 | + |
| 150 | +3.) Using fixed UID/GID for certain types of system users across distributions |
| 151 | +will allow users to install multiple distributions and use the distribution |
| 152 | +provided packages without having to take special care of the creation of |
| 153 | +UIDs and GIDs for these users. The primary candidates for cross distribution |
| 154 | +consistent UDS and GIDs are the known cloud frame works, CloudStack, |
| 155 | +Eucalyptus, openNebula, and OpenStack. All frameworks support storage access |
| 156 | +via NFS for image storage or may be setup in a HA environment. While NFSv4 |
| 157 | +supports different UIDs/GIDs for the same user on different installations, the |
| 158 | +penetration of NFSv4 may not be sufficiently high to eliminate this need. In |
| 159 | +an HA fail over environment the potential change in UID of the user on one |
| 160 | +machine and another UID on the fail over machine may not be tolerated. It is |
| 161 | +therefore proposed that the created system users for the cloud frameworks |
| 162 | +be assigned consistent user IDs across distributions start with 99 and working |
| 163 | +down, the order is not of material interest. |
| 164 | + |
| 165 | +_oneadmin -> 60001 (system user for openNebula) |
| 166 | +_openstack -> 60002 |
| 167 | +_cloudstack -> 60003 |
| 168 | +_eucalyptus -> 60004 |
| 169 | + |
| 170 | +Using the proposed "_" prefix for the proposed IDs for the cloud frameworks. |
| 171 | + |
| 172 | + |
| 173 | +Solution Discussion Links: |
| 174 | +-------------------------- |
| 175 | + |
| 176 | +Discussion on openSUSE-Factory ML concerning the introduction of "_" as a |
| 177 | +prefix naming convention for system users. |
| 178 | +http://lists.opensuse.org/opensuse-factory/2014-03/msg00333.html |
| 179 | + |
| 180 | +Fedora: http://permalink.gmane.org/gmane.linux.redhat.fedora.devel/194771 |
| 181 | + |
| 182 | + |
| 183 | + |
| 184 | +Solution Rationale: |
| 185 | +------------------ |
| 186 | + |
| 187 | +Provide a brief description how the documented solution was derived. |
| 188 | + |
| 189 | + |
| 190 | +Distributions Support: |
| 191 | +---------------------- |
| 192 | + |
| 193 | +A list of distributions that have pledged to adhere to this specification and |
| 194 | +integrate the test into their QA suite. |
| 195 | + |
| 196 | + |
| 197 | +Verification Test: |
| 198 | +------------------ |
| 199 | + |
| 200 | +tests/distro/userNames.py |
| 201 | +tests/distro/groupNames.py |
0 commit comments