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