Skip to content

Commit cd15214

Browse files
authored
[DOCS] Update alias security for data stream aliases (#73436)
In 7.14+, you can create data stream aliases. This updates the related security documentation. It also streamlines the docs to remove redundant examples.
1 parent 14a31b9 commit cd15214

File tree

3 files changed

+31
-87
lines changed

3 files changed

+31
-87
lines changed
Lines changed: 25 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[role="xpack"]
22
[[securing-aliases]]
3-
=== Granting privileges for data streams and index aliases
3+
=== Granting privileges for data streams and aliases
44

55
{es} {security-features} allow you to secure operations executed against
66
<<data-streams,data streams>> and <<alias,aliases>>.
@@ -9,10 +9,9 @@
99
==== Data stream privileges
1010

1111
// tag::data-stream-security[]
12-
13-
Use <<privileges-list-indices,indices privileges>> to control access to
14-
a data stream. Any role or user granted privileges to a data
15-
stream are automatically granted the same privileges to its backing indices.
12+
Use <<privileges-list-indices,index privileges>> to control access to a data
13+
stream. Granting privileges on a data stream grants the same privileges on its
14+
backing indices.
1615
// end::data-stream-security[]
1716

1817
For example, `my-data-stream` consists of two backing indices:
@@ -64,100 +63,45 @@ GET .ds-my-data-stream-2099.03.09-000003/_doc/2
6463
// TEST[s/.ds-my-data-stream-2099.03.09-000003/my-index/]
6564

6665
[[index-alias-privileges]]
67-
==== Index alias privileges
66+
==== Alias privileges
67+
68+
Use <<privileges-list-indices,index privileges>> to control access to an
69+
<<alias,alias>>. Privileges on an index or data stream do not grant privileges
70+
on its aliases. For information about managing aliases, see <<alias>>.
6871

69-
An index alias points to one or more indices,
70-
holds metadata and potentially a filter. The {es} {security-features} treat
71-
aliases and indices
72-
the same. Privileges for indices actions are granted on specific indices or
73-
aliases. In order for an indices action to be authorized, the user that executes
74-
it needs to have permissions for that action on all the specific indices or
75-
aliases that the request relates to.
72+
IMPORTANT: Don't use <<filter-alias,filtered aliases>> in place of
73+
<<document-level-security,document level security>>. {es} doesn't always apply
74+
alias filters.
7675

77-
Let's look at an example. Assuming we have an index called `2015`, an alias that
78-
points to it called `current_year`, and a user with the following role:
76+
For example, the `current_year` alias points only to the `2015` index. A user is
77+
granted the `read` privilege for the `2015` index.
7978

8079
[source,js]
81-
--------------------------------------------------
80+
----
8281
{
8382
"names" : [ "2015" ],
8483
"privileges" : [ "read" ]
8584
}
86-
--------------------------------------------------
85+
----
8786
// NOTCONSOLE
8887

89-
The user attempts to retrieve a document from `current_year`:
88+
When the user attempts to retrieve a document from the `current_year` alias,
89+
{es} rejects the request.
9090

9191
[source,console]
92-
-------------------------------------------------------------------------------
93-
GET /current_year/_doc/1
94-
-------------------------------------------------------------------------------
92+
----
93+
GET current_year/_doc/1
94+
----
9595
// TEST[s/^/PUT 2015\n{"aliases": {"current_year": {}}}\nPUT 2015\/_doc\/1\n{}\n/]
9696

97-
The above request gets rejected, although the user has `read` privilege on the
98-
concrete index that the `current_year` alias points to. The correct permission
99-
would be as follows:
97+
To retrieve documents from `current_year`, the user must have the `read` index
98+
privilege for the alias.
10099

101100
[source,js]
102-
--------------------------------------------------
101+
----
103102
{
104103
"names" : [ "current_year" ],
105104
"privileges" : [ "read" ]
106105
}
107-
--------------------------------------------------
108-
// NOTCONSOLE
109-
110-
[discrete]
111-
==== Managing aliases
112-
113-
Unlike creating indices, which requires the `create_index` privilege, adding,
114-
removing and retrieving aliases requires the `manage` permission. Aliases can be
115-
added to an index directly as part of the index creation:
116-
117-
[source,console]
118-
-------------------------------------------------------------------------------
119-
PUT /2015
120-
{
121-
"aliases": {
122-
"current_year": {}
123-
}
124-
}
125-
-------------------------------------------------------------------------------
126-
127-
or via the dedicated aliases api if the index already exists:
128-
129-
[source,console]
130-
-------------------------------------------------------------------------------
131-
POST /_aliases
132-
{
133-
"actions" : [
134-
{ "add" : { "index" : "2015", "alias" : "current_year" } }
135-
]
136-
}
137-
-------------------------------------------------------------------------------
138-
// TEST[s/^/PUT 2015\n/]
139-
140-
The above requests both require the `manage` privilege on the alias name as well
141-
as the targeted index, as follows:
142-
143-
[source,js]
144-
--------------------------------------------------
145-
{
146-
"names" : [ "20*", "current_year" ],
147-
"privileges" : [ "manage" ]
148-
}
149-
--------------------------------------------------
106+
----
150107
// NOTCONSOLE
151-
152-
The index aliases api also allows also to delete aliases from existing indices.
153-
The privileges required for such a request are the same as above. Both index and
154-
alias need the `manage` permission.
155-
156-
157-
[discrete]
158-
==== Filtered aliases
159-
160-
Aliases can hold a filter, which allows to select a subset of documents that can
161-
be accessed out of all the documents that the physical index contains. These
162-
filters are not always applied and should not be used in place of
163-
<<document-level-security,document level security>>.

x-pack/docs/en/security/authorization/managing-roles.asciidoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ The following describes the structure of an indices permissions entry:
5555
-------
5656
// NOTCONSOLE
5757

58-
<1> A list of data streams, indices, and index aliases to which the permissions
59-
in this entry apply. Wildcard (`*`) expressions are supported.
58+
<1> A list of data streams, indices, and aliases to which the permissions
59+
in this entry apply. Supports wildcards (`*`).
6060
<2> The index level privileges the owners of the role have on the associated
6161
data streams and indices specified in the `names` argument.
6262
<3> Specification for document fields the owners of the role have read access to.
@@ -76,7 +76,7 @@ The following describes the structure of an indices permissions entry:
7676
[TIP]
7777
==============================================================================
7878
The `names` parameter accepts wildcard and regular expressions that may refer to
79-
multiple data streams, indices, and index aliases.
79+
multiple data streams, indices, and aliases.
8080
8181
* Wildcard (default) - simple wildcard matching where `*` is a placeholder
8282
for zero or more characters, `?` is a placeholder for a single character

x-pack/docs/en/security/limitations.asciidoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ officially supported on clusters with {security-features} enabled.
2020
[discrete]
2121
=== Changes in wildcard behavior
2222

23-
{es} clusters with the {security-features} enabled apply the `/_all`
24-
wildcard, and all other wildcards, to the data streams, indices, and index aliases that the current user has
25-
privileges for, not all data streams, indices, and index aliases on the cluster.
23+
{es} clusters with the {security-features} enabled apply `_all` and other
24+
wildcards to data streams, indices, and aliases the current user has privileges
25+
for, not all data streams, indices, and aliases on the cluster.
2626

2727
[discrete]
2828
=== Multi document APIs

0 commit comments

Comments
 (0)