#8084 KRA authentication fails when IPA CA has custom Subject DN
Closed: fixed 4 years ago by ftweedal. Opened 4 years ago by ftweedal.

Issue

When IPA CA has a custom subject DN (i.e. not CN=Certificate Authority,{subject-base}),
KRA authentication always fails, because the description attribute of the uid=ipakra people entry is not set up correctly.

Steps to Reproduce

  1. Install IPA with custom subject DN, e.g. CN=IPA CA 201910021714,DC=redhat,DC=com
  2. Install KRA
  3. Attempt any operation that contacts KRA (e.g. ipa vault-add).

Actual behavior

Communication with KRA fails.

Expected behavior

Communication with KRA succeeds.

Version/Release/Distribution

4.8 and possibly every version of IPA ever (since we supported custom subject DN).

Additional info:

The probably is clearly seen in the following ldapsearch output:

% ldapsearch -LLL -D cn=directory\ manager -w4me2Test -b o=ipaca '(|(uid=ipara)(uid=ipakra))' description |less
dn: uid=ipara,ou=people,o=ipaca
description: 2;7;CN=IPA CA 201910021714,DC=redhat,DC=com;CN=IPA RA,O=IPA.LOCAL

dn: uid=ipakra,ou=people,o=kra,o=ipaca
description: 2;7;CN=Certificate Authority,O=IPA.LOCAL;CN=IPA RA,O=IPA.LOCAL

The probably may be improper initialisation of the KRAInstance object during installation.
See discussion from mailing list:

> This looks like actual IPA RA subject is fixed in the code in                                                      
> ipaserver/install/krainstance.py:                                                                                  
>                                                                                                                    
> class KRAInstance(DogtagInstance):                                                                                 
> .....                                                                                                              
>    def __create_kra_agent(self):                                                                                   
> .....                                                                                                              
>        # create ipakra user with RA agent certificate                                                              
>        user_dn = DN(('uid', "ipakra"), ('ou', 'people'), self.basedn)                                              
>        entry = conn.make_entry(                                                                                    
>            user_dn,                                                                                                
>            objectClass=['top', 'person', 'organizationalPerson',                                                   
>                         'inetOrgPerson', 'cmsuser'],                                                               
>            uid=["ipakra"],                                                                                         
>            sn=["IPA KRA User"],                                                                                    
>            cn=["IPA KRA User"],                                                                                    
>            usertype=["undefined"],                                                                                 
>            userCertificate=[cert],                                                                                 
>            description=['2;%s;%s;%s' % (                                                                           
>                cert.serial_number,                                                                                 
>                DN(self.subject),                                                                                   
>                DN(('CN', 'IPA RA'), self.subject_base))])                                                          
>        conn.add_entry(entry)                                                                                       
>                                                                                                                    
> I think it should be picked up from the cert. Time for a ticket?                                                   
>                                                                                                                    
Time for a ticket, yes.  But the above code looks ok.  The problem                                                   
is 'self.subject' (the issuer DN) contains the wrong value.  I'll                                                    
follow the reproducer steps to see what's going on.  I suspect                                                       
KRAInstance instance is not initialised properly for some operation. 

master:

  • 326d417 krainstance: set correct issuer DN in uid=ipakra entry
  • 7ea50ff upgrade: fix ipakra people entry 'description' attribute
  • e767386 test_integration: add tests for custom CA subject DN

Metadata Update from @frenaud:
- Custom field test_case adjusted to ipatests/test_integration/test_ca_custom_sdn.py

4 years ago

Metadata Update from @frenaud:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1758406

4 years ago

ipa-4-8:

  • 09c6db7 krainstance: set correct issuer DN in uid=ipakra entry
  • 23f4e00 upgrade: fix ipakra people entry 'description' attribute
  • 5d68d04 (HEAD) test_integration: add tests for custom CA subject DN

ipa-4-7:

  • 1071eb2 krainstance: set correct issuer DN in uid=ipakra entry
  • 4aad2c9 upgrade: fix ipakra people entry 'description' attribute
  • 4767add (HEAD) test_integration: add tests for custom CA subject DN

ipa-4-6:

  • 946d96f krainstance: set correct issuer DN in uid=ipakra entry
  • 2fa8c69 upgrade: fix ipakra people entry 'description' attribute
  • 0a0e802 (HEAD) test_integration: add tests for custom CA subject DN

Metadata Update from @ftweedal:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

4 years ago

Login to comment on this ticket.

Metadata