【问题标题】:ELK - X-Pack Custom realmELK - X-Pack 自定义领域
【发布时间】:2018-07-06 16:21:20
【问题描述】:

我为我的 ELK 集群开发了一个自定义领域。

这个模块在节点 elasticsearch 上运行良好,但是当我将它安装在我的生产集群上时,没有任何效果。

Elasticsearch 启动日志: - 没什么特别的,一切似乎都正常工作,并且加载了 xpack 模块(在标准输出中生成日志)

Elasticsearch 集群诊断(自定义似乎已禁用且不可用):

{
  "security" : {
    "available" : true,
    "enabled" : true,
    "realms" : {
      "file" : {
        "available" : true,
        "enabled" : false
      },
      "ldap" : {
        "available" : true,
        "enabled" : false
      },
      "native" : {
        "name" : [
          "realm2"
        ],
        "available" : true,
        "size" : [
          2
        ],
        "enabled" : true,
        "order" : [
          1
        ]
      },
      "custom" : {
        "available" : false,
        "enabled" : false
      },
...
}

Elasticsearch 配置:

cluster.name: "production-cluster-1"
network.host: 0.0.0.0
bootstrap.memory_lock: true
xpack.security.enabled: true
xpack.security.audit.enabled: true
xpack.monitoring.enabled: true
xpack.graph.enabled: false
xpack.watcher.enabled: false
xpack.ml.enabled: false

discovery.zen.ping.unicast.hosts: "-------------------"
network.publish_host: "----"

discovery.zen.minimum_master_nodes: 3

xpack.security:
  authc:
    realms:
      realm1:
        type: custom
        order: 0
      realm2:
        type: native
        order: 1

本机身份验证工作正常。

如何正确解决此问题? :)

谢谢

【问题讨论】:

    标签: authentication elasticsearch elasticsearch-plugin elasticsearch-x-pack xpack


    【解决方案1】:

    让我们从打开日志开始:

    curl -u<user> -XPUT '<host>:<http-port>/_cluster/settings?pretty' -H 'Content-Type: application/json' -d'
    {
      "transient": {
        "logger.org.elasticsearch.xpack.security.authc": "DEBUG"
      }
    }
    '
    

    这将为您提供调试时的任何身份验证日志。我认为本地领域的正确包应该是logger.org.elasticsearch.xpack.security.authc.esnative,以防你想限制它。

    【讨论】:

    • 感谢您的回答,我忘了说,我在 5.6.3 版本中。我按照您的建议激活了调试日志,但我只得到这种日志:[DEBUG][o.e.x.s.a.e.ReservedRealm] [J61LJrE] 用户 [my_user] 未在域 [reserved] 的缓存中找到,继续进行正常身份验证 [DEBUG][o.e.x.s.a.e.NativeRealm ] [J61LJrE] 领域 [realm2] 经过身份验证的用户 [my_user],具有角色 [[MY-ROLE]]
    • 那只表示找不到用户。要么是因为它不存在(可能是用户名中的拼写错误),要么是因为您无法连接到用户 IMO 的来源。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-19
    • 2012-11-01
    • 1970-01-01
    • 2012-10-02
    • 1970-01-01
    • 2019-06-12
    相关资源
    最近更新 更多