Current version
Git/Latestdiff: 1.5.6
Latest Snapshots
Produced after each commit or rebase to new upstream version
GIT
RSBAC source code, can be unstable sometimes
No events planned
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
documentation:different_models:um [2006/05/02 13:40] – (old revision restored) 127.0.0.1 | documentation:different_models:um [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Traditional Linux user management subsystem ===== | ||
- | |||
- | The traditional Linux user management, specially the common passwd/ | ||
- | - PAM libraries running in process context: The PAM libraries are mapped into every process, which has to authenticate users or change user accounts. This means that every single such process must have read or even write access to sensitive authentication data, and an exploit in only one of them reveals all this sensitive information to an attacker. Not using PAM does not help here, because the process still needs the same access. | ||
- | - No granularity: | ||
- | - Changing passwords: Because of 2., a program which allows password changes by the user (usually passwd), also has access to all passwords. An admin account which is allowed to set new passwords for normal users, who tend to forget their passwords, can do the same for any user - including other admins. This means this admin can get access to all other admin accounts, even if direct access is not allowed through RSBAC access control. | ||
- | - Password attacks: As encrypted passwords are readable for too many processes, they can be guessed via dictionary attacks. Worse, the old crypt is easy to crack, and even the MD5 replacement is rumoured to be attackable with databases of precomputed MD5 strings. | ||
- | - Process choosing the uid to change to: Any process with sufficient rights (CAP_SETUID and CAP_SETGID in Linux) can change to any uid it wants. Even the RSBAC v1.2.3 AUTH module functionality does not help against buggy login programs - they are supposed to setuid to a big range of uids, and the kernel cannot tell whether these have been authenticated or not. | ||
- | - Current implementation of passwd/ | ||
- | |||
- | ===== Benefits of " | ||
- | |||
- | Now, what is the difference in the new RSBAC User Management? | ||
- | |||
- | - No process has direct access to user account or authentication data. All password checks etc. are done inside the kernel. The new RSBAC PAM and NSS modules only call the appropiate system calls, so an attack against a process mapping them does not help at all. | ||
- | - Access rights to user account and authentication data are separate for every single account. There are different rights for access to them: | ||
- | * SEARCH: Get the mapping between uid and name | ||
- | * GET_STATUS_DATA: | ||
- | * READ: Get the user info usually placed in shadow: password validity, expiring etc. Usually only needed for account management. | ||
- | * WRITE: Change group, homedir, fullname, shell or the info usually in shadow. | ||
- | * GET_PERMISSIONS_DATA: | ||
- | * MODIFY_PERMISSIONS_DATA: | ||
- | * CREATE: Add a new user. How this is checked depends on the security model. E.g. RC roles have a default_user_create_type, | ||
- | * DELETE: Delete a user account. | ||
- | * RENAME: Rename a user account. | ||
- | Group protection is very similar, only the number of settings is smaller. | ||
- | - See 2.: You need MODIFY_PERMISSIONS_DATA for the particular user, not for all users. | ||
- | - No one except the backup program can read the encrypted password, so offline password attacks are almost impossible. All an attacker can do is brute force through login, what will take a looooong time because of delays after each failure. | ||
- | - In combination with AUTH module, a login program can only setuid to the last authenticated uid. If it did not authenticate a uid against the kernel, setuid simply fails. To enable this, set AUTH auth_may_setuid to the new value last_auth_only or last_auth_and_gid. The latter allows to reach any group, because groups cannot be authenticated at login. Furthermore, | ||
- | - User and group data are always protected, so there is no such race condition. | ||
- | |||
- | |||
- | ===== Removal of the traditional subsystem ===== | ||
- | |||
- | You can remove the complete shadow suite with pam_unix, / | ||
- | |||
- | Still, I recommend keeping the PAM helper stuff, e.g. pam_cracklib.so. Just replace pam_unix.so in your PAM config files with pam_rsbac.so. | ||
- | |||
- | The rsbac_useradd and rsbac_groupadd commands can import existing accounts and groups, except for the passwords. These must be set manually for all accounts, RSBAC does not include password crackers. ;) Sure this has to happen before you remove pam_unix and the files and before you change PAM and NSS config. It is sometimes necessary to rerun the import to get cross dependencies between groups and users right. You can check your groups and users with rsbac_groupshow and rsbac_usershow. | ||
- | |||
- | The old {user|group}{add|mod|del}, | ||
- | |||
- | ==== How about programs and scripts working on / | ||
- | |||
- | After testing on real server systems, I can gladly say that almost all Linux programs use the standard library calls and are thus compatible with the new user/group scheme, if the PAM and NSS helper libraries have been installed and configured. | ||
- | |||
- | ===== Installation and Configuration ===== | ||
- | |||
- | User management (UM) must be enabled in RSBAC kernel configuration. To get passwords encrypted with SHA1, this algorithm must first be enabled in the kernel Crypto menu. Only with SHA1 enabled, the User Management menu will show the option for encryption! After configuration, | ||
- | |||
- | The RSBAC admin tools contain the necessary user and group management tools with the usual Linux names ({user|group}{add|mod|del}, | ||
- | |||
- | Both rsbac_useradd and rsbac_groupadd have options to convert existing users and groups. As standard Linux passwords are encrypted with another algorithm and salt size, they cannot be converted. Thus, passwords for converted users and groups must be reset, e.g. with the rsbac_usermod command. To get dependencies between users and groups right, run " | ||
- | |||
- | To enable normal Linux user programs to see and use RSBAC UM, you need to compile and install the NSS and PAM modules from the admin tools contrib dir. Change / | ||
- | |||
- | For soft migration and first tries, you can run passwd/ | ||
- | |||
- | New in 1.2.5: If you want to use pam_rsbac.so together with pam_cracklib.so, | ||
- | first ask for the new password before pam_rsbac asks.so for the old | ||
- | password. This behaviour breaks some programs, e.g. kdepasswd, and does not | ||
- | match most users' expectations. Thus, pam_rsbac_oldpw.so simply asks for the | ||
- | old password, stores it in PAM and returns success. An /etc/pam.d password | ||
- | file could look like this: | ||
- | |||
- | password required | ||
- | password required | ||
- | password required | ||
- | |||
- | After complete migration, you can enable UM exclusive mode to disallow all users and groups unknown to UM. auth_may_setuid settings should be changed from full to last_auth_and_gid to deny unauthenticated setuids, and AUTH caps should be properly reduced. | ||