美文网首页
Gerrit对接LDAP

Gerrit对接LDAP

作者: 87d6dc4b11a7 | 来源:发表于2024-11-10 08:58 被阅读0次

当前部署的gerrit实例使用的 HTTP基本身份验证,即gerrit.config中的auth.type 字段为 HTTP

1、修改gerrit.config

[auth]
        type = LDAP
        gitBasicAuthPolicy = LDAP
[ldap]
        server = ldap://ldap.mydomain.com:636
        username = <user_uid>

        accountBase = ou=用户,dc=byd,dc=com
        accountFullName = displayName
        accountEmailAddress = mail

2、编辑secure.config

[ldap]
    password = <user_password>

3、修改修改docker-compose.yml,注释掉 httpd部分
4、重启

# 停止
docker-compose down
# 启动
docker-compose up -d

5、访问地址

  • HTTP_LDAP
    Exactly like HTTP (above), but additionally Gerrit pre-populates a user’s full name and email address based on information obtained from the user’s account object in LDAP. The user’s group membership is also pulled from LDAP, making any LDAP groups that a user is a member of available as groups in Gerrit. Hence the _LDAP suffix in the name of this authentication type. Gerrit does NOT authenticate the user via LDAP.

    与上面的HTTP完全相同,但Gerrit根据从LDAP中的用户帐户对象获得的信息预填充用户的全名和电子邮件地址。用户的组成员关系也从LDAP中提取,使得用户所属的任何LDAP组都可以作为Gerrit中的组使用。因此,在此身份验证类型的名称中使用_LDAP后缀。Gerrit不通过LDAP认证用户。

  • CLIENT_SSL_CERT_LDAP
    This authentication type is actually kind of SSO. Gerrit will configure Jetty’s SSL channel to request the client’s SSL certificate. For this authentication to work a Gerrit administrator has to import the root certificate of the trust chain used to issue the client’s certificate into the <review-site>/etc/keystore. After the authentication is done Gerrit will obtain basic user registration (name and email) from LDAP, and some group memberships. Hence the _LDAP suffix in the name of this authentication type. Gerrit does NOT authenticate the user via LDAP. This authentication type can only be used under hosted daemon mode, and the httpd.listenUrl must use https:// as the protocol. Optionally, certificate revocation list file can be used at <review-site>/etc/crl.pem. For details, see httpd.sslCrl.

  • LDAP
    Gerrit prompts the user to enter a username and a password, which it then verifies by performing a simple bind against the configured ldap.server. In this configuration the web server is not involved in the user authentication process.

    The actual username used in the LDAP simple bind request is the account’s full DN, which is discovered by first querying the directory using either an anonymous request, or the configured ldap.username identity. Gerrit can also use kerberos if ldap.authentication is set to GSSAPI.

    If auth.gitBasicAuthPolicy is set to HTTP, the randomly generated HTTP password is used for authentication. On the other hand, if auth.gitBasicAuthPolicy is set to HTTP_LDAP, the password in the request is first checked against the HTTP password and, if it does not match, it is then validated against the LDAP password. Service users that are internal-only are authenticated by their HTTP passwords.

    Gerrit提示用户输入用户名和密码,然后通过对配置的ldap.server执行简单绑定来验证。在这种配置中,web服务器不参与用户身份验证过程。

    LDAP简单绑定请求中使用的实际用户名是帐户的完整DN,这是通过使用匿名请求或配置的LDAP首先查询目录来发现的。用户名的身份。Gerrit也可以在ldap中使用kerberos。鉴权设置为GSSAPI。

    如果身份验证。giitbasicauthpolicy设置为HTTP时,使用随机生成的HTTP密码进行鉴权。另一方面,它是正确的。giitbasicauthpolicy设置为HTTP_LDAP,则首先根据HTTP密码检查请求中的密码,如果不匹配,则根据LDAP密码进行验证。仅限内部的业务用户使用HTTP密码进行认证。

  • LDAP_BIND
    Gerrit prompts the user to enter a username and a password, which it then verifies by performing a simple bind against the configured ldap.server. In this configuration the web server is not involved in the user authentication process.

    Unlike LDAP above, the username used to perform the LDAP simple bind request is the exact string supplied in the dialog by the user. The configured ldap.username identity is not used to obtain account information.

参考链接:
https://gerrit-documentation.storage.googleapis.com/Documentation/3.9.5/config-gerrit.html#ldap

相关文章

  • gerrit3使用教程

    环境搭建使用gerrit+ldap的方式,gerrit账号为管理员预设。 登录 右上角点击sign in 输入账号...

  • k8s接入ldap

    为了对接上 LDAP,可谓是煞费苦心。网上能找到的对接上 LDAP 的方案,都得在 LDAP 上自定义一个 tok...

  • 【gerrit】Invalid username or pass

    背景 gerrit使用的LDAP域账号登录,近期有用户反馈域账号无法登录,报错Invalid username o...

  • jira对接ldap

    对接LDAP配置 管理员账号登陆jira后,点击 用户管理image.png 用户管理 -> 用户目录-> 添加目...

  • Gerrit日常维护记录

    Gerrit日常维护记录 Gerrit代码审核工具是个好东西,尤其是在和Gitlab和Jenkins对接后,在代码...

  • 使用js对接ldap

    demo 登录鉴权的几种方式

  • Python对接LDAP/AD的过程详解

    不同公司的 LDAP/AD 服务配置各不相同,很难封装一个通用的方法,所以我们在对接 LDAP/AD 的过程中,需...

  • jenkins和gerrit的对接

    jenkins中安装gerrit相关的插件。然后参考下面进行设置:https://wiki.jenkins.io/...

  • 对接gerrit的编码实现

    一、引入gerrit api的jar包 二、整体流程 1、创建负责人组 如果组已存在,则直接返回;如果不存在,则新...

  • xxl-job对接ldap

    0、pom.xml 1、LdapConfiguration.java 2、LdapProperties.java ...

网友评论

      本文标题:Gerrit对接LDAP

      本文链接:https://www.haomeiwen.com/subject/mcdrdjtx.html