-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Authentication error after activate pam_tcb #14
Comments
Error log if change password.
From user:
cc @solardiz |
@Izorkin I don't know what exactly went wrong. Did Anyway, I suggest you check file permissions:
|
What parameters are responsible for this? I am currently trying out tcb on a test virtual machine.
drwxr-xr-x 17 root root 4096 Dec 4 15:27 /
|
My best guess is you didn't install the NSS module in place, so it's not picked up by your glibc... and do you even use glibc?
Kind of none - this was supposed to work on its own, by simply replacing |
Yes, using glibc. NSS loads library from |
I was able to load
|
No. (That would be a vulnerability when NSS is used by a SUID/SGID program.) I guess glibc only checks one or a few hard-coded locations. We normally install |
I was able to load the module with the
|
That's good to know. Please note that
That's the caching service only, and I think it's obsolete anyway. We don't normally run it at all on systems with tcb. I think you just need to put the NSS module in place... but that may be inconsistent with NixOS philosophy? If so, maybe add I'll close this issue now since it's not an issue we need to track (nothing wrong with |
This variant not working. |
I'm not sure exactly why not, but here are two observations:
If you omit the prior module (in our case,
|
Manually copying the library |
@solardiz is it safe to leave the
Or move it to |
The extra directory layer provides an extra level of security separation, if you restrict permissions on the directory such that its content is only accessible by a group and you grant that group membership to just the right programs. For example, you can set the directory permissions to 710 with group
For the GNU
and
that's a trick to provide an SGID binary access to two limited-access SGID helper programs at once. Please note that we use hard-links there (note the link counts of 2 on the program binaries), managed by triggers in the corresponding packages. This is tricky, and can only reasonably be pulled off at distro level, with agreed upon conventions and with packages playing together well. So if you're not going to modify other packages, you probably have to make this helper world-accessible. This isn't meant to introduce a vulnerability - it is just not the safest mode possible. Summary: yes, it's kind of safe, and the alternative is probably overly complicated in your case. |
Thanks for details! Is there a patch to integrate tcb support into glibc? |
No, I think there is not. |
Eh, it would be easier to activate tcb support in NixOS. |
Please note that for security you need to remove |
Did I describe the purpose of groups correctly?
|
No, maybe except for
|
Thanks. |
The
|
@solardiz we use nscd as a /non-caching/ NSS lookup dispatcher in NixOS. The whole reasoning is documented in https://flokli.de/posts/2022-11-18-nsncd/. Can you see any reason to why doing NSS lookups that way would not work? |
Since nscd is a threaded process, the use of static variables in libnss_tcb via libtcb might be problematic. |
@ldv-alt require building package using cmake? Is there an alternative way to use this parametr?
|
As tcb can be built using a regular make, there is no cmake support. |
Should it be like this?
|
Yes, I mean something like |
What parameters to add for optimization? |
On Sat, Dec 24, 2022 at 03:27:03PM -0800, Dmitry V. Levin wrote:
Since nscd is a threaded process, the use of static variables in libnss_tcb via libtcb might be problematic.
Anyway, please make sure you build tcb with -DENABLE_SETFSUGID, otherwise libtcb would use `setreuid` and `setregid` which affect the whole nscd process.
I've had a look, even with -DENABLE_SETFSUGID set both tcb_drop_priv_r()
and tcb_gain_priv_r() are not quite thread-safe because of setgroups()
calls which per POSIX affect all threads. This is probably not a big deal
for nscd, though, as the worst thing that could happen to nscd is a
permanent loss of supplementary groups.
|
On Sun, Dec 25, 2022 at 02:34:02AM -0800, Yurii Izorkin wrote:
What parameters to add for optimization?
Whatever you use for security sensitive software should be OK.
|
Compiled tcb with the flag |
@Izorkin i don't think this is still on-topic. Let's take this over to NixOS/nixpkgs#109457. |
@solardiz found another error - unable to change password for normal user.
The Error:
|
Sorry, I disabled the password change in the NixOS configuration and forgot about it. It's working now. |
Can these errors be ignored?
|
I'm surprised you're getting those, but yes I guess they can be ignored if everything works for you. |
@ldv-alt Should we possibly switch to using the |
I'm inclined to agree. At least, I see no potential benefits in keeping the non- |
Steps taken:
--with-tcb --with-bcrypt --with-yescrypt
./etc/nsswitch.conf
:/etc/login.defs
:auth
tcb_convert
After all changes, when I try to log in I get an error:
The text was updated successfully, but these errors were encountered: