<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Wed, Feb 10, 2016 at 3:04 AM, Sumit Bose <span dir="ltr"><<a href="mailto:sbose@redhat.com" target="_blank">sbose@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=""><div class="h5">On Wed, Feb 10, 2016 at 02:08:55AM +1100, Nik Lam wrote:<br>
> On Mon, Feb 8, 2016 at 11:53 PM, Sumit Bose <<a href="mailto:sbose@redhat.com">sbose@redhat.com</a>> wrote:<br>
><br>
> > On Thu, Feb 04, 2016 at 07:25:29PM +1100, Nik Lam wrote:<br>
> > > On Wed, Feb 3, 2016 at 8:08 PM, Sumit Bose <<a href="mailto:sbose@redhat.com">sbose@redhat.com</a>> wrote:<br>
> > ><br>
> > > > On Wed, Feb 03, 2016 at 10:29:49AM +1100, Nik Lam wrote:<br>
> > > > > Hello,<br>
> > > > ><br>
> > > > > I installed ipa-server on Centos 7.1 and later did and upgrade of the<br>
> > > > whole<br>
> > > > > system to Centos 7.2.<br>
> > > > ><br>
> > > > > I think the FreeIPA version changed from 4.1.0 to 4.2.0 between these<br>
> > > > > Centos/RHEL minor releases.<br>
> > > > ><br>
> > > > > We'd now like to try integrating with a 2FA provider via a radius<br>
> > proxy<br>
> > > > and<br>
> > > > > want to use anonymous PKINIT to secure the initial communications<br>
> > between<br>
> > > > > the client and the KDC.<br>
> > > > ><br>
> > > > > We've tried following the MIT Kerberos PKINIT configuration<br>
> > documentation<br>
> > > > ><br>
> > > > >     <a href="http://web.mit.edu/kerberos/krb5-1.14/doc/admin/pkinit.html" rel="noreferrer" target="_blank">http://web.mit.edu/kerberos/krb5-1.14/doc/admin/pkinit.html</a><br>
> > > > ><br>
> > > > > generating our own certs manually with openssl but haven't had any<br>
> > luck.<br>
> > > > > We're seeing this in the kdc log:<br>
> > > > ><br>
> > > > >     preauth pkinit failed to initialize: No realms configured<br>
> > correctly<br>
> > > > for<br>
> > > > > pkinit support<br>
> > > ><br>
> > > > Which changes did you apply to krb5.conf? Did you use the IPA CA to<br>
> > sign<br>
> > > > the certificate or some other CA?<br>
> > > ><br>
> > > > ><br>
> > > > > I've noticed there are many new pkinit-related options that have been<br>
> > > > added<br>
> > > > > to the ipa-server-install script in 4.2.0, so it looks like PKINIT is<br>
> > > > > available in this version of FreeIPA. Is that the case?<br>
> > > ><br>
> > > > Which options are you referring to?<br>
> > > ><br>
> > > > bye,<br>
> > > > Sumit<br>
> > > ><br>
> > > > ><br>
> > > > > And if it is, what is the recommended way to enable it given that it<br>
> > > > seems<br>
> > > > > to have been disabled in the original install that I did? Or would it<br>
> > > > just<br>
> > > > > be easier to start from scratch with a 4.2.0 ipa-server-install?<br>
> > (It's a<br>
> > > > > test instance that doesn't have too much in it - it will take a<br>
> > several<br>
> > > > > hours to rebuild from scratch.)<br>
> > > > ><br>
> > > > > Regards,<br>
> > > > ><br>
> > > > > Nik<br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > Thanks Sumit.<br>
> > ><br>
> > > It sounds like PKINIT is available but clearly I'm doing it wrong.<br>
> > ><br>
> > >  > Which changes did you apply to krb5.conf? Did you use the IPA CA to<br>
> > sign<br>
> > > the certificate or some other CA?<br>
> > ><br>
> > > Actually, I modified the kdc.conf file - placed the kdc.pem, kdckey.pem<br>
> > and<br>
> > > cacert.pem files in /var/kerberos/krb5kdc/ that I generated via openssl<br>
> > > commands in the MIT Kerberos documentation. The only change to kdc.conf<br>
> > > file was to append the location of the kdckey.pem file to<br>
> > pkinit_identity.<br>
> > ><br>
> > >   pkinit_identity = FILE:/var/kerberos/krb5kdc/kdc.pem<br>
> > >   pkinit_anchors = FILE:/var/kerberos/krb5kdc/cacert.pem<br>
> > ><br>
> > > became<br>
> > ><br>
> > >   pkinit_identity =<br>
> > > FILE:/var/kerberos/krb5kdc/kdc.pem,/var/kerberos/krb5kdc/kdckey.pem<br>
> > >   pkinit_anchors = FILE:/var/kerberos/krb5kdc/cacert.pem<br>
> > ><br>
> > > Should I have been modifying krb5.conf instead? It aslo sounds like I<br>
> > need<br>
> ><br>
> > no, kdc.conf is the right place, I actually meant kdc.conf but<br>
> > accidentially types krb5.conf.<br>
> ><br>
> > > to use a certificate signed by the IPAs CA - is this something that<br>
> > should<br>
> > > be generated using ipa-getcert? Or do I just find the IPA CA's private<br>
> > key<br>
> > > and use openssl following the MIT Kerberos documentation?<br>
> > ><br>
> > >  > Which options are you referring to?<br>
> > ><br>
> > > When I looked at the --help text for 4.1.0 and 4.2.0 versions of<br>
> > > ipa-server-install, I noticed that 4.2.0 has these in the "certificate<br>
> > > system options":<br>
> > ><br>
> > >     --no-pkinit         disables pkinit setup steps<br>
> > ><br>
> > >     --pkinit-cert-file=FILE<br>
> > >                         File containing the Kerberos KDC SSL certificate<br>
> > and<br>
> > >                         private key<br>
> > ><br>
> > >     --pkinit-pin=PIN    The password to unlock the Kerberos KDC private<br>
> > key<br>
> > ><br>
> > >     --pkinit-cert-name=NAME<br>
> > >                         Name of the Kerberos KDC SSL certificate to<br>
> > install<br>
> > ><br>
> > ><br>
> > > Seeing that first one, I was a little hopeful that pkinit is enabled by<br>
> > > default in 4.2.0 but on a fresh install I just tried, I'm still seeing<br>
> > the<br>
> ><br>
> > no, unfortunately pkinit is currently disabled by default<br>
> ><br>
> > > following in krb5kdc.log when IPA is started up, so clearly it isn't.<br>
> > ><br>
> > >   (Error): preauth pkinit failed to initialize: No realms configured<br>
> > > correctly for pkinit support<br>
> ><br>
> > I get the same error when I put the certificate and the key into<br>
> > separate files. Can you try to put both into one and use this for the<br>
> > pkinit_identity option?<br>
> ><br>
> > HTH<br>
> ><br>
> > bye,<br>
> > Sumit<br>
> ><br>
><br>
><br>
> Thanks Sumit, it did!<br>
><br>
> I concatenated the cert and the key into a single file and the error has<br>
> indeed gone away from krb5kdc.log<br>
><br>
> The odd thing is that I can't reproduce the error by splitting into two<br>
> separate files and restarting ipa.service again.<br>
><br>
> Ignoring that mystery, how do I go about setting up the WELLKNOWN/ANONYMOUS<br>
> principal?<br>
><br>
> I'm pretty sure it's needed for anonymous pkinit:<br>
><br>
> $ kinit<br>
> kinit: Generic preauthentication failure while getting initial credentials<br>
> $<br>
><br>
> $ kinit -n<br>
> kinit: Client 'WELLKNOWN/<a href="mailto:ANONYMOUS@EXAMPLE.COM">ANONYMOUS@EXAMPLE.COM</a>' not found in Kerberos<br>
> database while getting initial credentials<br>
> $<br>
><br>
> Using  kadmin per the MIT documentation doesn't seem to work (authenticated<br>
> as an IPA admin)<br>
><br>
> # kadmin -q 'addprinc -randkey WELLKNOWN/ANONYMOUS'<br>
> Authenticating as principal admin/<a href="mailto:admin@EXAMPLE.COM">admin@EXAMPLE.COM</a> with password.<br>
> kadmin: Client not found in Kerberos database while initializing kadmin<br>
> interface<br>
> #<br>
><br>
> # kadmin -q 'addprinc -randkey WELLKNOWN/ANONYMOUS' -p admin<br>
> Authenticating as principal admin with password.<br>
> Password for <a href="mailto:admin@EXAMPLE.COM">admin@EXAMPLE.COM</a>:<br>
> WARNING: no policy specified for WELLKNOWN/<a href="mailto:ANONYMOUS@EXAMPLE.COM">ANONYMOUS@EXAMPLE.COM</a>;<br>
> defaulting to no policy<br>
> add_principal: Operation requires ``add'' privilege while creating<br>
> "WELLKNOWN/<a href="mailto:ANONYMOUS@EXAMPLE.COM">ANONYMOUS@EXAMPLE.COM</a>".<br>
> #<br>
<br>
</div></div>Please try<br>
<br>
    kadmin.local -x ipa-setup-override-restrictions<br>
