Red Hat Training

A Red Hat training course is available for Red Hat Virtualization

15.3. 配置外部 LDAP 提供程序

15.3.1. 配置外部 LDAP 提供程序(交互设置)

ovirt-engine-extension-aaa-ldap 扩展允许用户轻松自定义其外部目录设置。ovirt-engine-extension-aaa-ldap 扩展支持许多不同的 LDAP 服务器类型,并且提供了交互式设置脚本来帮助您设置大多数 LDAP 类型。
如果交互式设置脚本中没有列出 LDAP 服务器类型,或者您想要进行更多自定义,则可以手动编辑配置文件。如需更多信息,请参阅 第 15.3.3 节 “配置外部 LDAP 提供程序(Manual 方法)”
有关 Active Directory 示例,请参阅 第 15.3.2 节 “附加 Active Directory”

先决条件:

  • 您需要知道 DNS 或 LDAP 服务器的域名。也支持循环和故障转移策略。
  • 要在 LDAP 服务器和管理器之间设置安全连接,请确保已准备好 PEM 编码的 CA 证书。如需更多信息,请参阅 第 D.2 节 “在 Manager 和 LDAP 服务器之间设置 SSL 或 TLS 连接”
  • 除非支持匿名搜索,否则在要用作搜索用户的目录服务器上必须有权限浏览所有用户和组的用户。请注意搜索用户的可分辨名称(DN)。不要将管理用户用于目录服务器。
  • 至少一组帐户名称和密码可以向 LDAP 服务器执行搜索和登录查询。

