freeipa 客户端 Kerberos认证 SSSD关系

参考资料:

Documentation - FreeIPA

Kerberos - FreeIPA

SSSD Architecture - sssd.io

Password management — MIT Kerberos Documentation

https://posts.specterops.io/attacking-freeipa-part-i-authentication-77e73d837d6a

freeIPA中kerberos跟LDAP是怎么交互的?

kerberos跟LDAP二者之间的连接是ldapi:///var/run/xxxxIEEVEE-COM.socket这种形式,具体代码可以参见

ipadb_realm_to_ldapi_uri和ipadb_get_connection。

LDAPI使用了IPC通信,通过slapd-xx.socket允许不同进程间通信,相关信息可以参考RedHat的介绍。LDAPI方式比普通LDAP更快,更安全。

Kerberos

Kerberos

The Kerberos KDC/Kadmin components are implemented using theMIT Kerberossoftware. It provides authentication services for the entire FreeIPA realm, it's users services and other components. Kerberos server is one of the base stones of a FreeIPA server.

How it works

When you runkinitcommand you invoke a client that connects to the Kerberos server, called KDC. As a result of the authentication the client receives a ticket. This ticket is a temporary pass or better say a pass-book. The best example from the real life will a be pass to a movie festival. A pass to such festival would allow someone to attend different movies at their discretion. Kerberos is very similar. When user tries to access some kind of resource protected by Kerberos the resource requires the user to present a valid ticket – same as with the movies.

To get such a ticket the user needs to prove that he is who he is. Asking user to authenticate with his password all the time might be too annoying and hard to manage. This is why there is a multi tier process. First user authenticates and gets so calledTGT(ticket granting ticket). This ticket can be presented to Kerberos server at any moment and a new ticket specific to the resource the user wants to access can be acquired. All the tickets have a configurable expiration time (runipa help krbtpolicyto get more information) so user needs to re-authenticate from time to time but it is much less of a burden.

When SSSD project is used, the ticket is get for a user automatically as he authenticates to client machine.

当使用SSSD项目时,用户向客户端计算机进行身份验证时,会自动为其获取票据。

Data

MIT Kerberos KDC server reads all the user and service identity information from aDirectory Server. FreeIPA implements an own ipa-kdb KDC data backend implementation reading and writing all the required information to LDAP tree. The provides both basic identity retrieval function, but also more advanced features, like verifying, signing and producing Kerberos ticket MS-PAC extension whenTrustsare in place.

Kerberos为整个FreeIPA领域、用户服务和其他组件提供身份验证服务。it is one of base stones of a FreeIPA server.

在FreeIPA server中,389服务负责存储Kerberos的数据。

SSSD负责在客户端自动获取、缓存服务信息。

SSSD

SSSD的主要目的是将远程数据库中的数据存储在本地缓存中,然后将这些数据提供给目标用户(应用程序)。使缓存保持最新和有效是一项困难的任务,要做到这一点,SSSD由多个组件(进程和库)组成,这些组件通过各种进程间通信技术相互通信。下面的图表让您对组件及其关系有一个基本的了解。下图对组件进行了更详细的描述。

BACKENDS 后端是写入本地缓存的唯一组件。


缓存查找

SSSD能够缓存许多对象类型,例如用户和组,但也可以缓存soutofs映射、sudo规则、SSH密钥等等。请求数据时执行缓存查找。查找是通过统一的cacheinterface执行的,因此,无论对象类型如何,所有查找都共享基本算法。下面的图表可以让您基本了解lookup是如何执行的。


Kerberos专用术语

身份验证服务器(AS)

一种服务器,它为所需的服务发出票证,然后将票证交给用户访问该服务。AS响应来自没有或没有随请求一起发送凭据的客户端的请求。它通常用于通过发出票证授予票证(TGT)来访问票证授予服务器(TGS)服务。AS通常与密钥分发中心(KDC)在同一主机上运行。

ciphertext 密文

加密数据。

client 客户

网络上可以从Kerberos接收票证的实体(用户、主机或应用程序)。

credentials 资格证书

一组临时的电子凭证,用于验证特定服务的客户端的身份。也叫罚单。

credential cache or ticket file 凭证缓存或票证文件

一种文件,其中包含加密用户与各种网络服务之间通信的密钥。Kerberos 5支持使用其他缓存类型(如共享内存)的框架,但更全面地支持文件。

crypt hash 加密哈希

用于验证用户身份的单向哈希。它们比使用未加密的数据更安全,但对于经验丰富的解密者来说,它们仍然相对容易解密。

GSS-API Generic Security Service Application Program Interface

通用安全服务应用程序接口(定义见互联网工程任务组发布的RFC-2743)是一组提供安全服务的功能。客户机和服务使用此API相互验证,而无需任何一个程序对底层机制有特定的了解。如果网络服务(如cyrus IMAP)使用GSS-API,则可以使用Kerberos进行身份验证。

hash

也称为哈希值。通过哈希函数传递字符串而生成的值。这些值通常用于确保传输的数据未被篡改。

hash function 散列函数

从输入数据生成数字“指纹”的一种方法。这些函数重新排列、转置或以其他方式更改数据以生成哈希值。

key 钥匙

加密或解密其他数据时使用的数据。加密的数据不能解密没有适当的密钥或一个非常好的运气的一部分解密。

key distribution center 密钥分发中心(KDC)

发出Kerberos票证的服务,通常与票证授予服务器(TGS)在同一主机上运行。

keytab (or key table)

包含未加密的主体及其密钥列表的文件。他们需要使用keykintab而不是使用keykintab从服务器检索文件。默认的keytab文件是 /etc/krb5.keytab。KDC管理服务器, /usr/kerberos/sbin/kadmind,是唯一使用任何其他文件的服务(它使用/var/kerberos/krb5kdc/kadm5.keytab ).

kinit

kinit命令允许已经登录的主体获取并缓存初始票证授予票证(TGT)。有关更多信息,请参阅kinit手册页。

principal (or principal name) 委托人(或委托人姓名)

主体是允许使用Kerberos进行身份验证的用户或服务的唯一名称。 遵循表格根[/instance]@领域。对于典型用户,根目录与其登录ID相同。实例是可选的。如果主体有一个实例,则用正斜杠(“/”)将其与根分隔开。空字符串(“”)被视为有效实例(这与默认的空实例不同),但使用它可能会令人困惑。一个领域中的所有主体都有自己的密钥,对于用户来说,密钥是从密码中派生出来的,或者是为服务随机设置的。

realm 领域

一种使用Kerberos的网络,由一个或多个称为KDCs的服务器和大量的客户机组成。

service 服务

通过网络访问的程序。

ticket 票

一组临时的电子凭证,用于验证特定服务的客户端的身份。也称为凭证。

ticket-granting server (TGS) 票证授予服务器(TGS)

一种服务器,它为所需的服务发出票证,然后将票证交给用户访问该服务。TGS通常与KDC运行在同一主机上。

ticket-granting ticket (TGT) 授权票(TGT)

一种特殊的票证,允许客户机在不从KDC申请的情况下获得额外的票证。

unencrypted password 未加密密码

一个纯文本,人类可读的密码。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值