Skip to content

Commit

Permalink
require read_cross_cluster (instead of indices:data/read/esql) local …
Browse files Browse the repository at this point in the history
…privs when only reading xCluster
  • Loading branch information
jakelandis committed Apr 5, 2024
1 parent b0d6135 commit b638823
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ public final class IndexPrivilege extends Privilege {
"internal:transport/proxy/indices:data/read/*",
ClusterSearchShardsAction.NAME,
TransportSearchShardsAction.TYPE.name(),
TransportResolveClusterAction.NAME
TransportResolveClusterAction.NAME,
"indices:data/read/esql",
"indices:data/read/esql/compute"
);
private static final Automaton CREATE_AUTOMATON = patterns(
"indices:data/write/index*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,6 @@ public void testCrossClusterQueryAgainstInvalidRemote() throws Exception {
}

@SuppressWarnings("unchecked")
@AwaitsFix(bugUrl = "cross-clusters search should not require local index permissions")
// will work if you add change "indices": [] to : "indices": [ { "names": [""], "privileges": ["indices:data/read/esql"] } ]
// however that should not be required to executed search across clusters
public void testCrossClusterQueryWithOnlyRemotePrivs() throws Exception {
configureRemoteCluster();
populateData();
Expand All @@ -406,7 +403,7 @@ public void testCrossClusterQueryWithOnlyRemotePrivs() throws Exception {

putRoleRequest.setJsonEntity("""
{
"indices": [],
"indices": [{"names": [""], "privileges": ["read_cross_cluster"]}],
"remote_indices": [
{
"names": ["employees"],
Expand Down

0 comments on commit b638823

Please sign in to comment.