gpt4 book ai didi

ldap - 用户过滤器和限制 LDAP 用户访问的基础

转载 作者:行者123 更新时间:2023-12-01 16:40:14 27 4
gpt4 key购买 nike

documentation Gitlab 的规定,对 LDAP 用户的限制可以通过 base 给出,并进一步通过 user_filter 给出。所以我的问题是:

  1. base有什么用
  2. 何时使用 base 以及何时使用 user_filter 来限制 gitlab 中的 LDAP 用户。

最佳答案

base 指定搜索的起点,其值是数据库中存在的专有名称。

这与 user_filter 不同,后者是 search filter ,如 ldapsearch 中所示:

(&(objectClass=person)(objectClass=user))

因此 GitLab 会将 user_filter 指令转换为 objectClass=user ldap 搜索过滤器。
但这仅适用于 base 中指定的基本树下方的 LDAP 对象。

GitLab LDAP configuration显示一个示例:

##
## Filter LDAP users
##
## Format: RFC 4515 https://tools.ietf.org/search/rfc4515
## Ex. (employeeType=developer)
##
## Note: GitLab does not support omniauth-ldap's custom filter syntax.
##
## Example for getting only specific users:
## '(&(objectclass=user)(|(samaccountname=momo)(samaccountname=toto)))'
##
user_filter: ''

所以查看RFC 4515 ,但是:
另请参阅issue 14464 :

GItLab automatically joins the filter you specify with the user's uid.
Leave off the uid part and just use user_filter:

'memberOf=CN=gitlab,DC=test,DC=com'

关于ldap - 用户过滤器和限制 LDAP 用户访问的基础,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50654172/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com