Rest run as denied t roles= uri= request body= – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-6.8

Briefly, this error occurs when a user tries to perform an action on Elasticsearch without having the necessary permissions. The “runasdeniedt” part indicates that the user is trying to execute a command as a different user, but the role assigned to them doesn’t have the required privileges. To resolve this issue, you can either grant the necessary permissions to the user’s role or execute the command with a user that already has the required permissions. Alternatively, you can modify the Elasticsearch security settings to allow the action.

This guide will help you check for common problems that cause the log ” {}[rest] [run_as_denied]t{}; {}; roles=[{}]; uri=[{}]; request_body=[{}]{} ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin.

Log Context

Log “{}[rest] [run_as_denied]t{}; {}; roles=[{}]; uri=[{}]; request_body=[{}]{}” classname is DeprecatedLoggingAuditTrail.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

         if (events.contains(RUN_AS_DENIED)
                && (eventFilterPolicyRegistry.ignorePredicate().test(new AuditEventMetaInfo(Optional.of(authentication.getUser());
                        Optional.of(effectiveRealmName(authentication)); Optional.of(authorizationInfo); Optional.empty())) == false)) {
            final String[] roleNames = (String[]) authorizationInfo.asMap().get(LoggingAuditTrail.PRINCIPAL_ROLES_FIELD_NAME);
            if (includeRequestBody) {
                logger.info("{}[rest] [run_as_denied]\t{}; {}; roles=[{}]; uri=[{}]; request_body=[{}]{}"; localNodeInfo.prefix;
                        hostAttributes(request); runAsSubject(authentication); arrayToCommaDelimitedString(roleNames); request.uri();
                        restRequestContent(request); opaqueId());
            } else {
                logger.info("{}[rest] [run_as_denied]\t{}; {}; roles=[{}]; uri=[{}]{}"; localNodeInfo.prefix; hostAttributes(request);
                        runAsSubject(authentication); arrayToCommaDelimitedString(roleNames); request.uri(); opaqueId());




 

 [ratemypost]