过程 15.1. 配置外部 LDAP 提供程序

  1. 在 Red Hat Virtualization Manager 上安装 LDAP 扩展软件包:
    # yum install ovirt-engine-extension-aaa-ldap-setup
  2. 运行 ovirt-engine-extension-aaa-ldap-setup 以启动交互式设置:
    # ovirt-engine-extension-aaa-ldap-setup
  3. 指定一个配置集名称。配置集名称对登录页面的用户可见。这个示例使用 redhat.com
    注意
    要在域配置后重命名配置集,请编辑 /etc/ovirt-engine/extensions.d/redhat.com-authn.properties 文件中的 ovirt.engine.aaa.authn.profile. name 属性。重启引擎服务以使更改生效。
    Please specify profile name that will be visible to users:redhat.com

    图 15.1. 管理门户登录页面

    管理门户登录页面
    注意
    首次登录时,用户需要从下拉列表中选择所需的配置集。然后,信息会存储在浏览器 Cookie 中,并在下次用户登录时预先选择这些信息。
  4. 输入对应的数字来选择 LDAP 类型。如果您不确定您的 LDAP 服务器是哪种模式,请选择 LDAP 服务器类型的标准模式。对于 Active Directory,请按照 第 15.3.2 节 “附加 Active Directory” 的步骤操作。
    Available LDAP implementations:
    1 - 389ds
    2 - 389ds RFC-2307 Schema
    3 - Active Directory
    4 - IPA
    5 - Novell eDirectory RFC-2307 Schema
    6 - OpenLDAP RFC-2307 Schema
    7 - OpenLDAP Standard Schema
    8 - Oracle Unified Directory RFC-2307 Schema
    9 - RFC-2307 Schema (Generic)
    10 - RHDS
    11 - RHDS RFC-2307 Schema
    12 - iPlanet
    Please select: 10
  5. Enter 接受默认信息并为 LDAP 服务器名称配置域名:
    It is highly recommended to use DNS resolution for LDAP server.
    If for some reason you intend to use hosts or plain address disable DNS usage.
    Use DNS (Yes, No) [Yes]:
  6. 输入对应的数字来选择 DNS 策略方法:
    1 - Single server
    2 - DNS domain LDAP SRV record
    3 - Round-robin between multiple hosts
    4 - Failover between multiple hosts
    Please select:
    • 对于选项 1,/etc/resolv.conf 中列出的 DNS 服务器用于解析 IP 地址。确保 /etc/resolv.conf 文件使用正确的 DNS 服务器更新。
      输入完全限定域名(FQDN)或 LDAP 服务器的 IP 地址。您可以使用带有 SRV 记录的 dig 命令来查找域名。SRV 记录采用以下格式:_服务._协议..域名。例如: dig _ldap._tcp.redhat.com SRV
    • 对于选项 2,请输入 DNS 服务器的域名。执行 DNS 搜索来查找 SRV 记录,以查找 LDAP 服务器的域名。
    • 对于选项 3,请输入以空格分隔的 LDAP 服务器列表。使用服务器的 FQDN 或 IP 地址。此策略在 LDAP 服务器之间提供负载平衡。查询会根据循环算法在所有 LDAP 服务器中分发。
    • 对于选项 4,请输入以空格分隔的 LDAP 服务器列表。使用服务器的 FQDN 或 IP 地址。此策略定义第一个要响应查询的默认 LDAP 服务器。如果第一个服务器不可用,查询将转至列表上的下一个 LDAP 服务器。
  7. 选择 LDAP 服务器支持的安全连接方法,并指定获取 PEM 编码的 CA 证书的方法。file 选项允许您提供证书的完整路径。URL 选项允许您指定证书的 URL。使用 inline 选项在终端中粘贴证书的内容。system 选项允许您为所有 CA 文件指定默认位置。如果选择了不安全模式,则连接仍然使用 TLS 加密,但跳过了证书验证。
    NOTE:
    It is highly recommended to use secure protocol to access the LDAP server.
    Protocol startTLS is the standard recommended method to do so.
    Only in cases in which the startTLS is not supported, fallback to non standard ldaps protocol.
    Use plain for test environments only.
    Please select protocol to use (startTLS, ldaps, plain) [startTLS]: startTLS
    Please select method to obtain PEM encoded CA certificate (File, URL, Inline, System, Insecure): File
    Please enter the password:
    注意
    LDAPS 代表轻量级目录访问协议 覆盖安全套接字链接。对于 SSL 连接,请选择 ldaps 选项。
    有关创建 PEM 编码的 CA 证书的更多信息,请参阅 第 D.2 节 “在 Manager 和 LDAP 服务器之间设置 SSL 或 TLS 连接”
  8. 输入搜索用户可分辨名称(DN)。用户必须具有相应的权限,才能浏览目录服务器上的所有用户和组。搜索用户必须在 LDAP 注解中指定。如果允许匿名搜索,请在没有任何输入的情况下按 Enter 键。
    Enter search user DN (empty for anonymous): uid=user1,ou=Users,dc=test,dc=redhat,dc=com
    Enter search user password:
  9. 测试搜索和登录功能,以确保您的 LDAP 服务器正确连接到您的 Red Hat Virtualization 环境。对于登录查询,请输入帐户名称和密码。对于搜索查询,请为用户帐户选择 Principal,然后选择 Group for group accounts。如果您希望返回用户帐户的组帐户信息,对于 Resolve Groups 选择 Yes。选择 Done 以完成设置。在屏幕输出中创建并显示三个配置文件。
    NOTE:
    It is highly recommended to test drive the configuration before applying it into engine.
    Perform at least one Login sequence and one Search sequence.
    Select test sequence to execute (Done, Abort, Login, Search) [Abort]: Login
    Enter search user name: testuser1
    Enter search user password:
    [ INFO  ] Executing login sequence...
    ...
    Select test sequence to execute (Done, Abort, Login, Search) [Abort]: Search
    Select entity to search (Principal, Group) [Principal]:
    Term to search, trailing '*' is allowed: testuser1
    Resolve Groups (Yes, No) [No]: 
    [ INFO  ] Executing login sequence...
    ...
    Select test sequence to execute (Done, Abort, Login, Search) [Abort]: Done
    [ INFO  ] Stage: Transaction setup
    [ INFO  ] Stage: Misc configuration
    [ INFO  ] Stage: Package installation
    [ INFO  ] Stage: Misc configuration
    [ INFO  ] Stage: Transaction commit
    [ INFO  ] Stage: Closing up
              CONFIGURATION SUMMARY
              Profile name is: redhat.com
              The following files were created:
                  /etc/ovirt-engine/aaa/redhat.com.properties
                  /etc/ovirt-engine/extensions.d/redhat.com-authz.properties
                  /etc/ovirt-engine/extensions.d/redhat.com-authn.properties
    [ INFO  ] Stage: Clean up
              Log file is available at /tmp/ovirt-engine-extension-aaa-ldap-setup-20160114064955-1yar9i.log:
    [ INFO  ] Stage: Pre-termination
    [ INFO  ] Stage: Termination
  10. 重新启动引擎服务。您创建的配置集现在包括在管理门户和开发人员门户登录页面中。要在 LDAP 服务器上分配适当的角色和权限,例如登录到客户门户网站,请参阅 第 15.6 节 “从管理门户管理用户任务”
    # systemctl restart ovirt-engine.service
注意
如需更多信息,请参阅位于 /usr/share/doc/ovirt-engine-extension-aaa-ldap-version 的 LDAP 身份验证和授权扩展 README 文件。