3

I am facing a problem understanding the reason why to use mod_auth_kerb for authentication to a Kerberos server.

I am developing a website using Django + mod_wsgi + Apache .

The first page of my website asks the user to enter username/password and one of my Django app will take the username/password and use Python kerberos module to authenticate the user to the kerberos server.

Where do I need to use mod_auth_kerb here ?

I understand that I will have the power to use the username/password to my advantage,is this the reason of using mod_auth_kerb ?

4

1 回答 1

5

mod_auth_kerb 可以做两件事:

  1. 通过 HTTP Basic 提示用户输入用户名和密码,并在服务器端使用 Kerberos 验证它们,或者

  2. 允许浏览器通过 HTTP Negotiate 在双方使用 Kerberos 进行身份验证。如果客户端支持 Kerberos,这将提供单点登录:客户端通过用户登录时获得的凭据自动通过 Kerberos 系统向服务器进行身份验证,而不提示输入密码。

你在你的应用程序中做#1。将它移到 Apache 中可能会很有用,在这里它可以为所有应用程序一致地完成一次。#2 你根本没有做,但它只在 Kerberos 基础设施可用的环境中有用。

一句警告:我不知道“Python kerberos 模块”,但很可能它没有安全地进行密码验证。许多声称这样做的事情相当于“kinit”:他们使用用户名和密码来获取初始 Kerberos 凭证 (TGT),如果它看起来有效,则声称成功。问题是他们已经要求第三方(Kerberos 身份验证服务器(密钥分发中心)或 KDC)验证密码——但他们没有检查他们实际上是在与真正的 KDC 交谈。他们可能只是从给他们密码的同一用户那里收到了一条消息,而这条消息当然是“密码正确”。为了正确地做到这一点,验证者需要自己在 Kerberos 领域中的身份(“主体”),并采取额外步骤,使用 TGT 为自己获取票证并进行验证;这可确保回复来自真正的 KDC。

如果您的 KDC 是 Windows 域控制器,另一种常见的方法是使用 LDAP:通过 LDAP 连接到域控制器并使用密码进行身份验证;DC 将根据 Kerberos 本身检查密码。当然,您也有同样的问题:您需要验证您正在与真正的域控制器通信——但您可以通过证书使用 TLS 来做到这一点,这可能更容易。

于 2013-07-27T06:13:55.677 回答