阻止用户编辑系统索引

时间:2019-09-30 17:26:03

标签: kibana elastic-stack elk

以下是我用来使一组特定用户访问以“ custom-”开头的任何索引的代码。但是我希望用户能够对ANY索引(所以是“ *”)做任何他们想做的事,除了系统索引(以“。”开头)之外。有没有办法用下面的代码(也许用正则表达式)做到这一点?我尝试了"names": [ "a-zA-Z0-9" ],",但是没有用。

curl -XPUT  https://elasticsearch1:9200/_xpack/security/role/custom-users -u elastic -k -v -H "Content-Type: application/json" -d '
{
    "indices": [{
        "names": [ "custom-*" ],
        "privileges": ["all"]
    }],
    "metadata": {
        "version" : 1
    }
}
'

1 个答案:

答案 0 :(得分:0)

这有效:

{ "names": ["@&~(^..+)"], "privileges": ["all"] }
相关问题