用户DNs不一致的组的rabbitmq ldap授权

用户DNs不一致的组的rabbitmq ldap授权,ldap,rabbitmq,pattern-matching,Ldap,Rabbitmq,Pattern Matching,我正在尝试使用组中的或嵌套的查询,针对LDAP(Microsoft Active Directory)设置rabbitmq授权。然而,由于我们的OU结构在我们的用户中不一致,这导致了各种DN模式,因此我不得不依赖于user\u DN\u模式,该模式在绑定时只需传递“domain\account”,从Microsoft Active Directory的身份验证角度来看效果非常好。但是,当涉及到\u group/in\u group\u嵌套的查询时,它不匹配,因为members属性是实际DN的列表

我正在尝试使用组中的
或嵌套的
查询,针对LDAP(Microsoft Active Directory)设置rabbitmq授权。然而,由于我们的
OU
结构在我们的用户中不一致,这导致了各种
DN
模式,因此我不得不依赖于
user\u DN\u模式
,该模式在绑定时只需传递
“domain\account”
,从Microsoft Active Directory的身份验证角度来看效果非常好。但是,当涉及到\u group
/
in\u group\u嵌套的
查询时,它不匹配,因为members属性是实际
DN
的列表,并且日志显示它正在尝试在成员列表中查找
“域\帐户”


由于LDAP插件需要一个模式来从提供的用户名构造
DN
s,我在RabbitMQ中使用组级LDAPauthorization是不是运气不好?

即使考虑到DN不一致,也应该是可能的,这里的问题似乎存在于身份验证期间将用户名转换为DNs的方式中

不要依赖dn模式,而是尝试通过LDAP查找

关键是设置
dn\u lookup\u bind
在用户身份验证之前进行查找。这样,LDAP插件将首先使用这些凭据进行绑定以进行查找,然后使用匹配条目的DN进行绑定以进行用户登录:

auth_ldap.dn_lookup_attribute = userPrincipalName     # or sAMAccountName
auth_ldap.dn_lookup_base = dc=example,dc=com          # restrict to user ou if any
auth_ldap.dn_lookup_bind = {managerDN, Password}      # AD manager account

# auth_ldap.user_dn_pattern should be left unset to be sure the lookup actually searches 
# for a match in dn_lookup_attribute and not for a built-up dn. 
我提到了来自“广告经理”的凭据,但它可以是具有足够权限对目标用户条目执行搜索的任何帐户

鉴于这种配置,当插件进入授权过程时,它可以使用实际用户dn正确处理组成员身份查找


编辑-不管文档中如何说明
auth\u ldap.dn\u lookup\u bind

要在绑定前执行查找,请将auth_ldap.dn_lookup_bind设置为 元组
{UserDN,Password}

可以更安全地显式设置:

auth_ldap.dn_lookup_bind.user_dn = <UserDN>
auth_ldap.dn_lookup_bind.password = <Password>
# (OP was required to do so to make it work)
auth\u ldap.dn\u lookup\u bind.user\u dn=
auth_ldap.dn_lookup_bind.password=
#(OP必须这样做才能使其发挥作用)

请回答您的问题,并提供您想要匹配的DNs的示例。还请包括您尝试过的模式。也许可以定义一个匹配所有情况的模式。这很好地解决了我的问题,但我必须将dn_lookup_bind分为dn_lookup_bind.user_dn和dn_lookup_bind.password。如果我没有这样做,rabbitmq服务器将无法启动,但我可能已经做了其他错误的事情。感谢反馈,我将进行编辑以向其他人说明。