Cross-realm Trust Principals with LDAP

Kemper, Stephan stephan.kemper at viasat.com
Sun Jan 22 19:11:01 EST 2017


Sorry for the spam, but after continuing to investigate, it looks like this database shortcut only works for vertical trusts.  A krbtgt/A.VIASAT.IO at B.VIASAT.IO principal only shows up in the realm it’s created in.  That definitely pushes me toward the “unintended/bug” end of the spectrum, because otherwise the interface wouldn’t be uniform.


Stephan Kemper
ViaSat, Inc.


On 1/22/17, 12:42 PM, "Kemper, Stephan" <stephan.kemper at viasat.com> wrote:

    Hello again!
    
    Based on my previous question (“Cross-Realm Admins” from last month) we’re now using a model with separate admin principals per realm, and a large keyring of keytab files.  This seems to be working *mostly* fine.
    
    Where we run into issues is with creating the cross-realm trusts, specifically one-way trusts with a sub-realm trusting our master realm.  When our automation tries to create the trust, it often fails with the following log messages:
    
    KerberosService - Running [kadmin, -r, A.VIASAT.IO, -p, api/admin at A.VIASAT.IO, -kt, /path/to/keytab-A.VIASAT.IO, -q, add_principal -pw **random stuff** krbtgt/A.VIASAT.IO at VIASAT.IO]
    WARNING: no policy specified for krbtgt/A.VIASAT.IO at VIASAT.IO; defaulting to no policy
    Authenticating as principal api/admin at A.VIASAT.IO with keytab /path/to/keytab-A.VIASAT.IO.
    Principal "krbtgt/A.VIASAT.IO at VIASAT.IO" created.
    KerberosService - Running [kadmin, -r, VIASAT.IO, -p, api/admin at VIASAT.IO, -kt, /path/to/keytab-VIASAT.IO, -q, add_principal -pw **the same random stuff** krbtgt/A.VIASAT.IO at VIASAT.IO]
    WARNING: no policy specified for krbtgt/A.VIASAT.IO at VIASAT.IO; defaulting to no policy
    add_principal: Principal or policy already exists while creating "krbtgt/A.VIASAT.IO at VIASAT.IO".
    Authenticating as principal api/admin at VIASAT.IO with keytab /path/to/keytab-VIASAT.IO.
    
    The principals do not exist before this point, I am 100% certain.  In our system, all realms are backed by the same LDAP database, under the container cn=Kerberos,dc=viasat,dc=io.  So we have separate krbRealmContainer objects cn=VIASAT.IO, cn=A.VIASAT.IO, and so on.  What’s happening, based on my manual duplication of these steps, is that the A.VIASAT.IO version of the principal is somehow “spilling over” into VIASAT.IO.  After diving into the code, it appears this behavior is intentional: is_principal_in_realm() in ldap_misc.c explicitly allows these cross-realm TGS principals, no matter which krbRealmContainer they’re in.
    
    So I have two questions: first, is this behavior truly expected, or is there some kind of bug here?  It seems like a nice shortcut, but I want to make sure either way before we start depending on it in production.  Second, if it is expected, it’d be really nice for this feature to be documented.  Is it OK if I send in a pull request on GitHub, or some other patch for the docs to reflect this?
    
    
    
    Thanks,
    Stephan Kemper
    ViaSat, Inc.
    
    




More information about the Kerberos mailing list