gitlab、jenkins等应用集成ldap
gitlab、jenkins等应用集成ldap
文档
- openldap安装 -添加条目
- gitlab、jenkins等应用集成ldap
gitlab集成ldap
-
gitlab版本:gitlab-jh-17.7.0
-
ldap版本:openldap-2.6.10
-
修改
/etc/gitlab/gitlab.rb
文件,编辑相关信息gitlab_rails['ldap_enabled'] = true gitlab_rails['ldap_servers'] = {'main' => {'label' => 'LDAP服务','host' => '192.168.91.130','port' => 389,'uid' => 'uid','bind_dn' => 'CN=Manager,DC=my-domain,DC=com','password' => 'secret','encryption' => 'plain','verify_certificates' => false,'timeout' => 10,'active_directory' => false,'user_filter' => '','base' => 'ou=People,dc=my-domain,dc=com','lowercase_usernames' => 'false','retry_empty_result_with_codes' => [80],'allow_username_or_email_login' => false,'block_auto_created_users' => false} }
label
:gitlab登录页面的页签显示内容host
:ldap服务器地址port
:服务器端口uid
:ldap用户的哪个属性做为登录账号bind_on
:ldap管理员password
:ldap密码encryption
:加密方法user_filter
:ldap过滤条件base
:在ldap的哪个目录下搜索用户
-
保存文件并重新配置极狐GitLab
sudo gitlab-ctl reconfigure
-
参考:
- https://gitlab.cn/docs/jh/administration/auth/ldap/index.html#configure-ldap
- https://cloud.tencent.com/developer/article/1193728
jenkins集成ldap
- jenkins版本:2.504.3
- ldap版本:openldap-2.6.10
- 备份jenkins的配置文件,通常路径为:
/root/.jenkins/config.xml
。配置异常导致无法登录时,可以还原该配置文件,重启服务后,服务会恢复到配置前的状态 - 管理账号登录jenkins,依次点击
Manage Jenkins
-Security
,找到Authentication
,安全域选择LDAP
,配置项如下:Server
:ldap://192.168.91.130:389
,ldap服务器地址root DN
:不填User search base
:ou=People,dc=my-domain,dc=com
User search filter
:uid={0}
Group search base
:ou=People,dc=my-domain,dc=com
Manager DN
:CN=Manager,DC=my-domain,DC=com
,管理员Manager Password
:密码Display Name LDAP attribute
:givenName
,用户条目的属性,显示用户名使用该属性Email Address LDAP attribute
:mail
- 授权策略:
Anyone can do anything
- 保存配置,重新登录即可
- 参考:
- https://www.cnblogs.com/wangyuanguang/p/18194239
- https://blog.csdn.net/weixin_42182599/article/details/130113675