首页 > 解决方案 > RabbitMQ in_group 过滤器在 Active Directory 中出现错误

问题描述

我无法让 RabbitMQ in_group 过滤器与 Active Directory 一起使用。它试图替换我的用户名,但我的 in_group 模式中没有 ${username} 变量:'CN="rabbitmq-${vhost}-users",OU=Groups,DC=example,DC=com'。我可以登录,但是当我尝试添加新队列时,出现以下错误。在 tag_queries = true 中设置“管理员”可以访问所有 vHost。我将其设置为 false,现在我正在尝试通过使用 Active Directory 的 vhost_access_query 来限制 vHost 的用户管理员访问。

CRASH REPORT Process <0.495.0> with 1 neighbours exited with reason: 
bad argument in call to re:replace('CN="rabbitmq-${vhost}-users",OU=Groups,DC=example,DC=com',
["\\${username}"], ["smitchell"], [global]) line 398

以下是 rabbitmq.conf 中的设置。

auth_ldap.servers.1           = ad.example.com
auth_ldap.port                = 389
auth_ldap.use_ssl             = false
auth_backends.1               = rabbit_auth_backend_internal
auth_backends.2               = rabbit_auth_backend_ldap
auth_ldap.dn_lookup_attribute = sAMAccountName
auth_ldap.dn_lookup_base      = DC=example,DC=com
auth_ldap.user_dn_pattern     = ${username}@example.com
# auth_ldap.user_bind_pattern = ${username}@example.com <-- Same error with this

user_dn_pattern 作为 ${username}@example.com 或 $example$(username} 工作,与从 Apache Directory Studio 登录相同。

这是高级配置。

[
  {rabbitmq_auth_backend_ldap, [
    {group_lookup_base, "OU=Groups,DC=example,DC=com"},

    {vhost_access_query, {in_group, 'CN="rabbitmq-${vhost}-users",OU=Groups,DC=example,DC=com', "member"}},

    {tag_queries, [
      {administrator, {constant, false}},
      {management, {constant, true}}
    ]}
 ]}
].

标签: active-directoryrabbitmq

解决方案


推荐阅读