elasticsearch - 如何在Elasticsearch 7.7的内部user_system中添加 super 用户角色?

标签 elasticsearch elasticsearch-plugin

当我的监视器插件在Elasticsearch 7.7中运行时,引发ElasticsearchSecurityException。

Elasticsearch xpack安全性已打开。
配置:
xpack.security.enabled:正确
xpack.security.transport.ssl.enabled:true

That exception thrown in the following code of :


private boolean isIndexExists() {
    IndicesExistsResponse response = nodeClient.admin().indices().prepareExists(MONITOR_INDEX).get();
    return response.isExists();
}



How can I add Superuser role to internal user_system?

org.elasticsearch.ElasticsearchSecurityException: action [indices:admin/exists] is unauthorized for user [_system]
at org.elasticsearch.xpack.core.security.support.Exceptions.authorizationError(Exceptions.java:34) ~[?:?]
at org.elasticsearch.xpack.security.authz.AuthorizationService.denialException(AuthorizationService.java:597) ~[?:?]
at org.elasticsearch.xpack.security.authz.AuthorizationService.authorizeSystemUser(AuthorizationService.java:388) ~[?:?]
at org.elasticsearch.xpack.security.authz.AuthorizationService.authorize(AuthorizationService.java:190) ~[?:?]
at org.elasticsearch.xpack.security.action.filter.SecurityActionFilter.authorizeRequest(SecurityActionFilter.java:172) ~[?:?]
at org.elasticsearch.xpack.security.action.filter.SecurityActionFilter.lambda$applyInternal$3(SecurityActionFilter.java:158) ~[?:?]
at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:63) ~[elasticsearch-7.7.0.jar:7.7.0]
at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.lambda$writeAuthToContext$24(AuthenticationService.java:673) ~[?:?]
at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.writeAuthToContext(AuthenticationService.java:687) ~[?:?]
at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.lambda$handleNullToken$18(AuthenticationService.java:566) ~[?:?]
at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.handleNullToken(AuthenticationService.java:576) ~[?:?]
at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.consumeToken(AuthenticationService.java:439) ~[?:?]
at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.lambda$extractToken$9(AuthenticationService.java:407) ~[?:?]
at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.extractToken(AuthenticationService.java:427) ~[?:?]
at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.lambda$checkForApiKey$3(AuthenticationService.java:368) ~[?:?]
at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:63) ~[elasticsearch-7.7.0.jar:7.7.0]
at org.elasticsearch.xpack.security.authc.ApiKeyService.authenticateWithApiKeyIfPresent(ApiKeyService.java:324) ~[?:?]
at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.checkForApiKey(AuthenticationService.java:348) ~[?:?]
at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.lambda$authenticateAsync$0(AuthenticationService.java:330) ~[?:?]
at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:63) ~[elasticsearch-7.7.0.jar:7.7.0]
at org.elasticsearch.xpack.security.authc.TokenService.getAndValidateToken(TokenService.java:396) ~[?:?]
at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.lambda$authenticateAsync$2(AuthenticationService.java:326) ~[?:?]
at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.lambda$lookForExistingAuthentication$6(AuthenticationService.java:386) ~[?:?]
at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.lookForExistingAuthentication(AuthenticationService.java:397) ~[?:?]
at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.authenticateAsync(AuthenticationService.java:321) ~[?:?]
at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.access$000(AuthenticationService.java:263) ~[?:?]
at org.elasticsearch.xpack.security.authc.AuthenticationService.authenticate(AuthenticationService.java:157) ~[?:?]
at org.elasticsearch.xpack.security.action.filter.SecurityActionFilter.applyInternal(SecurityActionFilter.java:155) ~[?:?]
at org.elasticsearch.xpack.security.action.filter.SecurityActionFilter.apply(SecurityActionFilter.java:107) ~[?:?]

最佳答案

elastic是x-pack中的内置 super 用户,请从doc中引用inbuilt user的官方文档

The Elastic Stack security features provide built-in user credentials to help you get up and running. These users have a fixed set of privileges and cannot be authenticated until their passwords have been set. The elastic user can be used to set all of the built-in user passwords.



关于elastic super 用户

elastic A built-in superuser.

关于elasticsearch - 如何在Elasticsearch 7.7的内部user_system中添加 super 用户角色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62356310/

相关文章:

elasticsearch 动态查询 - 为返回的每个文档添加另一个字段

elasticsearch - 如何在嵌入式ElasticSearch中记录所有查询?

elasticsearch - 在Elasticsearch 6.3.2中是否可以更新文档中字段的映射数据类型?

elasticsearch - Elasticsearch:查询数组元素

elasticsearch - Kibana未显示来自外部Elasticsearch节点的监视数据

elasticsearch - 搜索保护中的单一权限

elasticsearch - 将日期DSL查询中特定小时的所有值求和

elasticsearch - 如何按单个字段对 Elasticsearch 中的文档进行分组?

elasticsearch - Elasticsearch查询过滤器组合问题

elasticsearch - Elasticsearch river-5次尝试后未找到_meta文档