Skip to content
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

Update security.pam.enableSudoTouchIdAuth for Sonoma+ #1109

Open
citizen428 opened this issue Oct 21, 2024 · 5 comments
Open

Update security.pam.enableSudoTouchIdAuth for Sonoma+ #1109

citizen428 opened this issue Oct 21, 2024 · 5 comments

Comments

@citizen428
Copy link

citizen428 commented Oct 21, 2024

Since macOS 14 (Sonoma), one can modify /etc/pam.d/sudo_local which will survive OS upgrades. By default, there's a file called /etc/pam.d/sudo_local.template with the following contents:

# sudo_local: local config file which survives system update and is included for sudo
# uncomment following line to enable Touch ID for sudo
#auth       sufficient     pam_tid.so

This gets included in /etc/pam.d/sudoers:

auth       include        sudo_local

It seems like a good idea to use this file so Touch ID for sudo will be available also right after upgrades, without having to run darwin-rebuild switch first.

@purcell
Copy link
Contributor

purcell commented Oct 21, 2024

I think this could be easily accomplished by making file here conditional on config.system.darwinVersion.

@citizen428 citizen428 changed the title Update pam.security.security.pam.enableSudoTouchIdAuth for Sonoma+ Update security.pam.enableSudoTouchIdAuth for Sonoma+ Oct 21, 2024
@citizen428
Copy link
Author

Yes, that should work, I briefly played around with that idea earlier today. In the end I just settled for this and removed the setting from my flake.nix, which is GoogEnough™ for me.

environment.etc = {
  "pam.d/sudo_local".text = ''
    auth sufficient pam_tid.so
  '';
};

@emilazy
Copy link
Collaborator

emilazy commented Oct 21, 2024

We should unconditionally generate sudo_local and retain only enough logic to add the auth include sudo_local line to /etc/pam.d/sudo when absent. See #1020 which I just realized I forgot to get around to reviewing again, oops :(

@purcell
Copy link
Contributor

purcell commented Oct 21, 2024

Oh, lol, I didn't see that PR!

@citizen428
Copy link
Author

Ugh, I only searched issues, not PRs, sorry. But I like your suggestion @emilazy, I think that's the best way forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants