Страница 1 из 1

Использование Kerberos в FreeBSD и Win

Добавлено: 2009-08-12 9:05:22
princeps
Керберос в данный момент считается наиболее безопасным механизмом аутентификации, в связи с чем, начиная с w2k m$ использует его вместо ntlm. Соответственно, есть желание прицепить его к доменам на samba, но, несмотря на то, что на эту тему есть даже несколько статей, opt1k утверждает, что не все так просто. Вкратце: реализация керберос от m$ выполнена, как обычно, по своим собственным стандартам, в связи с чем виндовые клиенты, похоже, не могут полноценно работать с KDC, развернутым на фре. Предлагаю в этой теме попытаться разобраться, что к чему. По итогам может напишем статью.
Заодно поколлекционируем ссылки в тему. Что такое kerberos:
http://www.securitylab.ru/analytics/265153.php
http://www.ixbt.com/comm/kerberos5.shtml
http://ru.wikipedia.org/wiki/Kerberos
http://www.oszone.net/4188/Kerberos
Керберос на линуксе с бэкендом в опенлдап:
http://www.samag.ru/cgi-bin/go.pl?q=art ... .2005;a=07
Офсайт MIT Kerberos: http://web.mit.edu/kerberos/www/
Офсайт Heimdal: http://www.h5l.org/
Офсайт реализации керберос со странным названием шиши (кстати, тоже есть в портах) : http://www.gnu.org/software/shishi/
Кроме этих есть еще реализации от Sun на яве и M$.

Re: Использование Kerberos в FreeBSD и Win

Добавлено: 2009-08-12 9:06:30
princeps
Использование специальной софтины, позволяющей windows 2000 корректно работать с heimdal. Правда я сам пока не читал.
http://www.h5l.org/manual/heimdal-1-2-b ... eimdal-KDC

Re: Использование Kerberos в FreeBSD и Win

Добавлено: 2009-08-12 14:19:03
opt1k
princeps писал(а):Использование специальной софтины, позволяющей windows 2000 корректно работать с heimdal. Правда я сам пока не читал.
http://www.h5l.org/manual/heimdal-1-2-b ... eimdal-KDC
ну а толку то от софтины, ну будет она работать и что? Гибкость виндового кербероса в том, что его использует виндовая GINA - graphical identification and authentication. И ни с каким другим кроме виндового керберосом она работать не может. Причина заключается в том, что мелкософт в реализацию кербероса от MIT внёс некоторые изменения:
Из книги Linux in a Windows world
9.1.4. Windows and Kerberos
In theory, Windows can fit into a Kerberos realm as easily as Linux. In practice, of course, you'll need to learn to configure both Linux and Windows; configuration file locations and the like will differ between the two platforms. You might also run into compatibility problems related to specific Kerberos implementations.

Of particular note along these lines is the fact that Windows 2000 and later ship with AD support, and AD includes Kerberos as one of its components. Microsoft, however, implemented Kerberos in a slightly different way than did other providers. Some notable areas of divergence include:




Encryption algorithms

For political and technical reasons, Microsoft chose to support a different set of encryption algorithms than did the versions of Kerberos available in 2000. The practical upshot of this decision is that, if you use an AD controller as your KDC, you must either enable Data Encryption Standard (DES) encryption on the KDC and change users' passwords or use a recent version of Kerberos (such as MIT Kerberos 1.3 or later) on the non-Microsoft systems.




The PAC

Perhaps the biggest Windows/non-Windows Kerberos compatibility issue is the Privilege Access Certificate (PAC). This is an extra field added to tickets returned by a Windows KDC. Microsoft's own Windows clients typically refuse to work with a KDC that doesn't return a PAC, which makes interoperating with a Linux KDC difficult, for example. Microsoft developed the PAC in a proprietary way, but in late 2003 some documentation on the PAC became available, so this problem is also fading in importance. Fortunately, non-Microsoft Kerberos implementations typically ignore the PAC, so Linux Kerberos application servers and clients should be able to operate with a Windows KDC.




Cached credentials

Windows systems cache their login credentials as a way of supporting logins on laptops or in case of a KDC or network failure. Ordinarily, this practice poses no problems, but if a user logs on using a cached credential and a non-Microsoft KDC then becomes available, the system isn't likely to notice the KDC, resulting in an inability to access network resources.

Overall, using Microsoft's own KDC as your network's KDC in conjunction with Linux application servers and clients works well. If you're using older Kerberos implementations, though, you may need to enable DES support and then change users' passwords so that the new password is encoded in DES form. This step shouldn't be necessary with recent Kerberos V5 implementations for Linux, though. (If in doubt, check whether the Kerberos implementation supports the RC4-HMAC encryption algorithm.) For the most part, the details of administering a Windows KDC are beyond the scope of this book.

Using Windows clients with a non-Microsoft KDC is a bit trickier, but it is possible. You must create local Windows accounts on the Windows system for your users and use special tools to configure Windows to use the KDC for authentication. This process is described later in this chapter, in Section 9.5.3. Alternatively, you can install a non-Microsoft Kerberos package and run it without using Kerberos for logon authentication. Instead, you'd use regular Kerberized clients and servers under Windows, much as you would their equivalents under Linux.
Вот ещё инфа из рассылок кербероса:
http://mailman.mit.edu/pipermail/kerber ... 01796.html
Just for the record, a Windows 2000 client will send some preauth data
requesting that the PAC be included (this is described in John Brezak's
IETF draft specifying the PAC format). That may be what was being
referred to in previous mails. The default is to include the PAC,
but it might be sensible for a UNIX-based KDC to make the default
to not include the PAC.

Adding support to a KDC for the PAC is not that difficult if you have
a sensible architecture (for example, an integrated directory backend
for the KDC). The difficulty lies in some of the other, unpublished,
protocols which are necessary to domain logon.
и
http://mailman.mit.edu/pipermail/kerber ... 07214.html
On Thu, 10 Feb 2005 23:20:37 -0500, Fredrik Tolf wrote:

> I have to admit that I don't know a lot about Windows and Kerberos.
> However, as I've understood it, the only thing that really prevents you
> from using a MIT KDC for Windows clients is the authorization data they
> ship in the ticket, right? And this is called "PAC", right?

The necessary information about the PAC structure is freely available
on MS' website [1] (and contrary to popular belief the use of the
authorization-data field is as designed and not a case of "embrace
and extend").

The problem is what is *in* the PAC. It contains the principal's group
membership list which is required to create the "token" used by Windows
clients to make access control decisions.

Group information in a MS forest is stored in Active Directory, on each
domain controller, and depending on the group type, may be replicated
between AD and domain controllers (AD and MS Kerberos are very tightly
coupled). The groups for a particular authentication are expanded as
the client traverses the trust to the target [2].

So to use an alternate Kerberos implementation you would need to implement
a variety of MS specific communication [2] to properly and efficiently
produce the necessary group SIDs to construct the PAC. The closest thing
that comes to this is probably XAD [4] which is an amalgamation of Samba,
OpenLDAP, MIT Kerberos, and proprietary stuff but I have no idea how
well it works as I have never used it.

Mike

[1] http://msdn.microsoft.com/library/defau ... dn_pac.asp
[2] http://pluralsight.com/wiki/default.asp ... Group.html
[3] I have recently writen an Open Source MIDL compatible IDL
compiler that could be used to generate the necessary DCE RPC
proxies for much of this communication. It can be located at
http://jcifs.sam ba.org/src/midlc-<version>.tar.gz
[4] http://www.padl.com/Products/XAD.html
Коротко перевожу:
в виндовой реализации есть такое доплнительное поле PAC. Реализовать его просто, т.к. микрософт открыла на него спецификацию. Но инфа передаваемая в этом поле зависит от кучи проприетарных виндовых протоколов, на которых спецификации нет. В результате чего виндовый клиент не сможет работать ни с каким другим керберосом кроме как виндовым. Парни из самбы походу подглядели как реализовать эту фичу, поэтому ждём 4 самбы.
Кстати, по моим скромным прогнозам ожидать её стоит уже в 2010 году, как минимум бэту. Прогноз мой строится на основе чтения оф. вики и расылок самбы. Ещё в 2010 году должна выйти книга The Definitive Guide to Samba 4, от O'Relly, думаю они тоже делают такой прогноз :)

