gitlab,jenkins,gerrit,sonarqube auth with active directory

LDAP Admin

ldap Admin is a free Windows LDAP client and administration tool for LDAP directory management. This application lets you browse, search, modify, create and delete objects on LDAP server. It also supports more complex operations such as directory copy and move between remote servers and extends the common edit functions to support specific object types (such as groups and accounts).

测试账户

在这里插入图片描述

gitlab-ce


参考自:How to configure LDAP with GitLab CE
  • gitlab.rb添加如下配置
gitlab_rails['ldap_enabled'] = true
gitlab_rails['ldap_servers'] = {
'main' => {
  'label' => 'Windows AD',
  'host' =>  '192.168.22.129',
  'port' => 389,
  'uid' => 'userPrincipalName',
  'method' => 'plain',
  
  'active_directory' => true,
  'allow_username_or_email_login' => false,
  'block_auto_created_users' => false,
  'base' => 'ou=demo,dc=dev,dc=com',
  'user_filter' => '',

  'bind_dn' => 'CN=admin0,OU=demo,DC=dev,DC=com',
  'password' => 'xxxxxxx',

  # Only in EE
  'group_base' => 'ou=demo,dc=dev,dc=com',
  'admin_group' => 'DevAdmin'
  }
}
  • gitlab-ctl reconfigure && gitlab-ctl restart
最终效果

在这里插入图片描述

jenkins


  • 安装Active Directory插件
  • 配置在这里插入图片描述
  • 重新登录验证
    在这里插入图片描述

SonarQube 7.4


配置参考文档

# LDAP configuration
# General Configuration

sonar.security.realm=LDAP
sonar.authenticator.downcase=true

ldap.url=ldap://192.168.22.129:389
ldap.bindDn=cn=admin0,ou=demo,dc=dev,dc=com
ldap.bindPassword=xxxxxx
ldap.realm=dev.com

ldap.user.baseDn=ou=demo,dc=dev,dc=com
# ldap.user.request=(&(objectClass=user)(sAMAccountName={login}))
# 邮箱登录
ldap.user.request=(&(objectClass=user)(userPrincipalName={login}))
ldap.user.realNameAttribute=sAMAccountName
ldap.user.emailAttribute=mail

# 用户组必须在sonarqube中已经创建,否则不会同步成功
ldap.group.baseDn=ou=demo,dc=dev,dc=com
ldap.group.request=(&(objectClass=group)(member={dn}))
ldap.group.idAttribute=sAMAccountName

/etc/hosts中添加192.168.22.128 dev.com解析,不然会出现以下错误,域名解析超时,登录很慢在这里插入图片描述

Gerrit 2.16.2


参考

[ldap]
        server = ldap://192.168.22.129:389
        username = cn=admin0,ou=demo,dc=dev,dc=com
        #
        #accountPattern = (&(objectClass=user)(sAMAccountName=${username}))
        # email login
        accountPattern = (&(objectClass=user)(userPrincipalName=${username}))
        accountBase = ou=demo,dc=dev,dc=com
        accountFullName=userPrincipalName
        accountEmailAddress = mail
        groupBase = ou=demo,dc=dev,dc=com
        groupPattern=(&(objectClass=group)(cn=${groupname}))
  • LDAP GroupsLDAP groups are Account Groups that are maintained inside of your LDAP instance. If you are using LDAP to manage your groups they will not appear in the Groups list. However you can use them just like regular Account Groups by prefixing your group with "ldap/" in the Access Control for a project. For example "ldap/foo-project" will add the LDAP "foo-project" group to the access list.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

nowaits

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值