RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2082442 - pam_faillock prints "Consecutive login failures for user root account temporarily locked" without even_deny_root
Summary: pam_faillock prints "Consecutive login failures for user root account tempora...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: pam
Version: 8.5
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Iker Pedrosa
QA Contact: Anuj Borah
URL:
Whiteboard: review
Depends On:
Blocks: 2126648
TreeView+ depends on / blocked
 
Reported: 2022-05-06 07:17 UTC by Sunny Wu
Modified: 2023-05-16 10:58 UTC (History)
3 users (show)

Fixed In Version: pam-1.3.1-25.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2126648 (view as bug list)
Environment:
Last Closed: 2023-05-16 09:02:48 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github RedHatQE pam pull 59 0 None open pam_faillock prints "Consecutive login failures for user root account temporarily locked" without even_deny_root 2022-10-21 15:08:58 UTC
Red Hat Issue Tracker RHELPLAN-121246 0 None None None 2022-05-06 07:44:31 UTC
Red Hat Issue Tracker SSSD-4654 0 None None None 2022-05-06 10:58:33 UTC
Red Hat Knowledge Base (Solution) 6956969 0 None None None 2022-05-09 06:42:17 UTC
Red Hat Product Errata RHBA-2023:2954 0 None None None 2023-05-16 09:03:00 UTC

Description Sunny Wu 2022-05-06 07:17:34 UTC
Description of problem:

pam_faillock prints "Consecutive login failures for user root account temporarily locked" without even_deny_root

pam_faillock/faillock.conf contains default configuration. e.g. both even_deny_root and root_unlock_time are commented out.

When `root` deliberately authenticate with incorrect password, below error message is logged in /var/log/secure although the account is not actually locked.

   "Consecutive login failures for user root account temporarily locked" 

After this error message is recorded in /var/log/secure, root is able to login successfully with correct password.

~~~
root@node-0 ~]# su - jane
Last login: Fri May  6 16:51:21 AEST 2022 on pts/1
[jane@node-0 ~]$ su -
Password: 
su: Authentication failure
[jane@node-0 ~]$ su -
Password: 
su: Authentication failure
[jane@node-0 ~]$ su -
Password: 
su: Authentication failure
[jane@node-0 ~]$ su -
Password: 
su: Authentication failure
[jane@node-0 ~]$ su -
Password: 
Last login: Fri May  6 16:51:54 AEST 2022 on pts/1
Last failed login: Fri May  6 16:54:57 AEST 2022 on pts/1
There were 4 failed login attempts since the last successful login.
[root@node-0 ~]# 
~~~

Corresponding log message:

~~~
May  6 02:54:34 node-0 su[34095]: pam_systemd(su-l:session): Cannot create session: Already running in a session or user slice
May  6 02:54:34 node-0 su[34095]: pam_unix(su-l:session): session opened for user jane by quicklab(uid=0)
May  6 02:54:41 node-0 unix_chkpwd[34121]: password check failed for user (root)
May  6 02:54:41 node-0 su[34119]: pam_unix(su-l:auth): authentication failure; logname=quicklab uid=1002 euid=0 tty=pts/1 ruser=quicklab rhost=  user=root
May  6 02:54:45 node-0 unix_chkpwd[34124]: password check failed for user (root)
May  6 02:54:45 node-0 su[34122]: pam_unix(su-l:auth): authentication failure; logname=quicklab uid=1002 euid=0 tty=pts/1 ruser=quicklab rhost=  user=root
May  6 02:54:50 node-0 unix_chkpwd[34127]: password check failed for user (root)
May  6 02:54:50 node-0 su[34125]: pam_unix(su-l:auth): authentication failure; logname=quicklab uid=1002 euid=0 tty=pts/1 ruser=quicklab rhost=  user=root
May  6 02:54:50 node-0 su[34125]: pam_faillock(su-l:auth): Consecutive login failures for user root account temporarily locked
May  6 02:54:55 node-0 unix_chkpwd[34130]: password check failed for user (root)
May  6 02:54:55 node-0 su[34128]: pam_unix(su-l:auth): authentication failure; logname=quicklab uid=1002 euid=0 tty=pts/1 ruser=quicklab rhost=  user=root
May  6 02:55:02 node-0 su[34131]: pam_systemd(su-l:session): Cannot create session: Already running in a session or user slice
May  6 02:55:02 node-0 su[34131]: pam_unix(su-l:session): session opened for user root by quicklab(uid=1002)
~~~

