Skip to content

Commit f786222

Browse files
committed
Update privileges
1 parent 9fe9243 commit f786222

File tree

5 files changed

+8
-2
lines changed

5 files changed

+8
-2
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ClientHelper.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ private static String maybeRewriteSingleAuthenticationHeaderForVersion(
196196
public static final String APM_ORIGIN = "apm";
197197
public static final String OTEL_ORIGIN = "otel";
198198
public static final String REINDEX_DATA_STREAM_ORIGIN = "reindex_data_stream";
199+
public static final String ESQL_ORIGIN = "esql";
199200

200201
private ClientHelper() {}
201202

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/ClusterPrivilegeResolver.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ public class ClusterPrivilegeResolver {
110110
private static final Set<String> MONITOR_WATCHER_PATTERN = Set.of("cluster:monitor/xpack/watcher/*");
111111
private static final Set<String> MONITOR_ROLLUP_PATTERN = Set.of("cluster:monitor/xpack/rollup/*");
112112
private static final Set<String> MONITOR_ENRICH_PATTERN = Set.of("cluster:monitor/xpack/enrich/*", "cluster:admin/xpack/enrich/get");
113+
private static final Set<String> MONITOR_ESQL_PATTERN = Set.of("cluster:monitor/xpack/esql/*");
113114
// intentionally cluster:monitor/stats* to match cluster:monitor/stats, cluster:monitor/stats[n] and cluster:monitor/stats/remote
114115
private static final Set<String> MONITOR_STATS_PATTERN = Set.of("cluster:monitor/stats*");
115116

@@ -249,6 +250,7 @@ public class ClusterPrivilegeResolver {
249250
public static final NamedClusterPrivilege MONITOR_WATCHER = new ActionClusterPrivilege("monitor_watcher", MONITOR_WATCHER_PATTERN);
250251
public static final NamedClusterPrivilege MONITOR_ROLLUP = new ActionClusterPrivilege("monitor_rollup", MONITOR_ROLLUP_PATTERN);
251252
public static final NamedClusterPrivilege MONITOR_ENRICH = new ActionClusterPrivilege("monitor_enrich", MONITOR_ENRICH_PATTERN);
253+
public static final NamedClusterPrivilege MONITOR_ESQL = new ActionClusterPrivilege("monitor_esql", MONITOR_ESQL_PATTERN);
252254
public static final NamedClusterPrivilege MONITOR_STATS = new ActionClusterPrivilege("monitor_stats", MONITOR_STATS_PATTERN);
253255
public static final NamedClusterPrivilege MANAGE = new ActionClusterPrivilege("manage", ALL_CLUSTER_PATTERN, ALL_SECURITY_PATTERN);
254256
public static final NamedClusterPrivilege MANAGE_INFERENCE = new ActionClusterPrivilege("manage_inference", MANAGE_INFERENCE_PATTERN);
@@ -431,6 +433,7 @@ public class ClusterPrivilegeResolver {
431433
MONITOR_WATCHER,
432434
MONITOR_ROLLUP,
433435
MONITOR_ENRICH,
436+
MONITOR_ESQL,
434437
MONITOR_STATS,
435438
MANAGE,
436439
MANAGE_CONNECTOR,

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlGetQueryAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
public class EsqlGetQueryAction extends ActionType<EsqlGetQueryResponse> {
1414
public static final EsqlGetQueryAction INSTANCE = new EsqlGetQueryAction();
15-
public static final String NAME = "cluster:monitor/xpack/esql/get_queries";
15+
public static final String NAME = "cluster:monitor/xpack/esql/get_query";
1616

1717
private EsqlGetQueryAction() {
1818
super(NAME);

x-pack/plugin/security/qa/operator-privileges-tests/src/javaRestTest/java/org/elasticsearch/xpack/security/operator/Constants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ public class Constants {
386386
"cluster:monitor/xpack/enrich/coordinator_stats",
387387
"cluster:monitor/xpack/enrich/stats",
388388
"cluster:monitor/xpack/eql/stats/dist",
389-
"cluster:monitor/xpack/esql/get_queries",
389+
"cluster:monitor/xpack/esql/get_query",
390390
"cluster:monitor/xpack/esql/list_queries",
391391
"cluster:monitor/xpack/esql/stats/dist",
392392
"cluster:monitor/xpack/inference/post",

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/AuthorizationUtils.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import static org.elasticsearch.xpack.core.ClientHelper.DEPRECATION_ORIGIN;
3333
import static org.elasticsearch.xpack.core.ClientHelper.ENRICH_ORIGIN;
3434
import static org.elasticsearch.xpack.core.ClientHelper.ENT_SEARCH_ORIGIN;
35+
import static org.elasticsearch.xpack.core.ClientHelper.ESQL_ORIGIN;
3536
import static org.elasticsearch.xpack.core.ClientHelper.FLEET_ORIGIN;
3637
import static org.elasticsearch.xpack.core.ClientHelper.IDP_ORIGIN;
3738
import static org.elasticsearch.xpack.core.ClientHelper.INDEX_LIFECYCLE_ORIGIN;
@@ -164,6 +165,7 @@ public static void switchUserBasedOnActionOriginAndExecute(
164165
case ENT_SEARCH_ORIGIN:
165166
case CONNECTORS_ORIGIN:
166167
case INFERENCE_ORIGIN:
168+
case ESQL_ORIGIN:
167169
case TASKS_ORIGIN: // TODO use a more limited user for tasks
168170
securityContext.executeAsInternalUser(InternalUsers.XPACK_USER, version, consumer);
169171
break;

0 commit comments

Comments
 (0)