Kubernetes Nifi 集群 LDAP 配置

Kubernetes Nifi 集群 LDAP 配置

我们正在使用塞蒂克/头盔对于 nifi 集群。我们已配置 LDAP 凭据,如下所示:

 ldap:
    enabled: true
    host: "ldaps://ldaphost.net"
    searchBase: "ou=People,o=ABC" #CN=Users,DC=ldap,DC=example,DC=be
    admin: "cn=Keycloak_business_managed_Acc,ou=SystemUsers,ou=Accounts,o=ABC"
    pass: changeme
    searchFilter: (objectClass=abcEDPerson, inetorgperson, organizationalPerson, person, top, dspswuser, posixAccount, shadowAccount)
    userIdentityAttribute: uid
    authStrategy: SIMPLE # How the connection to the LDAP server is authenticated. Possible values are ANONYMOUS, SIMPLE, LDAPS, or START_TLS.
    identityStrategy: USE_USERNAME
    authExpiration: 12 hours
    userSearchScope: SUBTREE # Search scope for searching users (ONE_LEVEL, OBJECT, or SUBTREE). Required if searching users.
    groupSearchScope: SUBTREE # Search scope for searching groups (ONE_LEVEL, OBJECT, or SUBTREE). Required if searching groups.

但是,当我们尝试使用 NIFI UI 中的个人登录帐户登录时,我们总是会得到无效的用户凭据。

通过 ldapsearch 也可以实现同样的效果

root@bh-gsn-57-asca-dev-01:~# ldapsearch -h ldaphost.net -D "cn=Keycloak_business_managed_Acc,ou=SystemUsers,ou=Accounts,o=ABC" -w "changeme" -b "ou=people,o=abc" uid=myuserid
# extended LDIF
#
# LDAPv3
# base <ou=people,o=abc> with scope subtree
# filter: uid=myuserid
# requesting: ALL
#

# 62XXXXXX, Internal, People, ABC
dn: employeeNumber=62XXXXXX,ou=Internal,ou=People,o=ABC
displayName: Prabir Choudhury (ABC-D)

请指正我做错了什么。

我从文档中了解到,管理员 DN(管理员)/密码基本上是管理员的 DN 和密码,用于绑定到 LDAP 服务器以搜索用户。因此,我们提供 BIND DN 代替admin并提供 BIND PASSWORD 代替pass

答案1

看来您的hostsearchFilter设置是错误的。为了复制ldapsearch命令,您需要以下配置:

auth: 
  
  # ... 
  
  ldap:
    enabled: true
    host: "ldap://ldaphost.net:389"
    searchBase: "ou=People,o=ABC"
    admin: "cn=Keycloak_business_managed_Acc,ou=SystemUsers,ou=Accounts,o=ABC"
    pass: changeme
    searchFilter: (uid={0})
    userIdentityAttribute: uid
    authStrategy: SIMPLE
    identityStrategy: USE_USERNAME
    authExpiration: 12 hours
    userSearchScope: SUBTREE
    groupSearchScope: SUBTREE

然而 -在撰写本文时- 这不会起作用,因为配置文件登录身份提供者-ldap.xml授权者.xml具有硬编码值,特别是搜索过滤器:

<property name="User Search Filter">(cn={0})</property>

应该是:

<property name="User Search Filter">{{.Values.auth.ldap.searchFilter}}</property>

有 2 个拉取请求可解决此问题(#260#280)。我想您可以尝试暂时手动修复此问题,直到它们合并为止,可以按照上述方法操作,也可以直接在 ldap 登录身份提供程序配置中设置正确的值,就像您在没有 Helm 的情况下所做的那样。

https://nifi.apache.org/docs/nifi-docs/html/administration-guide.html#ldap_login_identity_provider

相关内容