Skip to content

Commit a9efba4

Browse files
direct access to backing data indices should work with FLS
1 parent 50c937b commit a9efba4

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/failurestore/FailureStoreSecurityRestIT.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1523,6 +1523,13 @@ public void testDlsFls() throws Exception {
15231523
{
15241524
"cluster": ["all"],
15251525
"indices": [
1526+
{
1527+
"names": ["%s"],
1528+
"privileges": ["read"],
1529+
"field_security": {
1530+
"grant": ["@timestamp", "age"]
1531+
}
1532+
},
15261533
{
15271534
"names": ["%s"],
15281535
"privileges": ["read"],
@@ -1531,7 +1538,17 @@ public void testDlsFls() throws Exception {
15311538
}
15321539
}
15331540
]
1534-
}""", failureIndexName), role);
1541+
}""", dataIndexName, failureIndexName), role);
1542+
1543+
// FLS applies to backing data index
1544+
assertSearchResponseContainsExpectedIndicesAndFields(
1545+
performRequest(user, new Search(dataIndexName).toSearchRequest()),
1546+
Map.of(dataIndexName, Set.of("@timestamp", "age"))
1547+
);
1548+
assertSearchResponseContainsExpectedIndicesAndFields(
1549+
performRequest(user, new Search(".ds-*").toSearchRequest()),
1550+
Map.of(dataIndexName, Set.of("@timestamp", "age"))
1551+
);
15351552
// FLS is not applicable to backing failure store indices
15361553
expectFlsDlsError(() -> performRequest(user, new Search(failureIndexName).toSearchRequest()));
15371554
expectFlsDlsError(() -> performRequest(user, new Search(".fs-*").toSearchRequest()));

0 commit comments

Comments
 (0)