加载中

授权委托

在某些情况下,用户通过某个域完成身份验证后,我们可能希望将用户查找和角色分配委派给另一个域。任何支持用户查找(无需用户凭据)的域都可以用作授权域。

例如,由 Kerberos 或 PKI 域进行身份验证的用户可以在 LDAP 域中进行查找。LDAP 域负责在 LDAP 中搜索用户并确定角色。在这种情况下,LDAP 域充当授权域

以下是用作授权域的 LDAP 域的示例配置。此 LDAP 域配置为使用指定筛选器的用户搜索模式。

有关配置 LDAP 域的更多信息,请参见 LDAP 用户身份验证

xpack:
  security:
    authc:
      realms:
        ldap:
          ldap1:
            order: 0
            authentication.enabled: true
            user_search:
              base_dn: "dc=example,dc=org"
              filter: "(cn={0})"
            group_search:
              base_dn: "dc=example,dc=org"
            files:
              role_mapping: "ES_PATH_CONF/role_mapping.yml"
            unmapped_groups_as_roles: false
		
  1. 在这里,我们显式允许将 LDAP 域用于身份验证(即用户可以使用其 LDAP 用户名和密码进行身份验证)。如果我们希望此 LDAP 域仅用于授权,则应将此项设置为 false

以下是一个示例配置,其中 Kerberos 域对用户进行身份验证,然后将授权委派给 LDAP 域。Kerberos 域对用户进行身份验证并提取用户主体名称(通常格式为 user@REALM)。

在此示例中,我们启用了 remove_realm_name 设置,以从用户主体名称中移除 @REALM 部分来获取用户名。配置的授权域(在此情况下为 LDAP 域)使用此用户名执行用户查找。

有关 Kerberos 域的更多信息,请参见 Kerberos 身份验证

xpack:
  security:
    authc:
      realms:
        kerberos:
          kerb1:
            order: 1
            keytab.path: "ES_PATH_CONF/es.keytab"
            remove_realm_name: true
            authorization_realms: ldap1
		

以下是一个示例配置,其中 PKI 域对用户进行身份验证,然后将授权委派给 LDAP 域。

在此示例中,用户名是从客户端证书的 DN 中提取的通用名 (CN)。LDAP 域使用此用户名来查找用户并分配角色。

有关 PKI 域的更多信息,请参见 PKI 用户身份验证

xpack:
  security:
    authc:
      realms:
        pki:
          pki1:
            order: 2
            authorization_realms: ldap1
		
© . This website operates independently and is not affiliated with or endorsed by Elasticsearch B.V. All brand names, logos, and trademarks are the property of their respective owners.