user_filter vs base限制对LDAP用户的访问

时间:2018-06-02 06:30:21

标签: ldap gitlab

在Gitlab的documentation中,可以通过baseuser_filter进一步限制LDAP用户。所以我的问题是:

  1. base
  2. 的用途
  3. 何时使用base以及何时使用user_filter限制gitlab中的LDAP用户。

1 个答案:

答案 0 :(得分:1)

base指定搜索的起始点,其值是数据库中存在的可分辨名称。

这与user_filter不同,后者是search filter,与ldapsearch中一样:

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

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

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会自动将您指定的过滤器与用户的uid连接起来   不要使用uid部分,只需使用user_filter:

'memberOf=CN=gitlab,DC=test,DC=com'
相关问题