Bug 1640272 - Fallback to admin_server if kpasswd_server is not set does not work
Summary: Fallback to admin_server if kpasswd_server is not set does not work
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: krb5
Version: rawhide
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ---
Assignee: Robbie Harwood
QA Contact: Fedora Extras Quality Assurance
URL: https://github.com/krb5/krb5/pull/864
Whiteboard:
Depends On:
Blocks: 1498347 1640271
TreeView+ depends on / blocked
 
Reported: 2018-10-17 17:46 UTC by Robbie Harwood
Modified: 2018-10-17 17:51 UTC (History)
12 users (show)

Fixed In Version: krb5-1.16.1-23.fc30
Clone Of: 1640271
Environment:
Last Closed: 2018-10-17 17:51:04 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Robbie Harwood 2018-10-17 17:46:45 UTC
+++ This bug was initially created as a clone of Bug #1640271 +++

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 1 Robbie Harwood 2018-10-17 17:51:04 UTC
Fixed using approach (1) - documented behavior.


Note You need to log in before you can comment on or make changes to this bug.