Skip to content

Commit 68bfa48

Browse files
authored
[DOCS] Add security privileges to index API docs (#68071) (#68111)
1 parent 8e53199 commit 68bfa48

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+292
-20
lines changed

docs/reference/indices/add-alias.asciidoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ PUT /my-index-000001/_alias/alias1
2626

2727
`POST /<index>/_aliases/<alias>`
2828

29+
[[add-alias-api-prereqs]]
30+
==== {api-prereq-title}
31+
32+
* If the {es} {security-features} are enabled, you must have the `manage`
33+
<<privileges-list-indices,index privilege>> for both the index and index alias.
2934

3035
[[add-alias-api-path-params]]
3136
==== {api-path-parms-title}

docs/reference/indices/alias-exists.asciidoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ HEAD /_alias/alias1
2323

2424
`HEAD /<index>/_alias/<alias>`
2525

26+
[[alias-exists-api-prereqs]]
27+
==== {api-prereq-title}
28+
29+
* If the {es} {security-features} are enabled, you must have the
30+
`view_index_metadata` or `manage` <<privileges-list-indices,index privilege>>
31+
for the index alias. If you specify an index, you must also have
32+
`view_index_metadata` or `manage` index privilege for the index.
2633

2734
[[alias-exists-api-path-params]]
2835
==== {api-path-parms-title}

docs/reference/indices/aliases.asciidoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@ POST /_aliases
2525

2626
`POST /_aliases`
2727

28+
[[indices-aliases-api-prereqs]]
29+
==== {api-prereq-title}
30+
31+
* If the {es} {security-features} are enabled, you must have the following
32+
<<privileges-list-indices,index privileges>>:
33+
34+
** To use the `add` or `remove` action, you must have the `manage` index
35+
privilege for both the index and index alias.
36+
37+
** To use the `remove_index` action, you must have the `manage` index privilege
38+
for the index.
2839

2940
[[indices-aliases-api-desc]]
3041
==== {api-description-title}

docs/reference/indices/analyze.asciidoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ GET /_analyze
2828

2929
`POST /<index>/_analyze`
3030

31+
[[analyze-api-prereqs]]
32+
==== {api-prereq-title}
33+
34+
* If the {es} {security-features} are enabled, you must have the `manage`
35+
<<privileges-list-indices,index privilege>> for the specified index.
3136

3237
[[analyze-api-path-params]]
3338
==== {api-path-parms-title}

docs/reference/indices/apis/freeze.asciidoc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ Freezes an index.
1313

1414
`POST /<index>/_freeze`
1515

16-
//[[freeze-index-api-prereqs]]
17-
//==== {api-prereq-title}
16+
[[freeze-index-api-prereqs]]
17+
==== {api-prereq-title}
18+
19+
* If the {es} {security-features} are enabled, you must have the `manage`
20+
<<privileges-list-indices,index privilege>> for the target index or index alias.
1821

1922
[[freeze-index-api-desc]]
2023
==== {api-description-title}

docs/reference/indices/apis/unfreeze.asciidoc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ Unfreezes an index.
1313

1414
`POST /<index>/_unfreeze`
1515

16-
//[[unfreeze-index-api-prereqs]]
17-
//==== {api-prereq-title}
16+
[[unfreeze-index-api-prereqs]]
17+
==== {api-prereq-title}
18+
19+
* If the {es} {security-features} are enabled, you must have the `manage`
20+
<<privileges-list-indices,index privilege>> for the target index or index alias.
1821

1922
[[unfreeze-index-api-desc]]
2023
==== {api-description-title}

docs/reference/indices/clearcache.asciidoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ POST /my-index-000001/_cache/clear
2121

2222
`POST /_cache/clear`
2323

24+
[[clear-cache-api-prereqs]]
25+
==== {api-prereq-title}
26+
27+
* If the {es} {security-features} are enabled, you must have the `manage`
28+
<<privileges-list-indices,index privilege>> for the target data stream, index,
29+
or index alias.
2430

2531
[[clear-cache-api-path-params]]
2632
==== {api-path-parms-title}

docs/reference/indices/clone-index.asciidoc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ POST /my-index-000001/_clone/cloned-my-index-000001
2020

2121
`PUT /<index>/_clone/<target-index>`
2222

23-
2423
[[clone-index-api-prereqs]]
2524
==== {api-prereq-title}
2625

27-
To clone an index,
28-
the index must be marked as read-only
29-
and have a <<cluster-health,cluster health>> status of `green`.
26+
* If the {es} {security-features} are enabled, you must have the `manage`
27+
<<privileges-list-indices,index privilege>> for the index you want to clone.
28+
29+
* To clone an index, the index must be marked as read-only and have a
30+
<<cluster-health,cluster health>> status of `green`.
3031

3132
For example,
3233
the following request prevents write operations on `my_source_index`

docs/reference/indices/close.asciidoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ POST /my-index-000001/_close
1818

1919
`POST /<index>/_close`
2020

21+
[[close-index-api-prereqs]]
22+
==== {api-prereq-title}
23+
24+
* If the {es} {security-features} are enabled, you must have the `manage`
25+
<<privileges-list-indices,index privilege>> for the target index or index alias.
2126

2227
[[close-index-api-desc]]
2328
==== {api-description-title}

docs/reference/indices/create-index.asciidoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ PUT /my-index-000001
1717

1818
`PUT /<index>`
1919

20+
[[indices-create-api-prereqs]]
21+
==== {api-prereq-title}
22+
23+
* If the {es} {security-features} are enabled, you must have the `create_index`
24+
or `manage` <<privileges-list-indices,index privilege>> for the target index.
25+
2026
[[indices-create-api-desc]]
2127
==== {api-description-title}
2228
You can use the create index API to add a new index to an {es} cluster. When

docs/reference/indices/dangling-index-delete.asciidoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ DELETE /_dangling/<index-uuid>?accept_data_loss=true
1515
--------------------------------------------------
1616
// TEST[skip:Difficult to set up]
1717

18+
[[dangling-index-delete-api-prereqs]]
19+
==== {api-prereq-title}
20+
21+
* If the {es} {security-features} are enabled, you must have the `manage`
22+
<<privileges-list-cluster,cluster privilege>> to use this API.
23+
1824
[[dangling-index-delete-api-desc]]
1925
==== {api-description-title}
2026

docs/reference/indices/dangling-index-import.asciidoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ POST /_dangling/<index-uuid>?accept_data_loss=true
1515
--------------------------------------------------
1616
// TEST[skip:Difficult to set up]
1717

18+
[[dangling-index-import-api-prereqs]]
19+
==== {api-prereq-title}
20+
21+
* If the {es} {security-features} are enabled, you must have the `manage`
22+
<<privileges-list-cluster,cluster privilege>> to use this API.
23+
1824
[[dangling-index-import-api-desc]]
1925
==== {api-description-title}
2026

docs/reference/indices/dangling-indices-list.asciidoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ GET /_dangling
1515
--------------------------------------------------
1616
// TEST[skip:TBD]
1717

18+
[[dangling-indices-list-api-prereqs]]
19+
==== {api-prereq-title}
20+
21+
* If the {es} {security-features} are enabled, you must have the `manage`
22+
<<privileges-list-cluster,cluster privilege>> to use this API.
23+
1824
[[dangling-indices-list-api-desc]]
1925
==== {api-description-title}
2026

docs/reference/indices/delete-alias.asciidoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ DELETE /my-index-000001/_alias/alias1
2222

2323
`DELETE /<index>/_aliases/<alias>`
2424

25+
[[delete-alias-api-prereqs]]
26+
==== {api-prereq-title}
27+
28+
* If the {es} {security-features} are enabled, you must have the `manage`
29+
<<privileges-list-indices,index privilege>> for both the index and index alias.
2530

2631
[[delete-alias-api-path-params]]
2732
==== {api-path-parms-title}

docs/reference/indices/delete-component-template.asciidoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ DELETE _component_template/template_1
3232

3333
`DELETE /_component_template/<component-template>`
3434

35+
[[delete-component-template-api-prereqs]]
36+
==== {api-prereq-title}
37+
38+
* If the {es} {security-features} are enabled, you must have the
39+
`manage_index_templates` or `manage` <<privileges-list-cluster,cluster
40+
privilege>> to use this API.
3541

3642
[[delete-component-template-api-desc]]
3743
==== {api-description-title}

docs/reference/indices/delete-index-template-v1.asciidoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ DELETE /_template/my-legacy-index-template
3636

3737
`DELETE /_template/<legacy-index-template>`
3838

39+
[[delete-template-api-v1-prereqs]]
40+
==== {api-prereq-title}
41+
42+
* If the {es} {security-features} are enabled, you must have the
43+
`manage_index_templates` or `manage` <<privileges-list-cluster,cluster
44+
privilege>> to use this API.
3945

4046
[[delete-template-api-v1-path-params]]
4147
==== {api-path-parms-title}

docs/reference/indices/delete-index-template.asciidoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ DELETE /_index_template/my-index-template
3333

3434
`DELETE /_index_template/<index-template>`
3535

36+
[[delete-template-api-prereqs]]
37+
==== {api-prereq-title}
38+
39+
* If the {es} {security-features} are enabled, you must have the
40+
`manage_index_templates` or `manage` <<privileges-list-cluster,cluster
41+
privilege>> to use this API.
3642

3743
[[delete-template-api-desc]]
3844
==== {api-description-title}

docs/reference/indices/delete-index.asciidoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ DELETE /my-index-000001
1818

1919
`DELETE /<index>`
2020

21+
[[delete-index-api-prereqs]]
22+
==== {api-prereq-title}
23+
24+
* If the {es} {security-features} are enabled, you must have the `delete_index`
25+
or `manage` <<privileges-list-indices,index privilege>> for the target index.
2126

2227
[[delete-index-api-path-params]]
2328
==== {api-path-parms-title}

docs/reference/indices/flush.asciidoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ POST /my-index-000001/_flush
2424

2525
`GET /_flush`
2626

27+
[[flush-api-prereqs]]
28+
==== {api-prereq-title}
29+
30+
* If the {es} {security-features} are enabled, you must have the `maintenance`
31+
or `manage` <<privileges-list-indices,index privilege>> for the target data
32+
stream, index, or index alias.
2733

2834
[[flush-api-desc]]
2935
==== {api-description-title}

docs/reference/indices/forcemerge.asciidoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ POST /my-index-000001/_forcemerge
2222

2323
`POST /_forcemerge`
2424

25+
[[forcemerge-api-prereqs]]
26+
==== {api-prereq-title}
27+
28+
* If the {es} {security-features} are enabled, you must have the `maintenance`
29+
or `manage` <<privileges-list-indices,index privilege>> for the target data
30+
stream, index, or index alias.
2531

2632
[[forcemerge-api-desc]]
2733
==== {api-description-title}

docs/reference/indices/get-alias.asciidoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ GET /my-index-000001/_alias/alias1
2525

2626
`GET /<index>/_alias/<alias>`
2727

28+
[[get-alias-api-api-prereqs]]
29+
==== {api-prereq-title}
30+
31+
* If the {es} {security-features} are enabled, you must have the
32+
`view_index_metadata` or `manage` <<privileges-list-indices,index privilege>>
33+
for the index alias. If you specify an index, you must also have
34+
`view_index_metadata` or `manage` index privilege for the index.
35+
2836

2937
[[get-alias-api-path-params]]
3038
==== {api-path-parms-title}

docs/reference/indices/get-component-template.asciidoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ GET /_component_template/template_1
4646

4747
`GET /_component-template/<component-template>`
4848

49+
[[get-component-template-api-prereqs]]
50+
==== {api-prereq-title}
51+
52+
* If the {es} {security-features} are enabled, you must have the
53+
`manage_index_templates` or `manage` <<privileges-list-cluster,cluster
54+
privilege>> to use this API.
4955

5056
[[get-component-template-api-path-params]]
5157
==== {api-path-parms-title}

docs/reference/indices/get-field-mapping.asciidoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ GET /my-index-000001/_mapping/field/user
2424

2525
`GET /<target>/_mapping/field/<field>`
2626

27+
[[get-field-mapping-api-prereqs]]
28+
==== {api-prereq-title}
29+
30+
* If the {es} {security-features} are enabled, you must have the
31+
`view_index_metadata` or `manage` <<privileges-list-indices,index privilege>>
32+
for the target data stream, index, or index alias.
2733

2834
[[get-field-mapping-api-path-params]]
2935
==== {api-path-parms-title}

docs/reference/indices/get-index-template-v1.asciidoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ GET /_template/template_1
4242

4343
`GET /_template/<index-template>`
4444

45+
[[get-template-v1-api-prereqs]]
46+
==== {api-prereq-title}
47+
48+
* If the {es} {security-features} are enabled, you must have the
49+
`manage_index_templates` or `manage` <<privileges-list-cluster,cluster
50+
privilege>> to use this API.
4551

4652
[[get-template-v1-api-path-params]]
4753
==== {api-path-parms-title}

docs/reference/indices/get-index-template.asciidoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ GET /_index_template/template_1
4141

4242
`GET /_index_template/<index-template>`
4343

44+
[[get-template-api-prereqs]]
45+
==== {api-prereq-title}
46+
47+
* If the {es} {security-features} are enabled, you must have the
48+
`manage_index_templates` or `manage` <<privileges-list-cluster,cluster
49+
privilege>> to use this API.
4450

4551
[[get-template-api-path-params]]
4652
==== {api-path-parms-title}

docs/reference/indices/get-index.asciidoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ through the parameter include_type_name. For more details, please see <<removal-
2323

2424
`GET /<target>`
2525

26+
[[get-index-api-prereqs]]
27+
==== {api-prereq-title}
28+
29+
* If the {es} {security-features} are enabled, you must have the
30+
`view_index_metadata` or `manage` <<privileges-list-indices,index privilege>>
31+
for the target data stream, index, or index alias.
2632

2733
[[get-index-api-path-params]]
2834
==== {api-path-parms-title}

docs/reference/indices/get-mapping.asciidoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ through the parameter `include_type_name`. For more details, please see <<remova
2525

2626
`GET /<target>/_mapping`
2727

28+
[[get-mapping-api-prereqs]]
29+
==== {api-prereq-title}
30+
31+
* If the {es} {security-features} are enabled, you must have the
32+
`view_index_metadata` or `manage` <<privileges-list-indices,index privilege>>
33+
for the target data stream, index, or index alias.
2834

2935
[[get-mapping-api-path-params]]
3036
==== {api-path-parms-title}

docs/reference/indices/get-settings.asciidoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ GET /my-index-000001/_settings
2121

2222
`GET /<target>/_settings/<setting>`
2323

24+
[[get-index-settings-api-prereqs]]
25+
==== {api-prereq-title}
26+
27+
* If the {es} {security-features} are enabled, you must have the
28+
`view_index_metadata`, `monitor`, or `manage` <<privileges-list-indices,index
29+
privilege>> for the target data stream, index, or index alias.
2430

2531
[[get-index-settings-api-path-params]]
2632
==== {api-path-parms-title}

docs/reference/indices/index-template-exists-v1.asciidoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ HEAD /_template/template_1
2424

2525
`HEAD /_template/<index-template>`
2626

27+
[[template-exists-api-prereqs]]
28+
==== {api-prereq-title}
29+
30+
* If the {es} {security-features} are enabled, you must have the
31+
`manage_index_templates` or `manage` <<privileges-list-cluster,cluster
32+
privilege>> to use this API.
2733

2834
[[template-exists-api-desc]]
2935
==== {api-description-title}

0 commit comments

Comments
 (0)