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.

配置格式:
1005945-20170717033129581-1141007065.png
1005945-20170717033543160-1296893530.png

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.

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

转载于:https://www.cnblogs.com/keithtt/p/7189487.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值