Bug 1545755

Summary: ipa-replica-prepare should not update pki admin password.
Product: Red Hat Enterprise Linux 7 Reporter: German Parente <gparente>
Component: ipaAssignee: IPA Maintainers <ipa-maint>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: anazmy, cheimes, cobrown, frenaud, gparente, mpolovka, pasik, pcech, pvoborni, rcritten, ssidhaye, tscherf
Target Milestone: rcKeywords: TestCaseProvided
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-4.6.6-12.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-29 19:58:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description German Parente 2018-02-15 15:13:17 UTC
Description of problem:

ipa-replica-prepare "profits" to set admin password same as "cn=directory manager" password. While this was required in RHEL6, it's not more the case in RHEL7 where the passwords can differ. And it could be also a problem if the password policy has been set with particular settings applied to the admin password. As "cn=directory manager" password does not need to comply with password policy and admin password must comply, we could have failures because of this attempt to change password.

More precisely, I am talking about this part of the code of ipa-replica-prepare:


=============================
            if os.path.isfile(options.ca_file):
                # Since it is possible that the Directory Manager password
                # has changed since ipa-server-install, we need to regenerate
                # the CA PKCS#12 file and update the pki admin user password
                self.regenerate_ca_file(options.ca_file)
                self.update_pki_admin_password()
                self.copy_info_file(options.ca_file, "cacert.p12")
===============================

update_pki_admin_password:
====================================================
    def update_pki_admin_password(self):
        dn = DN('uid=admin', 'ou=people', 'o=ipaca')
        api.Backend.ldap2.modify_password(dn, self.dirman_password)
====================================================

Particularly, we have a customer with this failure in ipa-replica-prepare:

     self.update_pki_admin_password()
   File
"/usr/lib/python2.7/site-packages/ipaserver/install/ipa_replica_prepar
e.py", line 586, in update_pki_admin_password
     api.Backend.ldap2.modify_password(dn, self.dirman_password)
   File "/usr/lib/python2.7/site-packages/ipaserver/plugins/ldap2.py",
line 390, in modify_password
     self.conn.passwd_s(str(dn), old_pass, new_pass)
   File "/usr/lib64/python2.7/contextlib.py", line 35, in __exit__
     self.gen.throw(type, value, traceback)
   File "/usr/lib/python2.7/site-packages/ipapython/ipaldap.py", line
975, in error_handler
     raise errors.DatabaseError(desc=desc, info=info)
ipa.ipaserver.install.ipa_replica_prepare.ReplicaPrepare: DEBUG: The
ipa-replica-prepare command failed, exception: DatabaseError:
Constraint
violation: Password reuse not permitted
ipa.ipaserver.install.ipa_replica_prepare.ReplicaPrepare: ERROR:
Constraint violation: Password reuse not permitted

Because its global password policy has a:

History size: 24








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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Rob Crittenden 2018-02-15 15:19:28 UTC
So the user created a password policy within dogtag? For what purpose? Compliance?

Comment 7 Rob Crittenden 2018-02-15 19:34:10 UTC
I ran this past Ade and he agreed that this password change shouldn't be required.

Comment 8 Rob Crittenden 2018-02-20 15:48:25 UTC
Something else to look at is that the change is being applied by DM which should avoid password policy.

Comment 9 Rob Crittenden 2018-02-20 20:02:10 UTC
Upstream ticket:
https://pagure.io/freeipa/issue/7181

Comment 22 errata-xmlrpc 2020-09-29 19:58:29 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 (Moderate: ipa security, 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/RHSA-2020:3936