Bug 1640271

Summary: Fallback to admin_server if kpasswd_server is not set does not work
Product: Red Hat Enterprise Linux 8 Reporter: Robbie Harwood <rharwood>
Component: krb5Assignee: Robbie Harwood <rharwood>
Status: CLOSED ERRATA QA Contact: Filip Dvorak <fdvorak>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: dpal, lslebodn, pasik, pkis, qe-baseos-security, sbose
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
URL: https://github.com/krb5/krb5/pull/864
Whiteboard:
Fixed In Version: krb5-1.17-1.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: 1498347
: 1640272 (view as bug list) Environment:
Last Closed: 2019-11-05 21:29:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1640272, 1682282    
Bug Blocks:    

Description Robbie Harwood 2018-10-17 17:45:27 UTC
Description of problem:

According to the krb5.conf man page
                                                                                                                                                                                                                                             
"""                                                                                                                                                                                                                                         
       kpasswd_server                                                                                                                                                                                                                       
              Points to the server where all the password changes are                                                                                                                                                                       
performed.  If there is no such entry, the port 464 on the admin_server                                                                                                                                                                     
host will be tried.                                                                                                                                                                                                                         
"""

In my testing it looked like libkrb5 is doing a DNS SRV lookup if no kpasswd_server is defined and does not fall back to admin_server immediately. This can cause issues in an environment with multiple KDCs with replicated data base backend (e.g. AD or IPA) because the password change will be done on one KDC while the next AS request will go to a different one where the new password is not replicated yet. Setting a single server as kdc and admin_server in krb5.conf should prevent this according to the man page.

If the current behavior is expected then imo at least the man page should be enhanced to describe the expected behavior.

Of course 'dns_lookup_kdc' can be used to control the behavior but I think the admin_server fallback should work independently of this setting. 'dns_lookup_kdc' might be needed by other realms. Additionally the lookups schemes in libkrb5 are ordered (iirc locator plugin, krb5.conf, DNS) and I think it would be more clear if all krb5.conf settings are evaluated first before switching to DNS.

--- Additional comment from Robbie Harwood on 2017-10-10 14:11:50 EDT ---

The most attractive thing to do is to disable dns for a realm when any servers are defined for it.  Unfortunately this is not viable since it breaks with kadmin (and upstream says it would break MIT's realm deployment as well).

So there are really three things krb5 could do here:

1) Change nothing; document this behavior and move on.

2) Make an option to disable DNS on a per-realm basis: probably this would just be making dns_lookup_kdc settable in the realm stanza, rather than just [libdefaults].

3) Allow setting entries to explicitly empty ("") to indicate that DNS should be skipped for them.

My impression is that you all would prefer option (2).  Is that right?

--- Additional comment from Sumit Bose on 2017-10-11 04:05:16 EDT ---

I think 2) would be a nice and useful feature.

However I think documentation part of 1) should be done as well. And this might even be sufficient for the IPA server use case, because even if 2) is implemented the realm section in krb5.conf on the IPA server must be edited. Either the new option to disable DNS must be added or a kpasswd_server entry.

Comment 6 errata-xmlrpc 2019-11-05 21:29:55 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-2019:3516