Bug 1886837 - Revise PKINIT upgrade code
Summary: Revise PKINIT upgrade code
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: ipa
Version: 8.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: 8.0
Assignee: Thomas Woerner
QA Contact: ipa-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-10-09 13:56 UTC by Thorsten Scherf
Modified: 2021-11-09 23:03 UTC (History)
8 users (show)

Fixed In Version: idm-client-8050020210701113027.de73ecb2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-09 18:21:53 UTC
Type: ---
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FREEIPA-7266 0 None None None 2021-11-09 18:26:49 UTC
Red Hat Product Errata RHBA-2021:4230 0 None None None 2021-11-09 18:22:11 UTC

Description Thorsten Scherf 2020-10-09 13:56:43 UTC
This bug is created as a clone of upstream ticket:
https://pagure.io/freeipa/issue/8532

I am reading through PKINIT upgrade and setup code and I think we have logical bug in ipa-pkinit-manage and in the upgrade code:
1. ipa-pkinit-manage never calls krbinstance's setup_pkinit() on enable, so we are never able to enable the certificate issuance through it even though we are able to disable one
2. upgrade code only allows to issue self-signed certificates if certificates are missing

as a result, there is no way to upgrade from self-signed to CA-based and the way it is done, even if you'd do reissue, the issuer will still be left `cn=<hostname>`, without EKUs we need, so it will not work for web UI logon FAST wrapping.

We have to reissue cert properly and there is nothing that would do it -- as nothing calls into krb instance's `setup_pkinit()`.

a manual fix is to force reissue of the PKINIT certificate against the right CA with right issuer and EKUs:
```
ipa-getcert rekey -f /var/kerberos/krb5kdc/kdc.crt -U id-kp-serverAuth -U id-pkinit-KPKdc -K krbtgt/IPA.TEST -T KDCs_PKINIT_Certs -X IPA
```

but we need to revise upgrade code and `ipa-pkinit-manage` to make sure we are taking care of the conversion of 'bogus' PKINIT certificate to the correct one, whether self-signed or IPA CA.

Comment 5 Rob Crittenden 2021-06-17 21:30:06 UTC
Fixed upstream
master:
https://pagure.io/freeipa/c/50306cc636955ff5e478819e98224953cb6346ee

Comment 13 anuja 2021-08-02 09:25:57 UTC
Verigied using sanity ceck:
using upstream-pkinit-manage

(A) test-result.txt.gz
============================= test session starts ==============================
platform linux -- Python 3.6.8, pytest-3.10.1, py-1.10.0, pluggy-0.13.1 -- /usr/libexec/platform-python
cachedir: /home/cloud-user/.pytest_cache
metadata: {'Python': '3.6.8', 'Platform': 'Linux-4.18.0-324.el8.x86_64-x86_64-with-redhat-8.5-Ootpa', 'Packages': {'pytest': '3.10.1', 'py': '1.10.0', 'pluggy': '0.13.1'}, 'Plugins': {'metadata': '1.11.0', 'html': '1.22.1', 'multihost': '3.0', 'sourceorder': '0.5'}}
rootdir: /usr/lib/python3.6/site-packages/ipatests, inifile:
plugins: metadata-1.11.0, html-1.22.1, multihost-3.0, sourceorder-0.5
collecting ... collected 5 items

test_integration/test_pkinit_manage.py::TestPkinitManage::test_pkinit_enable PASSED [ 20%]
test_integration/test_pkinit_manage.py::TestPkinitManage::test_pkinit_disable PASSED [ 40%]
test_integration/test_pkinit_manage.py::TestPkinitManage::test_pkinit_reenable PASSED [ 60%]
test_integration/test_pkinit_manage.py::TestPkinitManage::test_pkinit_on_replica PASSED [ 80%]
test_integration/test_pkinit_manage.py::TestPkinitInstall::test_pkinit PASSED [100%]

(B) runner.log 
2021-07-30T10:10:05+0000 ok: [master.testrelm.test] => (item=ipa-server) => 
2021-07-30T10:10:05+0000   msg:
2021-07-30T10:10:05+0000   - arch: x86_64
2021-07-30T10:10:05+0000     epoch: null
2021-07-30T10:10:05+0000     name: ipa-server
2021-07-30T10:10:05+0000     release: 4.module+el8.5.0+11912+1b4496cf
2021-07-30T10:10:05+0000     source: rpm
2021-07-30T10:10:05+0000     version: 4.9.6

Comment 16 errata-xmlrpc 2021-11-09 18:21:53 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 (ipa 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-2021:4230


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