Skip to content

Commit 7b86bff

Browse files
committed
fixes
Signed-off-by: Nils Bandener <[email protected]>
1 parent 2900218 commit 7b86bff

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/main/java/org/opensearch/security/privileges/PrivilegesEvaluatorImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ public PrivilegesEvaluatorResponse evaluate(PrivilegesEvaluationContext context)
414414
if (!replaceResult.continueEvaluation) {
415415
if (replaceResult.accessDenied) {
416416
auditLog.logMissingPrivileges(action0, request, task);
417-
return PrivilegesEvaluatorResponse.insufficient(action0);
417+
return presponse;
418418
} else {
419419
return PrivilegesEvaluatorResponse.ok().with(replaceResult.createIndexRequestBuilder);
420420
}

src/main/java/org/opensearch/security/privileges/SystemIndexAccessEvaluator.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ private PrivilegesEvaluatorResponse evaluateSystemIndicesAccess(
280280
.collect(Collectors.toList());
281281
log.debug("Service account cannot access regular indices: {}", regularIndices);
282282
}
283-
return PrivilegesEvaluatorResponse.insufficient(action).reason("Service account cannot access regular indices");
283+
return PrivilegesEvaluatorResponse.insufficient("").reason("Service account cannot access regular indices");
284284
}
285285
boolean containsProtectedIndex = requestContainsAnyProtectedSystemIndices(requestedResolved);
286286
if (containsProtectedIndex) {
@@ -332,7 +332,7 @@ private PrivilegesEvaluatorResponse evaluateSystemIndicesAccess(
332332
matchingPluginIndices
333333
);
334334
}
335-
return PrivilegesEvaluatorResponse.insufficient(action);
335+
return PrivilegesEvaluatorResponse.insufficient("");
336336
}
337337
}
338338
} else {
@@ -357,7 +357,7 @@ private PrivilegesEvaluatorResponse evaluateSystemIndicesAccess(
357357
} else {
358358
auditLog.logSecurityIndexAttempt(request, action, task);
359359
log.warn("{} for '_all' indices is not allowed for a regular user", action);
360-
return PrivilegesEvaluatorResponse.insufficient(action);
360+
return PrivilegesEvaluatorResponse.insufficient("");
361361
}
362362
}
363363
// if system index is enabled and system index permissions are enabled we don't need to perform any further
@@ -370,7 +370,7 @@ else if (containsSystemIndex && !isSystemIndexPermissionEnabled) {
370370
if (log.isDebugEnabled()) {
371371
log.debug("Filtered '{}' but resulting list is empty", securityIndex);
372372
}
373-
return PrivilegesEvaluatorResponse.insufficient(action);
373+
return PrivilegesEvaluatorResponse.insufficient("");
374374
}
375375
irr.replace(request, false, allWithoutSecurity.toArray(new String[0]));
376376
if (log.isDebugEnabled()) {
@@ -380,7 +380,7 @@ else if (containsSystemIndex && !isSystemIndexPermissionEnabled) {
380380
auditLog.logSecurityIndexAttempt(request, action, task);
381381
final String foundSystemIndexes = String.join(", ", getAllSystemIndices(requestedResolved));
382382
log.warn("{} for '{}' index is not allowed for a regular user", action, foundSystemIndexes);
383-
return PrivilegesEvaluatorResponse.insufficient(action);
383+
return PrivilegesEvaluatorResponse.insufficient("");
384384
}
385385
}
386386
}

0 commit comments

Comments
 (0)