zoukankan      html  css  js  c++  java
  • Xpack集成LDAP

    支持两种配置方式:

    The ldap realm supports two modes of operation, a user search mode and a mode with specific templates for user DNs.
    

    a、User Search Mode
    b、User DN Templates Mode

    这里我用的是第二种,因为不需要明文配置LDAP的admin密码。

    1、修改ES配置文件,添加LDAP配置

     # vim /etc/elasticsearch/elasticsearch.yml
    
     xpack:
      security:
        authc:
          realms:
            ldap1:
              type: ldap
              order: 0
              url: "ldap://192.168.2.164:389"
              user_dn_templates:
                - "uid={0},ou=Users,dc=beijing,dc=op"
              group_search:
                base_dn: "dc=beijing,dc=op"
              files:
                role_mapping: "/etc/elasticsearch/x-pack/role_mapping.yml"
              unmapped_groups_as_roles: false
    

    url 中,ldap协议表示使用普通连接,端口为389。ldaps 表示使用 ssl 安全连接,端口为636.

    为了避免单点故障,这里支持负载均衡和故障转移,实现多个LDAP节点高可用。

    Load Balancing and Failover

    The load_balance.type setting can be used at the realm level to configure how X-Pack security should interact with multiple LDAP servers.
    X-Pack security supports both failover and load balancing modes of operation.

    配置格式:

    2、修改role_mapping文件,给用户指定权限

    # vim /etc/elasticsearch/x-pack/role_mapping.yml
    
    superuser:
      - "uid=shengyongp,ou=Users,dc=beijing,dc=op"
    

    默认 xpack 每五秒会检查一次 role_mapping 文件的变化,也就是修改用户权限之后不用重载ES。

    By default, X-Pack security checks role mapping files for changes every 5 seconds.
    

    其他细节请参考官网文档。

  • 相关阅读:
    P4014 分配问题(网络流24题 最大最小费用流)
    二分图多重匹配
    图论
    小于n的质数的个数(1≤n≤10^11)
    P2341 [HAOI2006]受欢迎的牛| 强连通分量 Tarjan 缩点
    数据库
    树状数组
    C++ 学习笔记
    网络原理
    CG 中点法画直线
  • 原文地址:https://www.cnblogs.com/keithtt/p/7189487.html
Copyright © 2011-2022 走看看