【问题标题】:Configure GitLab with open LDAP使用开放 LDAP 配置 GitLab
【发布时间】:2016-07-28 10:41:19
【问题描述】:

我正在尝试使用openldap 配置我的gitlab 来验证用户身份。我已经配置了 openldap,它与Jenkins 一起工作正常。但是gitlab 给出的错误是Could not authenticate you from Ldapmain because "Invalid credentials".

以下是gitlab.rb 配置:

gitlab_rails['ldap_enabled'] = true
 gitlab_rails['ldap_servers'] = YAML.load <<-'EOS' # remember to close this block with 'EOS' below
   main: # 'main' is the GitLab 'provider ID' of this LDAP server
     label: 'LDAP'
     host: 'localhost'
     port: 389
     uid: 'uid'
     method: 'plain' # "tls" or "ssl" or "plain"
     bind_dn: 'cn=admin,dc=ldap,dc=com'
     password: 'waqas'
     active_directory: false
     allow_username_or_email_login: true
    #block_auto_created_users: false
     base: 'cn=Appliance,dc=ldap,dc=com'
     user_filter: ''
# attributes:
#   username: ['uid', 'userid', 'sAMAccountName']
#   email:    ['mail', 'email', 'userPrincipalName']
#   name:       'cn'
#       first_name: 'givenName'
#       last_name:  'sn'
#     ## EE only
#    group_base: 'ou=W-Integrate,dc=ldap,dc=com'
     #admin_group: 'cn=admin,dc=ldap,dc=com'
#     sync_ssh_keys: false
#

 EOS

我的 openLDAP 屏幕截图也附上了。任何人都可以纠正我做错了什么。

【问题讨论】:

  • 只修改base dn就行了吗?
  • 是的,它就像一个魅力......谢谢????
  • \o/,或者更确切地说:٩(。•́‿•̀。)۶

标签: git ldap gitlab openldap


【解决方案1】:

你的基础不应该是一个用户(或inetOrgPerson,用户组cn=Appliance),它应该限于dc entries for a base dn

base: 'dc=ldap,dc=com'

这与 bind_dn 不同,绑定帐户确实引用了一个用户:bind_dn: 'cn=admin,dc=ldap,dc=com':那里有一个 cn


请注意,自GitLab 13.7(2020 年 12 月)起:

支持加密的 LDAP 凭据

GitLab 使用统一的配置文件,例如 Omnibus GitLab 中的 gitlab.rb,这使得所有捆绑服务的配置变得容易。

此配置文件中包含一些秘密,例如 向 LDAP 服务器进行身份验证的凭据。
虽然访问此文件确实需要提升权限,但最佳实践 是将秘密与配置分开。

Omnibus GitLab 和源安装现在支持encrypted credentials,支持的第一个凭据是 LDAP。
这降低了 GitLab 配置文件的敏感性,也有助于满足客户的合规性要求。

请参阅 DocumentationIssue

【讨论】:

    猜你喜欢
    • 2015-04-10
    • 2017-07-26
    • 2015-03-16
    • 1970-01-01
    • 2014-07-07
    • 2017-02-15
    • 1970-01-01
    • 2014-09-04
    • 1970-01-01
    相关资源
    最近更新 更多