about summary refs log tree commit diff
path: root/nixos/doc
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2018-12-12 14:03:13 +0100
committerFlorian Klink <flokli@flokli.de>2018-12-21 15:31:07 +0100
commitd180bf3862e7c0c6ca7e5963f575483b69e7f04b (patch)
tree86e4cfe811307559805c504cf69ec3c9cf04ac27 /nixos/doc
parentaf6c117facb2c6c4913d701dc8733ed1780e93da (diff)
downloadnixlib-d180bf3862e7c0c6ca7e5963f575483b69e7f04b.tar
nixlib-d180bf3862e7c0c6ca7e5963f575483b69e7f04b.tar.gz
nixlib-d180bf3862e7c0c6ca7e5963f575483b69e7f04b.tar.bz2
nixlib-d180bf3862e7c0c6ca7e5963f575483b69e7f04b.tar.lz
nixlib-d180bf3862e7c0c6ca7e5963f575483b69e7f04b.tar.xz
nixlib-d180bf3862e7c0c6ca7e5963f575483b69e7f04b.tar.zst
nixlib-d180bf3862e7c0c6ca7e5963f575483b69e7f04b.zip
security.pam: make pam_unix.so required, not sufficient
Having pam_unix set to "sufficient" means early-succeeding account
management group, as soon as pam_unix.so is succeeding.

This is not sufficient. For example, nixos modules might install nss
modules for user lookup, so pam_unix.so succeeds, and we end the stack
successfully, even though other pam account modules might want to do
more extensive checks.

Other distros seem to set pam_unix.so to 'required', so if there are
other pam modules in that management group, they get a chance to do some
validation too.

For SSSD, @PsyanticY already added a workaround knob in
https://github.com/NixOS/nixpkgs/pull/31969, while stating this should
be the default anyway.

I did some thinking in what could break - after this commit, we require
pam_unix to succeed, means we require `getent passwd $username` to
return something.
This is the case for all local users due to the passwd nss module, and
also the case for all modules installing their nss module to
nsswitch.conf - true for ldap (if not explicitly disabled) and sssd.

I'm not so sure about krb5, cc @eqyiel for opinions. Is there some nss
module loaded? Should the pam account module be placed before pam_unix?

We don't drop the `security.pam.services.<name?>.sssdStrictAccess`
option, as it's also used some lines below to tweak error behaviour
inside the pam sssd module itself (by changing it's 'control' field).

This is also required to get admin login for Google OS Login working
(#51566), as their pam_oslogin_admin accounts module takes care of sudo
configuration.
Diffstat (limited to 'nixos/doc')
-rw-r--r--nixos/doc/manual/release-notes/rl-1903.xml16
1 files changed, 16 insertions, 0 deletions
diff --git a/nixos/doc/manual/release-notes/rl-1903.xml b/nixos/doc/manual/release-notes/rl-1903.xml
index 69e94fbccc5c..7bc887693376 100644
--- a/nixos/doc/manual/release-notes/rl-1903.xml
+++ b/nixos/doc/manual/release-notes/rl-1903.xml
@@ -318,6 +318,22 @@
      case.
    </para>
   </listitem>
+  <listitem>
+   <para>
+     The <literal>pam_unix</literal> account module is now loaded with its
+     control field set to <literal>required</literal> instead of
+     <literal>sufficient</literal>, so that later pam account modules that
+     might do more extensive checks are being executed.
+     Previously, the whole account module verification was exited prematurely
+     in case a nss module provided the account name to
+     <literal>pam_unix</literal>.
+     The LDAP and SSSD NixOS modules already add their NSS modules when
+     enabled. In case your setup breaks due to some later pam account module
+     previosuly shadowed, or failing NSS lookups, please file a bug. You can
+     get back the old behaviour by manually setting
+     <literal><![CDATA[security.pam.services.<name?>.text]]></literal>.
+   </para>
+  </listitem>
   </itemizedlist>
  </section>