You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add read_failures privilege for authorizing failure store
This commit adds the `read_failures` privilege and the logic supporting
that privilege. The `read_failures` privilege enables read access to
failure store indices owned by data streams named in the `indices` field
of an indices privileges group, without implying `read` access to that
data stream's "normal" backing indices.
This is a bit of a mismatch with the existing privilege model, which
authorizes actions and indices orthogonally. As of this change, in order
to fully authorize an action, *both* action name and requested indices
must be considered.
Non-read actions to failure store indices, such as management calls,
are authorized the same as backing indices; authorization will be
granted to manage failure store indices if the user has permission to
manage the owning data stream. It is only data visibility that is gated
behind the new permission.
Copy file name to clipboardExpand all lines: x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission/IndicesPermission.java
Copy file name to clipboardExpand all lines: x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/IndexPrivilege.java
+11-1Lines changed: 11 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -81,6 +81,11 @@ public final class IndexPrivilege extends Privilege {
81
81
ResolveIndexAction.NAME,
82
82
TransportResolveClusterAction.NAME
83
83
);
84
+
// This is a special case: read_failures acts like `read` *only* for failure store indices in authorized data streams.
85
+
// This internal action is not used, but having it makes automaton subset checks work as expected with this privilege.
Copy file name to clipboardExpand all lines: x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/privilege/IndexPrivilegeTests.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ public void testOrderingOfPrivilegeNames() throws Exception {
Copy file name to clipboardExpand all lines: x-pack/plugin/security/qa/multi-cluster/src/javaRestTest/java/org/elasticsearch/xpack/remotecluster/RemoteClusterSecurityEsqlIT.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -676,7 +676,7 @@ public void testCrossClusterQueryWithOnlyRemotePrivs() throws Exception {
676
676
error.getMessage(),
677
677
containsString(
678
678
"action [indices:data/read/esql] is unauthorized for user [remote_search_user] with effective roles [remote_search], "
679
-
+ "this action is granted by the index privileges [read,read_cross_cluster,all]"
679
+
+ "this action is granted by the index privileges [read,read_failures,read_cross_cluster,all]"
Copy file name to clipboardExpand all lines: x-pack/plugin/security/qa/multi-cluster/src/javaRestTest/java/org/elasticsearch/xpack/remotecluster/RemoteClusterSecurityFcActionAuthorizationIT.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -435,7 +435,7 @@ public void testUpdateCrossClusterApiKey() throws Exception {
435
435
+ "for user [foo] with assigned roles [role] authenticated by API key id ["
436
436
+ apiKeyId
437
437
+ "] of user [test_user] on indices [index], this action is granted by the index privileges "
Copy file name to clipboardExpand all lines: x-pack/plugin/security/qa/security-trial/src/javaRestTest/java/org/elasticsearch/xpack/security/apikey/ApiKeyWorkflowsRestrictionRestIT.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -187,7 +187,7 @@ public void testWorkflowsRestrictionAllowsAccess() throws IOException {
187
187
+ apiKeyId
188
188
+ "] of user ["
189
189
+ WORKFLOW_API_KEY_USER
190
-
+ "] on indices [my-app-b], this action is granted by the index privileges [read,all]"
190
+
+ "] on indices [my-app-b], this action is granted by the index privileges [read,read_failures,all]"
191
191
)
192
192
);
193
193
assertThat(e.getMessage(), not(containsString("access restricted by workflow")));
Copy file name to clipboardExpand all lines: x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/DataStreamSecurityIT.java
0 commit comments