Bug 1438731 - Extend ipa-server-certinstall and ipa-certupdate to handle PKINIT certificates/anchors
Summary: Extend ipa-server-certinstall and ipa-certupdate to handle PKINIT certificate...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: ipa
Version: 7.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: IPA Maintainers
QA Contact: Michal Reznik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-04-04 10:05 UTC by Petr Vobornik
Modified: 2017-08-01 09:47 UTC (History)
7 users (show)

Fixed In Version: ipa-4.5.0-14.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 09:47:49 UTC
Target Upstream Version:


Attachments (Terms of Use)
Verification logs (10.09 KB, text/plain)
2017-06-12 12:19 UTC, Michal Reznik
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2304 normal SHIPPED_LIVE ipa bug fix and enhancement update 2017-08-01 12:41:35 UTC

Description Petr Vobornik 2017-04-04 10:05:04 UTC
Cloned from upstream: https://pagure.io/freeipa/issue/6831

In order to fully support PKINIT configuration in CA-less deployments, the tools that manipulate 3rd party certificates must be extended to also install PKINIT server certificates and update KDC's PKINIT anchors when 3rd party CA certificates are to be used.

Comment 2 Petr Vobornik 2017-04-04 10:05:33 UTC
Upstream ticket:
https://pagure.io/freeipa/issue/6831

Comment 9 Michal Reznik 2017-06-09 13:04:52 UTC
Moving to assigned as verification failed:

ipa-server-4.5.0-16.el7.x86_64
selinux-policy-3.13.1-160.el7.noarch

Followed these steps:

1. install CA-less master without pkinit
2. generate KDC cert signed by different CA
3. issue "ipa-cacert-manage install" to add the CA
4. ipa-certupdate
5. ipa-server-certinstall --kdc ./pkinit-server.p12 --pin XXX
6. kinit -n

When attempting to get the anonymous ticket got:

[root@master ~]# KRB5_TRACE=/dev/stdout kinit -n
[12984] 1496992862.778766: Getting initial credentials for WELLKNOWN/ANONYMOUS@TESTRELM.TEST
[12984] 1496992862.781603: Sending request (190 bytes) to TESTRELM.TEST
[12984] 1496992862.781775: Initiating TCP connection to stream 192.168.222.10:88
[12984] 1496992862.782014: Sending TCP request to stream 192.168.222.10:88
[12984] 1496992862.785226: Received answer (344 bytes) from stream 192.168.222.10:88
[12984] 1496992862.785236: Terminating TCP connection to stream 192.168.222.10:88
[12984] 1496992862.785312: Response was from master KDC
[12984] 1496992862.785355: Received error from KDC: -1765328359/Additional pre-authentication required
[12984] 1496992862.785401: Processing preauth types: 16, 15, 14, 136, 19, 147, 2, 133
[12984] 1496992862.785414: Selected etype info: etype aes256-cts, salt "TESTRELM.TESTWELLKNOWNANONYMOUS", params ""
[12984] 1496992862.785418: Received cookie: MIT
[12984] 1496992862.785448: Preauth module pkinit (147) (info) returned: 0/Success
[12984] 1496992862.785860: PKINIT client computed kdc-req-body checksum 9/146F1085B92F98D4745FD5EFB4DA2FE1EE3E0E65
[12984] 1496992862.785867: PKINIT client making DH request
[12984] 1496992862.811974: Preauth module pkinit (16) (real) returned: 0/Success
[12984] 1496992862.811990: Produced preauth for next request: 133, 16
[12984] 1496992862.812012: Sending request (1453 bytes) to TESTRELM.TEST
[12984] 1496992862.812087: Initiating TCP connection to stream 192.168.222.10:88
[12984] 1496992862.812143: Sending TCP request to stream 192.168.222.10:88
[12984] 1496992862.826079: Received answer (1622 bytes) from stream 192.168.222.10:88
[12984] 1496992862.826093: Terminating TCP connection to stream 192.168.222.10:88
[12984] 1496992862.826143: Response was from master KDC
[12984] 1496992862.826169: Processing preauth types: 17, 19, 147
[12984] 1496992862.826176: Selected etype info: etype aes256-cts, salt "TESTRELM.TESTWELLKNOWNANONYMOUS", params ""
[12984] 1496992862.826191: Preauth module pkinit (147) (info) returned: 0/Success
[12984] 1496992862.826302: PKINIT client could not verify DH reply
[12984] 1496992862.826328: Preauth module pkinit (17) (real) returned: -1765328360/Preauthentication failed
kinit: Preauthentication failed while getting initial credentials

After restarting krb5kdc service it works:

[root@master ~]# systemctl restart krb5kdc.service
[root@master ~]# 
[root@master ~]# kinit -n
[root@master ~]# 
[root@master ~]# klist
Ticket cache: KEYRING:persistent:0:0
Default principal: WELLKNOWN/ANONYMOUS@WELLKNOWN:ANONYMOUS

Valid starting       Expires              Service principal
06/09/2017 05:13:30  06/10/2017 05:13:30  krbtgt/TESTRELM.TEST@TESTRELM.TEST
[root@master ~]# 
[root@master ~]# getenforce
Enforcing
[root@master ~]# ausearch -m avc
<no matches>

However manual restart should not be required obviously.

The issue looks like https://pagure.io/freeipa/issue/7003 however this time are not after an upgrade.

Comment 11 Michal Reznik 2017-06-12 12:18:37 UTC
Verified on:

ipa-server-4.5.0-16.el7.x86_64
selinux-policy-3.13.1-160.el7.noarch

[root@master ~]# getenforce
Enforcing

Update to comment #9. It turned out that there is currently no restart in "ipa_server_certinstall.py" code. In this case the restart is really expected.

Comment 12 Michal Reznik 2017-06-12 12:19:35 UTC
Created attachment 1287049 [details]
Verification logs

Comment 13 errata-xmlrpc 2017-08-01 09:47:49 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, 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-2017:2304


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