本文档采用自动化机器翻译技术翻译。 尽管我们力求提供准确的译文,但不对翻译内容的完整性、准确性或可靠性作出任何保证。 若出现任何内容不一致情况,请以原始 英文 版本为准,且原始英文版本为权威文本。

配置 PingIdentity (SAML)

如果您的组织使用 Ping 身份提供者 (IdP) 进行用户身份验证,您可以配置 Rancher 以允许用户使用其 IdP 凭据登录。

先决条件:

  • 您必须配置一个 Ping IdP 服务器

  • 以下是配置所需的 Rancher 服务提供者 URL: 元数据 URL:https://<rancher-server>/v1-saml/ping/saml/metadata 断言消费者服务 (ACS) URL:https://<rancher-server>/v1-saml/ping/saml/acs 请注意,这些 URL 在身份验证配置保存在 Rancher 中之前不会返回有效数据。

  • 从您的 IdP 服务器导出一个 metadata.xml 文件。有关更多信息,请参见 PingIdentity 文档

  1. 在左上角,点击 ☰ > 用户与身份验证

  2. 在左侧导航菜单中,点击 身份验证提供者

  3. 单击 Ping Identity

  4. 完成 配置 Ping 账户 表单。Ping IdP 允许您指定要使用的数据存储。您可以添加一个数据库或使用现有的 LDAP 服务器。例如,如果您选择 Active Directory (AD) 服务器,下面的示例描述了如何将 AD 属性映射到 Rancher 中的字段。

    1. 显示名称字段:输入包含用户显示名称的 AD 属性(示例:displayName)。

    2. 用户名字段:输入包含用户名/名的 AD 属性(示例:givenName)。

    3. UID 字段:输入对每个用户唯一的 AD 属性(示例:sAMAccountNamedistinguishedName)。

    4. 组字段:为管理组成员资格创建条目(示例:memberOf)。

    5. 实体 ID 字段(可选):您合作伙伴的已发布、协议相关的唯一标识符。此 ID 定义您的组织为 SAML 2.0 事务的服务器运营实体。此 ID 可能是通过非带外方式或通过 SAML 元数据文件获得的。

    6. Rancher API 主机:输入您的 Rancher 服务器的 URL。

    7. 私钥证书:这是一个密钥-证书对,用于在Rancher和您的IdP之间创建安全外壳。

      您可以使用 openssl 命令生成一个。例如:

       openssl req -x509 -newkey rsa:2048 -keyout myservice.key -out myservice.cert -days 365 -nodes -subj "/CN=myservice.example.com"
    8. IDP元数据:您 从 IdP 服务器导出的 metadata.xml 文件。

  5. 完成 配置 Ping 账户 表单后,单击 启用

    Rancher 会将您重定向到 IdP 登录页面。输入与 Ping IdP 进行身份验证的凭据,以验证您的 Rancher PingIdentity 配置。

    您可能需要禁用弹出窗口拦截器才能查看IdP登录页面。

*结果:*Rancher 已配置为与 PingIdentity 一起使用。您的用户现在可以使用他们的 PingIdentity 登录凭据登录 Rancher。

SAML提供者注意事项
  • 在Rancher中分配权限时,用户和组不会被验证。

  • 添加用户时,必须正确输入确切的用户ID(即`UID Field`)。当您输入用户ID时,不会搜索可能匹配的其他用户ID。

  • 添加组时,您必须从文本框旁边的下拉列表中选择该组。Rancher假设文本框中的任何输入都是用户。

  • 组下拉菜单仅显示您是成员的组。如果您拥有管理员权限或受限的管理员权限,您可以加入一个您尚未成为成员的组。

配置SAML单点注销(SLO)

Rancher supports the ability to configure SAML SLO. Options include logging out of the Rancher application only, logging out of Rancher and registered applications tied to the external authentication provider, or a prompt asking the user to choose between the previous options. The steps below outline configuration from the application GUI:

The Log Out behavior configuration section only appears if the SAML authentication provider allows for SAML SLO.

  1. Sign in to Rancher using a standard user or an administrator role to configure SAML SLO.

  2. In the top left corner, click ☰ > Users & Authentication.

  3. In the left navigation menu, click Auth Provider.

  4. Under the section Log Out behavior, choose the appropriate SLO setting as described below:

    Setting Description

    Log out of Rancher and not authentication provider

    Choosing this option will only logout the Rancher application and not external authentication providers.

    Log out of Rancher and authentication provider (includes all other applications registered with authentication provider)

    Choosing this option will logout Rancher and all external authentication providers along with any registered applications linked to the provider.

    Allow the user to choose one of the above in an additional log out step

    Choosing this option presents users with a choice of logout method as described above.

SAML 和 OpenLDAP 组权限

When you configure a SAML authentication provider backed by OpenLDAP, the SAML response might return only a subset of the groups that a user belongs to. The exact groups returned depend on the configuration of your external authentication provider.

Rancher assigns user permissions based strictly on the groups provided in the SAML response.

Even if you can search for and view specific OpenLDAP groups in the Rancher UI, you cannot use them to assign permissions if they are missing from the SAML response.

To assign permissions successfully, verify that your SAML authentication provider is configured to return all necessary OpenLDAP groups.