<br>
bye,<br>
Sumit<br>
<br>
</blockquote><div><br>Thanks Sumit.<br><br>That seems to have worked to get the principal created.<br><br># kadmin.local -x ipa-setup-override-restrictions<br>Authenticating as principal admin/<a href="mailto:admin@EXAMPLE.COM">admin@EXAMPLE.COM</a> with password.<br>kadmin.local:  addprinc -randkey WELLKNOWN/ANONYMOUS<br>WARNING: no policy specified for WELLKNOWN/<a href="mailto:ANONYMOUS@EXAMPLE.COM">ANONYMOUS@EXAMPLE.COM</a>; defaulting to no policy<br>Principal "WELLKNOWN/<a href="mailto:ANONYMOUS@EXAMPLE.COM">ANONYMOUS@EXAMPLE.COM</a>" created.<br>kadmin.local:  quit<br># <br><br>I'm no longer seeing the error from the client about 'WELLKNOWN/<a href="mailto:ANONYMOUS@EXAMPLE.COM">ANONYMOUS@EXAMPLE.COM</a>' not found in Kerberos database.<br><br>However, I'm being prompted for a password for the anonymous principal.<br><br>$ kinit -n<br>Password for WELLKNOWN/<a href="mailto:ANONYMOUS@EXAMPLE.COM">ANONYMOUS@EXAMPLE.COM</a>: <br>kinit: Password incorrect while getting initial credentials<br>$ <br><br>That doesn't sound right to me - and indeed it doesn't provide an armor cache that I can use for authenticating my client user.<br><br>Here's what's in the krb5kdc.log from that attempt to use kinit -n<br><br>Feb 10 00:55:46 <a href="http://ipa00-756701.example.com">ipa00-756701.example.com</a> krb5kdc[4869](info): AS_REQ (6 etypes {18 17 16 23 25 26}) <a href="http://10.93.187.13">10.93.187.13</a>: NEEDED_PREAUTH: WELLKNOWN/<a href="mailto:ANONYMOUS@EXAMPLE.COM">ANONYMOUS@EXAMPLE.COM</a> for krbtgt/<a href="mailto:EXAMPLE.COM@EXAMPLE.COM">EXAMPLE.COM@EXAMPLE.COM</a>, Additional pre-authentication required<br>Feb 10 00:55:46 <a href="http://ipa00-756701.example.com">ipa00-756701.example.com</a> krb5kdc[4869](info): closing down fd 12<br>Feb 10 00:55:47 <a href="http://ipa00-756701.example.com">ipa00-756701.example.com</a> krb5kdc[4869](info): preauth (encrypted_timestamp) verify failure: Decrypt integrity check failed<br>Feb 10 00:55:47 <a href="http://ipa00-756701.example.com">ipa00-756701.example.com</a> krb5kdc[4869](info): AS_REQ (6 etypes {18 17 16 23 25 26}) <a href="http://10.93.187.13">10.93.187.13</a>: PREAUTH_FAILED: WELLKNOWN/<a href="mailto:ANONYMOUS@EXAMPLE.COM">ANONYMOUS@EXAMPLE.COM</a> for krbtgt/<a href="mailto:EXAMPLE.COM@EXAMPLE.COM">EXAMPLE.COM@EXAMPLE.COM</a>, Decrypt integrity check failed<br>Feb 10 00:55:47 <a href="http://ipa00-756701.example.com">ipa00-756701.example.com</a> krb5kdc[4869](info): closing down fd 12<br><br></div><div> Regards,<br><br></div><div>Nik<br></div><div><br></div></div><br></div></div>