19.3.2. 附加 Active Directory

先决条件

  • 您需要知道 Active Directory 林名称。林名称也称为根域名。

    注意

    / usr/share/ovirt-engine-extension-aaa-ldap-setup 工具中提供了最常见的 Active Directory 配置示例,它不能使用 ovirt-engine-extension-aaa-ldap/examples/README.md 提供。

  • 您需要将可解析 Active Directory 林名称的 DNS 服务器添加到 Manager 上的 /etc/resolv.conf 文件,或者记下 Active Directory DNS 服务器,并在交互式设置脚本提示时输入它们。
  • 要在 LDAP 服务器和 Manager 间设置安全连接,请确保已准备了 PEM 编码的 CA 证书。如需更多信息,请参阅 第 D.2 节 “在 Manager 和 LDAP 服务器间设置加密通信”
  • 除非支持匿名搜索,否则具有可浏览所有用户和组权限的用户必须可用于 Active Directory,才能用作搜索用户。请注意搜索用户的可识别名称(DN)。不要将管理员用户用于 Active Directory。
  • 您必须至少有一个帐户名称和密码已就绪,才能对 Active Directory 执行搜索和登录查询。
  • 如果您的 Active Directory 部署跨越多个域,请注意 /usr/share/ovirt-engine-extension-aaa-ldap/profiles/ad.properties 文件中所描述的限制。

配置外部 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. 输入对应数字来选择 LDAP 类型。此步骤后 LDAP 相关问题对于不同的 LDAP 类型是不同的。

    Available LDAP implementations:
     1 - 389ds
     2 - 389ds RFC-2307 Schema
     3 - Active Directory
     4 - IBM Security Directory Server
     5 - IBM Security Directory Server RFC-2307 Schema
     6 - IPA
     7 - Novell eDirectory RFC-2307 Schema
     8 - OpenLDAP RFC-2307 Schema
     9 - OpenLDAP Standard Schema
    10 - Oracle Unified Directory RFC-2307 Schema
    11 - RFC-2307 Schema (Generic)
    12 - RHDS
    13 - RHDS RFC-2307 Schema
    14 - iPlanet
    Please select: 3
  4. 输入 Active Directory 林名称。如果 Manager 的 DNS 无法解析林名称,该脚本会提示您输入一个空格分隔的 Active Directory DNS 服务器名称列表。

    Please enter Active Directory Forest name: ad-example.redhat.com
    [ INFO  ] Resolving Global Catalog SRV record for ad-example.redhat.com
    [ INFO  ] Resolving LDAP SRV record for ad-example.redhat.com
  5. 选择 LDAP 服务器支持的安全连接方法,并指定获取 PEM 编码的 CA 证书的方法。file 选项允许您提供证书的完整路径。URL 选项允许您指定证书的 URL。使用 inline 选项,将证书的内容粘贴到终端中。system 选项允许您指定所有 CA 文件的位置。insecure 选项允许您在不安全模式中使用 startTLS。

    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 服务器间设置加密通信”

  6. 输入搜索用户可分辨名称(DN)。用户必须具有权限才能浏览目录服务器上的所有用户和组。搜索用户必须是 LDAP 注解。如果允许匿名搜索,请按 Enter 键,无需输入。

    Enter search user DN (empty for anonymous): cn=user1,ou=Users,dc=test,dc=redhat,dc=com
    Enter search user password:
  7. 指定是否为虚拟机使用单点登录。此功能默认是启用的,但如果启用了对管理门户的单点登录,则无法使用。该脚本提醒您配置集名称必须与域名匹配。在虚拟机管理指南中,您仍需要遵循 为虚拟机配置单点登录 的说明

    Are you going to use Single Sign-On for Virtual Machines (Yes, No) [Yes]:
  8. 指定配置集名称。配置集名称对登录页面上的用户可见。这个示例使用 redhat.com

    Please specify profile name that will be visible to users:redhat.com

    图 19.2. 管理门户登录页面

    AAA login 配置集
    注意

    第一次登录时,用户需要从下拉列表中选择所需的配置集。然后,信息会存储在浏览器 Cookie 中,并在用户下一次登录时预选择。

  9. 测试搜索和登录功能,以确保您的 LDAP 服务器已正确地连接到您的 Red Hat Virtualization 环境。对于登录查询,请输入帐户名称和密码。对于搜索查询,为用户帐户选择 Principal,然后选择 Group for group for group。如果您希望返回用户帐户的组帐户信息,对于 Resolve Groups 选择 Yes。选择 Done 以完成设置。会创建三个配置文件,并显示在屏幕输出中。

    NOTE:
    It is highly recommended to test drive the configuration before applying it into engine.
    Login sequence is executed automatically, but it is recommended to also execute Search sequence manually after successful Login 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 服务器上分配适当的角色和权限,如要登录到虚拟机门户,请参阅 第 19.7 节 “从管理门户管理用户任务”
注意

如需更多信息,请参阅 /usr/share/doc/ovirt-engine-extension-aaa-ldap-version 中的 LDAP 身份验证和授权扩展 README 文件。