-
Bug
-
Resolution: Done-Errata
-
Normal
-
rhel-8.6.0
-
ipa-4.12.2-2.el9
-
None
-
Moderate
-
ZStream
-
1
-
rhel-idm-ipa
-
ssg_idm
-
10
-
12
-
2
-
QE ack, Dev ack
-
False
-
False
-
-
Yes
-
2024-Q4-Bravo-S3
-
Approved Blocker
-
Pass
-
Automated
-
Bug Fix
-
-
Done
-
-
Unspecified
-
None
-
57,005
Description of problem:
The problem is that if a user is forced to use an OTP token, set in the Default User Authentication types in the UI and then selecting "Two factor authentication" and "Disable per-user override" settings, the first time when user doesn't have an OTP token, user can login with a password and generate their own OTP token, and afterwards will always be using OTP, which I think is the logical steps to make a migration from methods of authentication.
The problem is that the user can make the trick to generate an OTP token with an "end-validity period", and after that the user can enter always only with the password (bypassing all the general configuration of OTP), for example:
[idmuser01@server ~]$ ipa otptoken-add --not-after=20221107160000Z
ipa: WARNING: QR code width is greater than that of the output tty. Please resize your terminal.
------------------
Added OTP token ""
------------------
Unique ID: 255c887e-28b4-4d05-9b25-3fdf474a1790
Type: TOTP
Owner: idmuser01
Manager: idmuser01
Validity end: 20221107160000Z
Algorithm: sha1
Digits: 6
Clock interval: 30
Before the token expires, always asks for the second factor:
[root@server2 ~]# ssh -l idmuser01 server.lab.example.net
(idmuser01@server.lab.example.net) First Factor:
(idmuser01@server.lab.example.net) Second Factor:
Last login: Mon Nov 7 15:06:33 2022 from 192.168.1.111
[idmuser01@server ~]$ exit
logout
Connection to server.lab.example.net closed.
But after the end validity period (set by the same user), only asks for password:
[root@server2 ~]# ssh -l idmuser01 server.lab.example.net
(idmuser01@server.lab.example.net) Password:
Last login: Mon Nov 7 15:25:50 2022 from 192.168.1.111
Version-Release number of selected component (if applicable):
How reproducible:
Always
Steps to Reproduce:
As described in the Description of problem section above, after a user makes login with ssh to a server, can add a token with end-validity date, as can be seen in
[idmuser01@server ~]$ ipa otptoken-add --not-after=20221107160000Z
ipa: WARNING: QR code width is greater than that of the output tty. Please resize your terminal.
------------------
Added OTP token ""
------------------
Unique ID: 255c887e-28b4-4d05-9b25-3fdf474a1790
Type: TOTP
Owner: idmuser01
Manager: idmuser01
Validity end: 20221107160000Z
Algorithm: sha1
Digits: 6
Clock interval: 30
Before the token expires, always asks for the second factor:
[root@server2 ~]# ssh -l idmuser01 server.lab.example.net
(idmuser01@server.lab.example.net) First Factor:
(idmuser01@server.lab.example.net) Second Factor:
Last login: Mon Nov 7 15:06:33 2022 from 192.168.1.111
[idmuser01@server ~]$ exit
logout
Connection to server.lab.example.net closed.
But after the end validity period (set by the same user), only asks for password:
[root@server2 ~]# ssh -l idmuser01 server.lab.example.net
(idmuser01@server.lab.example.net) Password:
Last login: Mon Nov 7 15:25:50 2022 from 192.168.1.111
Actual results:
OTP token after expiration, fallback to password-only method of authentication
Expected results:
Right now, the code cannot diferentiate between "token does not exist" and "no valid token exists" making the fallback to password-only method in either case.
What is needed is to consider the last expired OTP token to be treated
as a token still assigned to a user, thus forcing to reject
password-only authentication, in that case the token is still assigned to the user but cannot use that to make login, and also doesn't fallback to password-only authentication. A user would not be
able to modify their token information until admin would extend the
token validity or issue a new token, unless the said user has a valid
Kerberos ticket. In the latter case the user would be able to modify the
validity of the token by himself and then be able to login with the token
but not with the password.
Use cases:
- user forced to use OTP:
- has no token at all: allow password access to add a token
- has all tokens expired: do not allow password access, let administrator to handle this case. Also if user still has a valid Kerberos ticket can extend the end-validity date of the token created by himself
- has at least one valid token: do not allow password access
Additional info:
- external trackers
- links to
-
RHBA-2024:141066 ipa update