To be clear, this ticket reports incorrect log message recorded in /var/log/secure. The behaviour is working as expected. i.e. root account is not locked after consecutive login failure.

Version-Release number of selected component (if applicable):

# rpm -qa | grep pam
pam-1.3.1-14.el8.x86_64
systemd-pam-239-45.el8.x86_64

~~~
# cat password-auth 
# Generated by authselect on Fri May  6 12:03:23 2022
# Do not modify this file manually.

auth        required                                     pam_env.so
auth        required                                     pam_faildelay.so delay=2000000
auth        required                                     pam_faillock.so preauth silent
auth        [default=1 ignore=ignore success=ok]         pam_usertype.so isregular
auth        [default=1 ignore=ignore success=ok]         pam_localuser.so
auth        sufficient                                   pam_unix.so nullok try_first_pass
auth        [default=1 ignore=ignore success=ok]         pam_usertype.so isregular
auth        sufficient                                   pam_sss.so forward_pass
auth        required                                     pam_faillock.so authfail
auth        required                                     pam_deny.so

account     required                                     pam_faillock.so
account     required                                     pam_unix.so
account     sufficient                                   pam_localuser.so
account     sufficient                                   pam_usertype.so issystem
account     [default=bad success=ok user_unknown=ignore] pam_sss.so
account     required                                     pam_permit.so
<...>
~~~

~~~
[root@node-0 pam.d]# cat system-auth 
# Generated by authselect on Fri May  6 12:03:23 2022
# Do not modify this file manually.

auth        required                                     pam_env.so
auth        required                                     pam_faildelay.so delay=2000000
auth        required                                     pam_faillock.so preauth silent
auth        [default=1 ignore=ignore success=ok]         pam_usertype.so isregular
auth        [default=1 ignore=ignore success=ok]         pam_localuser.so
auth        sufficient                                   pam_unix.so nullok try_first_pass
auth        [default=1 ignore=ignore success=ok]         pam_usertype.so isregular
auth        sufficient                                   pam_sss.so forward_pass
auth        required                                     pam_faillock.so authfail
auth        required                                     pam_deny.so

account     required                                     pam_faillock.so
account     required                                     pam_unix.so
account     sufficient                                   pam_localuser.so
account     sufficient                                   pam_usertype.so issystem
account     [default=bad success=ok user_unknown=ignore] pam_sss.so
account     required                                     pam_permit.so

<...>
~~~

How reproducible:
100% all the time

Actual results:
"Consecutive login failures for user root account temporarily locked" is recorded in /var/log/secure.

Expected results:
If "even_deny_root" option is not enabled (i.e. pam_faillock will not deny root), then, below log message should not be logged:

   "Consecutive login failures for user root account temporarily locked"

Additional info:

Comment 1 Iker Pedrosa 2022-05-06 10:45:57 UTC
You are right, that message shouldn't be printed when the root account can't be locked due to the configuration options.

Comment 3 Iker Pedrosa 2022-11-10 08:00:48 UTC
master:
     pam_faillock: avoid logging an erroneous consecutive login failure message - 10086bc69663fa819277af244eeb5b629a2403b8

Comment 8 errata-xmlrpc 2023-05-16 09:02:48 UTC
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 (pam bug fix and enhancement update), 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/RHBA-2023:2954


Note You need to log in before you can comment on or make changes to this bug.