Skip to content

Commit

Permalink
Only check prefix
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Nov 25, 2024
1 parent eecba3a commit 4769144
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@
import org.opensearch.security.support.ConfigConstants;
import org.opensearch.threadpool.ThreadPool;

import static org.opensearch.security.privileges.PrivilegesEvaluator.isIndexPerm;

public class DlsFlsValveImpl implements DlsFlsRequestValve {

private static final String MAP_EXECUTION_HINT = "map";
Expand Down Expand Up @@ -137,7 +135,7 @@ public DlsFlsValveImpl(
*/
@Override
public boolean invoke(PrivilegesEvaluationContext context, final ActionListener<?> listener) {
if (!isIndexPerm(context.getAction())) {
if (!context.getAction().startsWith("indices:")) {
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -709,10 +709,6 @@ public static boolean isClusterPerm(String action0) {
|| (action0.equals(RenderSearchTemplateAction.NAME)));
}

public static boolean isIndexPerm(String action0) {
return (action0.startsWith("indices:") && !isClusterPerm(action0));
}

@SuppressWarnings("unchecked")
private boolean checkFilteredAliases(Resolved requestedResolved, String action, boolean isDebugEnabled) {
final String faMode = dcm.getFilteredAliasMode();// getConfigSettings().dynamic.filtered_alias_mode;
Expand Down

0 comments on commit 4769144

Please sign in to comment.