<div dir="ltr">On Mon, Feb 8, 2016 at 11:53 PM, Sumit Bose <span dir="ltr"><<a href="mailto:sbose@redhat.com" target="_blank">sbose@redhat.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><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 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 proxy<br>
> > and<br>
> > > want to use anonymous PKINIT to secure the initial communications between<br>
> > > the client and the KDC.<br>
> > ><br>
> > > We've tried following the MIT Kerberos PKINIT configuration 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 luck.<br>
> > > We're seeing this in the kdc log:<br>
> > ><br>
> > >     preauth pkinit failed to initialize: No realms configured correctly<br>
> > for<br>
> > > pkinit support<br>
> ><br>
> > Which changes did you apply to krb5.conf? Did you use the IPA CA to 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? (It's a<br>
> > > test instance that doesn't have too much in it - it will take a 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 sign<br>
> the certificate or some other CA?<br>
><br>
> Actually, I modified the kdc.conf file - placed the kdc.pem, kdckey.pem 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 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 need<br>
<br>
</div></div>no, kdc.conf is the right place, I actually meant kdc.conf but<br>
accidentially types krb5.conf.<br>
<span class=""><br>
> to use a certificate signed by the IPAs CA - is this something that should<br>
> be generated using ipa-getcert? Or do I just find the IPA CA's private 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 and<br>
>                         private key<br>
><br>
>     --pkinit-pin=PIN    The password to unlock the Kerberos KDC private key<br>
><br>
>     --pkinit-cert-name=NAME<br>
>                         Name of the Kerberos KDC SSL certificate to 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 the<br>
<br>
</span>no, unfortunately pkinit is currently disabled by default<br>
<span class=""><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>
</span>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></blockquote><div><br><div><br></div><div>Thanks Sumit, it did!<br><br></div><div>I concatenated the cert and the key into a single file and the error has indeed gone away from krb5kdc.log<br><br></div>The odd thing is that I can't reproduce the error by splitting into two separate files and restarting ipa.service again. <br><br>Ignoring
 that mystery, how do I go about setting up the WELLKNOWN/ANONYMOUS 
principal?<br><br>I'm pretty sure it's needed for anonymous pkinit: <br><br></div><div>$ kinit<br>kinit: Generic preauthentication failure while getting initial credentials<br>$<br></div><div><br></div>$ kinit -n<br>kinit: Client 'WELLKNOWN/<a href="mailto:ANONYMOUS@EXAMPLE.COM">ANONYMOUS@EXAMPLE.COM</a>' not found in Kerberos database while getting initial credentials<br>$ <br><br>Using  kadmin per the MIT documentation doesn't seem to work (authenticated 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 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>; defaulting to no policy<br>add_principal: Operation requires ``add'' privilege while creating "WELLKNOWN/<a href="mailto:ANONYMOUS@EXAMPLE.COM">ANONYMOUS@EXAMPLE.COM</a>".<br># <br><br></div><div class="gmail_quote">Regards,<br><br></div><div class="gmail_quote">Nik<br></div><div class="gmail_quote"><br><br> </div></div></div>