Skip to content

Commit 4918579

Browse files
authored
Merge branch 'main' into lucene_snapshot_10_1
2 parents 6ba5bc3 + dd02f74 commit 4918579

File tree

28 files changed

+667
-146
lines changed

28 files changed

+667
-146
lines changed

docs/changelog/118599.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 118599
2+
summary: Archive-Index upgrade compatibility
3+
area: Search
4+
type: enhancement
5+
issues: []

docs/changelog/118959.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 118959
2+
summary: Allow kibana_system user to manage .reindexed-v8-internal.alerts indices
3+
area: Authorization
4+
type: enhancement
5+
issues: []

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/KibanaOwnedReservedRoleDescriptors.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,10 @@ static RoleDescriptor kibanaSystem(String name) {
236236
// Observability, etc.
237237
// Kibana system user creates these indices; reads / writes to them via the
238238
// aliases (see below).
239-
RoleDescriptor.IndicesPrivileges.builder().indices(ReservedRolesStore.ALERTS_BACKING_INDEX).privileges("all").build(),
239+
RoleDescriptor.IndicesPrivileges.builder()
240+
.indices(ReservedRolesStore.ALERTS_BACKING_INDEX, ReservedRolesStore.ALERTS_BACKING_INDEX_REINDEXED)
241+
.privileges("all")
242+
.build(),
240243
// "Alerts as data" public index aliases used in Security Solution,
241244
// Observability, etc.
242245
// Kibana system user uses them to read / write alerts.
@@ -248,7 +251,7 @@ static RoleDescriptor kibanaSystem(String name) {
248251
// Kibana system user creates these indices; reads / writes to them via the
249252
// aliases (see below).
250253
RoleDescriptor.IndicesPrivileges.builder()
251-
.indices(ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX_ALIAS)
254+
.indices(ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX, ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX_REINDEXED)
252255
.privileges("all")
253256
.build(),
254257
// Endpoint / Fleet policy responses. Kibana requires read access to send

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public class ReservedRolesStore implements BiConsumer<Set<String>, ActionListene
4646

4747
/** Alerts, Rules, Cases (RAC) index used by multiple solutions */
4848
public static final String ALERTS_BACKING_INDEX = ".internal.alerts*";
49+
public static final String ALERTS_BACKING_INDEX_REINDEXED = ".reindexed-v8-internal.alerts*";
4950

5051
/** Alerts, Rules, Cases (RAC) index used by multiple solutions */
5152
public static final String ALERTS_INDEX_ALIAS = ".alerts*";
@@ -54,7 +55,8 @@ public class ReservedRolesStore implements BiConsumer<Set<String>, ActionListene
5455
public static final String PREVIEW_ALERTS_INDEX_ALIAS = ".preview.alerts*";
5556

5657
/** Alerts, Rules, Cases (RAC) preview index used by multiple solutions */
57-
public static final String PREVIEW_ALERTS_BACKING_INDEX_ALIAS = ".internal.preview.alerts*";
58+
public static final String PREVIEW_ALERTS_BACKING_INDEX = ".internal.preview.alerts*";
59+
public static final String PREVIEW_ALERTS_BACKING_INDEX_REINDEXED = ".reindexed-v8-internal.preview.alerts*";
5860

5961
/** "Security Solutions" only lists index for value lists for detections */
6062
public static final String LISTS_INDEX = ".lists-*";
@@ -885,8 +887,10 @@ private static RoleDescriptor buildEditorRoleDescriptor() {
885887
RoleDescriptor.IndicesPrivileges.builder()
886888
.indices(
887889
ReservedRolesStore.ALERTS_BACKING_INDEX,
890+
ReservedRolesStore.ALERTS_BACKING_INDEX_REINDEXED,
888891
ReservedRolesStore.ALERTS_INDEX_ALIAS,
889-
ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX_ALIAS,
892+
ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX,
893+
ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX_REINDEXED,
890894
ReservedRolesStore.PREVIEW_ALERTS_INDEX_ALIAS
891895
)
892896
.privileges("read", "view_index_metadata", "write", "maintenance")

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,9 +614,11 @@ public void testKibanaSystemRole() {
614614
".apm-source-map",
615615
ReservedRolesStore.ALERTS_LEGACY_INDEX + randomAlphaOfLength(randomIntBetween(0, 13)),
616616
ReservedRolesStore.ALERTS_BACKING_INDEX + randomAlphaOfLength(randomIntBetween(0, 13)),
617+
ReservedRolesStore.ALERTS_BACKING_INDEX_REINDEXED + randomAlphaOfLength(randomIntBetween(0, 13)),
617618
ReservedRolesStore.ALERTS_INDEX_ALIAS + randomAlphaOfLength(randomIntBetween(0, 13)),
618619
ReservedRolesStore.PREVIEW_ALERTS_INDEX_ALIAS + randomAlphaOfLength(randomIntBetween(0, 13)),
619-
ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX_ALIAS + randomAlphaOfLength(randomIntBetween(0, 13)),
620+
ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX + randomAlphaOfLength(randomIntBetween(0, 13)),
621+
ReservedRolesStore.PREVIEW_ALERTS_BACKING_INDEX_REINDEXED + randomAlphaOfLength(randomIntBetween(0, 13)),
620622
ReservedRolesStore.LISTS_INDEX + randomAlphaOfLength(randomIntBetween(0, 13)),
621623
ReservedRolesStore.LISTS_ITEMS_INDEX + randomAlphaOfLength(randomIntBetween(0, 13)),
622624
".slo-observability." + randomAlphaOfLength(randomIntBetween(0, 13))

x-pack/plugin/esql/qa/security/src/javaRestTest/java/org/elasticsearch/xpack/esql/EsqlSecurityIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ record Listen(long timestamp, String songId, double duration) {
548548
public void testLookupJoinIndexAllowed() throws Exception {
549549
assumeTrue(
550550
"Requires LOOKUP JOIN capability",
551-
EsqlSpecTestCase.hasCapabilities(adminClient(), List.of(EsqlCapabilities.Cap.JOIN_LOOKUP_V9.capabilityName()))
551+
EsqlSpecTestCase.hasCapabilities(adminClient(), List.of(EsqlCapabilities.Cap.JOIN_LOOKUP_V10.capabilityName()))
552552
);
553553

554554
Response resp = runESQLCommand(
@@ -587,7 +587,7 @@ public void testLookupJoinIndexAllowed() throws Exception {
587587
public void testLookupJoinIndexForbidden() throws Exception {
588588
assumeTrue(
589589
"Requires LOOKUP JOIN capability",
590-
EsqlSpecTestCase.hasCapabilities(adminClient(), List.of(EsqlCapabilities.Cap.JOIN_LOOKUP_V9.capabilityName()))
590+
EsqlSpecTestCase.hasCapabilities(adminClient(), List.of(EsqlCapabilities.Cap.JOIN_LOOKUP_V10.capabilityName()))
591591
);
592592

593593
var resp = expectThrows(

x-pack/plugin/esql/qa/server/mixed-cluster/src/javaRestTest/java/org/elasticsearch/xpack/esql/qa/mixed/MixedClusterEsqlSpecIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import java.util.List;
2222

2323
import static org.elasticsearch.xpack.esql.CsvTestUtils.isEnabled;
24-
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.JOIN_LOOKUP_V9;
24+
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.JOIN_LOOKUP_V10;
2525
import static org.elasticsearch.xpack.esql.qa.rest.EsqlSpecTestCase.Mode.ASYNC;
2626

2727
public class MixedClusterEsqlSpecIT extends EsqlSpecTestCase {
@@ -96,7 +96,7 @@ protected boolean supportsInferenceTestService() {
9696

9797
@Override
9898
protected boolean supportsIndexModeLookup() throws IOException {
99-
return hasCapabilities(List.of(JOIN_LOOKUP_V9.capabilityName()));
99+
return hasCapabilities(List.of(JOIN_LOOKUP_V10.capabilityName()));
100100
}
101101

102102
@Override

x-pack/plugin/esql/qa/server/multi-clusters/src/javaRestTest/java/org/elasticsearch/xpack/esql/ccq/MultiClusterSpecIT.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
import static org.elasticsearch.xpack.esql.EsqlTestUtils.classpathResources;
4949
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.INLINESTATS;
5050
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.INLINESTATS_V2;
51-
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.JOIN_LOOKUP_V9;
51+
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.JOIN_LOOKUP_V10;
5252
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.JOIN_PLANNING_V1;
5353
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.METADATA_FIELDS_REMOTE_TEST;
5454
import static org.elasticsearch.xpack.esql.qa.rest.EsqlSpecTestCase.Mode.SYNC;
@@ -124,7 +124,7 @@ protected void shouldSkipTest(String testName) throws IOException {
124124
assumeFalse("INLINESTATS not yet supported in CCS", testCase.requiredCapabilities.contains(INLINESTATS.capabilityName()));
125125
assumeFalse("INLINESTATS not yet supported in CCS", testCase.requiredCapabilities.contains(INLINESTATS_V2.capabilityName()));
126126
assumeFalse("INLINESTATS not yet supported in CCS", testCase.requiredCapabilities.contains(JOIN_PLANNING_V1.capabilityName()));
127-
assumeFalse("LOOKUP JOIN not yet supported in CCS", testCase.requiredCapabilities.contains(JOIN_LOOKUP_V9.capabilityName()));
127+
assumeFalse("LOOKUP JOIN not yet supported in CCS", testCase.requiredCapabilities.contains(JOIN_LOOKUP_V10.capabilityName()));
128128
}
129129

130130
private TestFeatureService remoteFeaturesService() throws IOException {
@@ -283,8 +283,8 @@ protected boolean supportsInferenceTestService() {
283283

284284
@Override
285285
protected boolean supportsIndexModeLookup() throws IOException {
286-
// CCS does not yet support JOIN_LOOKUP_V9 and clusters falsely report they have this capability
287-
// return hasCapabilities(List.of(JOIN_LOOKUP_V9.capabilityName()));
286+
// CCS does not yet support JOIN_LOOKUP_V10 and clusters falsely report they have this capability
287+
// return hasCapabilities(List.of(JOIN_LOOKUP_V10.capabilityName()));
288288
return false;
289289
}
290290
}

x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/RequestIndexFilteringTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public void testIndicesDontExist() throws IOException {
221221
assertThat(e.getMessage(), containsString("index_not_found_exception"));
222222
assertThat(e.getMessage(), containsString("no such index [foo]"));
223223

224-
if (EsqlCapabilities.Cap.JOIN_LOOKUP_V9.isEnabled()) {
224+
if (EsqlCapabilities.Cap.JOIN_LOOKUP_V10.isEnabled()) {
225225
e = expectThrows(
226226
ResponseException.class,
227227
() -> runEsql(timestampFilter("gte", "2020-01-01").query("FROM test1 | LOOKUP JOIN foo ON id1"))

0 commit comments

Comments
 (0)