-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hostname alias (CNAME) not handled properly #75
Comments
This library just passes through the values given to it to the GSSAPI/SSPI implementation that it is wrapping. Based on the traceback here it's on Windows so it's just using what Windows SSPI does in the background. I know MIT Kerberos has some configurations (like Ultimately name resolution is not something this library handles at all, it just provides the name of the service given to it to the underlying C library. Whether that does a resolution or not is up to that library and it's not something I have any plans on supporting in this library. Ultimately you have four choices here
|
Thank you for suggestions. Let me add some context and continue this discussion. Even if not to implement any solution in your libraries, then just for future reference.
The thing is the server is configured to work as
If I resolve the alias and use the value of the A record to set the override then it will work. But this really seems like something that should happen under the hood.
That would be the best option. I will investigate it and post my findings here if you don't mind.
Beyond my pay grade (-; |
It could potentially be that Windows resolves the alias before it itself called SSPI with the SPN value. Without seeing a trace of the call it would be hard to tell unfortunately. Regardless that would be a question for the library calling this one as we are just in charge of wrapping the C library.
Unfortunately it can be dangerous for a few reasons
Granted these are weak reasons but they are still valid in some cases.
It's not too hard, granted it's also not a simple fix. Essentially you;
|
Apparently it is applications responsibility to resolve CNAME records. Still, I think there is no point in separate copy of such code in every client. Thus, I've created patches for both requests-kerberos and requests-gssapi.
I believe that with Kerberos the worst that can happen is a denial-of-service attack if DNS is attacked.
I may have misused the phrase, but this is literally not my job and I don't have rights to do it. |
It's a tricky question, I personally think this is somewhat irresponsible to say outright, you can't always trust that DNS is correct and you can't always trust that the resolved hostname is going to be who you talk to. It's also not really possible to use in a load balancer situation.
The worst that can happen is a man in the middle situation where the client thinks they are talking to
I sympathize with you here but this is generally the solution when you want to use Kerberos with an alias, especially when that alias can resolve to different hosts over time. It works because now you have a single principal associated with the alias name that will be used to verify the server is who the client thinks it is. As this library is passing along the values it uses to the underlying C library there's nothing else that I think pyspnego can do here so I'll be closing the issue. |
I am using requests-kerberos on top of pyspnego (and sspilib). The most basic example
gives me errors (i am not entirely sure in which library the real problem is).
The problem is that
service.example.com
is an alias forhost.example.com
(a CNAME DNS record) and there is an SPN only forhost.example.com
. I have managed to work this problem around changing one line in the above example toHowever, I believe this shouldn't be required since the same example (without
hostname_override
) works fine on Debian with MIT Kerberos.The text was updated successfully, but these errors were encountered: