Hue 配置 LDAP 认证

作者: AlienPaul | 来源:发表于2023-12-24 11:07 被阅读0次

环境信息

  • Hue:4.3
  • OpenLDAP:2.4.44

LDAP认证配置

首先需要查找系统的Root DN。例如:

cat /etc/openldap/slapd.d/cn=config/olcDatabase={2}hdb.ldif

可以找到:

olcRootDN: cn=manager,dc=bigdata,dc=com

从而得知root DN为cn=manager,dc=bigdata,dc=com

接下来修改Hue配置,找到pseudo-distributed.ini或者hue.ini配置文件。修改如下内容:

  [[auth]]
  # backend=desktop.auth.backend.AllowFirstUserDjangoBackend
  backend=desktop.auth.backend.LdapBackend

  # Configuration options for connecting to LDAP and Active Directory
  # -------------------------------------------------------------------
  [[ldap]]

    base_dn="dc=bigdata,dc=com"
    ldap_url=ldap://server_ip:389/
    use_start_tls=True
    bind_dn="cn=manager,dc=bigdata,dc=com"
    bind_password=xxxxxx

    ## bind_password_script=

    create_users_on_login=True
    sync_groups_on_login=False
    ignore_username_case=True
    force_username_lowercase=False
    force_username_uppercase=False
    search_bind_authentication=True
    subgroups=suboordinate
    nested_members_search_depth=10
    follow_referrals=False
    debug=False
    debug_level=255
    trace_level=0
    [[[users]]]
      user_filter="objectclass=inetOrgPerson"
      user_name_attr=uid
    [[[groups]]]

      ## group_filter="objectclass=*"
      ## group_name_attr=cn
      ## group_member_attr=members

配置项解释:

  • backend。认证后端。desktop.auth.backend.AllowFirstUserDjangoBackend使用Hue自己的用户体系。desktop.auth.backend.LdapBackend使用LDAP中储存的用户名和密码。
  • base_dn:从哪一级目录开始检索用户信息。可填写根目录的DN。
  • ldap_url:LDAP服务访问地址。
  • bind_dn:访问LDAP的用户。可配置为Root DN。
  • bind_password:上面用户的密码。
  • user_filter:具有该配置项内容的项目会被是为用户信息。
  • user_name_attr:用户名使用哪个属性表示。LDAP使用uid属性。

注意事项:目前验证发现Hue 4.3使用LdapBackend支持的密码Hash类型有限制。使用不被支持的Hash类型密码会导致用户登录失败。

经验证,Hue 4.3支持的password Hash方法类型:

  • plaintext
  • SHA
  • SSHA
  • MD5
  • SMD5
  • CRYPT
  • CRYPT-MD5
  • CRYPT-SHA-256
  • CRYPT-SHA-512

不支持的password Hash方法类型:

  • SHA-256
  • SHA-384
  • SHA-512
  • SSHA-256
  • SSHA-384
  • SSHA-512
  • PKCS5S2

修改完毕后保存重启Hue。可以使用LDAP中的用户名和密码登录Hue。

LDAP用户的权限和Ranger中配置的用户权限相同。

参考链接

https://docs.cloudera.com/runtime/7.2.0/securing-hue/topics/hue-ldap-configuration-unmanaged-clusters.html

相关文章

网友评论

    本文标题:Hue 配置 LDAP 认证

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