*sudo* now runs PAM stack even when no authentication is required
With this update, the *sudo* utility runs Pluggable Authentication Module (PAM) account management modules even when the "NOPASSWD" option is configured in the policy. This enables checking for restrictions imposed by PAM modules outside of the authentication phase. As a result, PAM modules, such as `pam_time`, now work properly in the described scenario.
DescriptionThorsten Scherf
2018-01-12 16:35:02 UTC
Description of problem:
sudo skips the PAM account phase and therefore also skips the pam_time module which results in failed time based account restriction.
sudo should use 'pam_acct_mgmt()' in case no authentication is required. The function is fully independent of 'pam_authenticate()'.
http://www.linux-pam.org/Linux-PAM-html/adg-interface-by-app-expected.html#adg-pam_acct_mgmt
Version-Release number of selected component (if applicable):
all versions of sudo are affected.
How reproducible:
/etc/sudoers:
foobar ALL=(ALL) NOPASSWD: ALL
/etc/pam.d/sudo:
account required pam_time.so
/etc/security/time.conf:
sudo;*;*;!Al0000-24000
sudo still works for the 'foobar' user. Expectation is that sudo is failing.
Steps to Reproduce:
1.
2.
3.
Actual results:
Expected results:
Additional info:
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHEA-2018:3199