Re: Использование Kerberos в FreeBSD и Win

Добавлено: 2009-08-12 14:40:01
opt1k
А вообще имхо название топика сделано неверно. Я думаю ,princeps, ты приследуешь цель эмуляции АД при помощи сводного ПО? Если так то имеет смысл переименовать топик. Ибо я знаю способ как заставить винду авторизоваться в свободном керберосе :)
Касается способ написанием своей GINA, я нагугливал в инете несколько реализаций. Первое куда надо сходить - pgina.org

ЗЫ недавно(2 июня) вышел новый керберос от MIT за номером 1.7 http://web.mit.edu/kerberos/krb5-1.7/krb5-1.7.html Там вроде как заявлены улучшения касательно работы с виндой, но не одно из них не касается PAC, так что хорошего мало :(

Re: Использование Kerberos в FreeBSD и Win

Добавлено: 2009-08-12 14:49:23
ev
Первое куда надо сходить - pgina.org
With my latest, and last, status update I am forced to announce what many already know. I simply do not have the necessary time to continue as lead and maintainer for the pGina project. From this point forward, until a suitable replacement has volunteered, the pGina project will be unmaintained.
September 15th, 2008
:(

Re: Использование Kerberos в FreeBSD и Win

Добавлено: 2009-08-12 15:12:34
princeps
opt1k писал(а):Я думаю ,princeps, ты приследуешь цель эмуляции АД при помощи сводного ПО?
Не совсем, я хочу реализовать kerberos аутентификацию в своей сети, в которой клиенты на винде. И надо сделать в ближайшее время, так что ждать 4-ю самбу я не могу.
opt1k писал(а):в виндовой реализации есть такое доплнительное поле PAC. Реализовать его просто, т.к. микрософт открыла на него спецификацию. Но инфа передаваемая в этом поле зависит от кучи проприетарных виндовых протоколов, на которых спецификации нет. В результате чего виндовый клиент не сможет работать ни с каким другим керберосом кроме как виндовым. Парни из самбы походу подглядели как реализовать эту фичу, поэтому ждём 4 самбы.
В Kerberos FAQ сказано, что там какой-то косяк с членством в группах, типа из-за того, что винда передает эту инфу при аутентификации, она может не работать с MIT. Но при определенных обстоятельствах может и работать. FAQ, правда, был написан еще в конце 90-х, так что даже не знаю, насколько эта инфа актуальна. Написание своей авторизовалки для винды не кажется мне рациональным.
Вообще я хочу попробовать это все на реальных системах, только пока что-то не получается вообще контроллер поднять, ни с керберосом, ни без него. Когда получится, буду цеплять к нему по очереди хеймдал, мит и шишу эту, посмотрю, как винда с ними дружит. А там может и проянится что-то. Тут кто-то на форуме писал, что у него вообще без кербероса не заработал контроллер.

Re: Использование Kerberos в FreeBSD и Win

Добавлено: 2009-08-12 15:58:40
opt1k
pgina хоть и не поддерживается, но сурсы доступны. Есть возможность на основании сурсов написать свою джину или даже плагин к ней.

Нативная GINA никогда не сможет работать ни с чем кроме виндового кербероса, это 100%. Поэтому если нужен логин посредством кербероса, то надо писать свою GINA.
Вообще я хочу попробовать это все на реальных системах, только пока что-то не получается вообще контроллер поднять, ни с керберосом, ни без него. Когда получится, буду цеплять к нему по очереди хеймдал, мит и шишу эту, посмотрю, как винда с ними дружит. А там может и проянится что-то. Тут кто-то на форуме писал, что у него вообще без кербероса не заработал контроллер.
я уже всё это прошёл - это пустая трата времени.