Skip to content

Commit f6703ca

Browse files
docs: Document privileges to read RUM source maps; Update examples (#11741) (#11898)
* Document required privileges to read RUM source map from ES since 8.7. * Update API key creation examples, add agentcfg role to it. (cherry picked from commit 00fb30e) Co-authored-by: Carson Ip <[email protected]>
1 parent 18ee7a9 commit f6703ca

File tree

3 files changed

+65
-12
lines changed

3 files changed

+65
-12
lines changed

docs/access-api-keys.asciidoc

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,24 @@ In the role descriptors box, assign the appropriate privileges to the new API ke
3434
{
3535
"names": ["{beat_default_index_prefix}-*"],
3636
"privileges": ["create_index", "create_doc"]
37-
},
37+
}
38+
]
39+
},
40+
"{beat_default_index_prefix}_sourcemap": {
41+
"index": [
3842
{
39-
"names": ["{beat_default_index_prefix}-*sourcemap"],
43+
"names": [".apm-source-map"],
4044
"privileges": ["read"]
41-
},
42-
]
45+
}
46+
]
47+
},
48+
"{beat_default_index_prefix}_agentcfg": {
49+
"index": [
50+
{
51+
"names": [".apm-agent-configuration"],
52+
"privileges": ["read"]
53+
}
54+
]
4355
}
4456
}
4557
----
@@ -123,11 +135,23 @@ POST /_security/api_key
123135
{
124136
"names": ["{beat_default_index_prefix}-*"],
125137
"privileges": ["create_index", "create_doc"]
126-
},
138+
}
139+
]
140+
},
141+
"{beat_default_index_prefix}_sourcemap": {
142+
"index": [
143+
{
144+
"names": [".apm-source-map"],
145+
"privileges": ["read"]
146+
}
147+
]
148+
},
149+
"{beat_default_index_prefix}_agentcfg": {
150+
"index": [
127151
{
128-
"names": ["{beat_default_index_prefix}-*sourcemap"],
152+
"names": [".apm-agent-configuration"],
129153
"privileges": ["read"]
130-
},
154+
}
131155
]
132156
}
133157
}

docs/configure/rum.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ the options in this section are only supported by the APM Server binary.
134134
== `source_mapping.enabled`
135135
Used to enable/disable <<source-map-how-to,source mapping>> for RUM events.
136136
When enabled, the APM Server needs additional privileges to read source maps.
137-
See <<privileges-to-publish-events>> for more details.
137+
See <<privileges-rum-source-mapping>> for more details.
138138

139139
Default: `true`
140140

docs/feature-roles.asciidoc

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ information, and another for viewing it.
4545
* <<privileges-api-key,API key role>>: To create and manage API keys.
4646
* <<privileges-agent-central-config,Central configuration management role>>: To view
4747
APM Agent central configurations.
48+
* <<privileges-rum-source-mapping,RUM source mapping role>>: To read RUM source maps.
4849

4950
{es-security-features} provides {ref}/built-in-roles.html[built-in roles] that grant a
5051
subset of the privileges needed by APM users.
@@ -91,12 +92,10 @@ that has the following privileges:
9192
|Write events into {es}
9293
|====
9394

94-
. If <<configuration-rum,real user monitoring>> is enabled, additional privileges are required to read source maps.
95-
See {kibana-ref}/rum-sourcemap-api.html[RUM source map API] for more details.
96-
Assign these extra privileges to the *general writer role*.
97-
9895
. Assign the *general writer role* to users who need to publish APM data.
9996

97+
. If <<configuration-rum,real user monitoring>> is enabled, create a separate <<privileges-rum-source-mapping,RUM source mapping role>>.
98+
10099
////
101100
*********************************** ***********************************
102101
*********************************** ***********************************
@@ -354,6 +353,36 @@ which requires the following privileges:
354353
TIP: Looking for privileges and roles needed to use central configuration from the {apm-app} or {apm-app} API?
355354
See {kibana-ref}/apm-app-central-config-user.html[{apm-app} central configuration user].
356355

356+
[[privileges-rum-source-map]]
357+
=== Grant privileges and roles needed for reading source maps
358+
359+
++++
360+
<titleabbrev>Create a _source map_ user</titleabbrev>
361+
++++
362+
363+
[[privileges-rum-source-mapping]]
364+
==== APM Server RUM source mapping
365+
366+
If <<configuration-rum,real user monitoring>> is enabled, additional privileges are required to read source maps.
367+
368+
To grant an APM Server user with the required privileges for reading RUM source maps from {es} directly without {kib},
369+
assign the user the following privileges:
370+
371+
[options="header"]
372+
|====
373+
|Type | Privilege | Purpose
374+
375+
|Index
376+
|`read` on `.apm-source-map` index
377+
|Allow {beatname_uc} to read RUM source maps from {es}
378+
|====
379+
380+
The above privileges should be sufficient for RUM source mapping to work properly
381+
as long as {beatname_uc} communicates with {es} successfully.
382+
If it fails, it may fallback to read source maps via {kib} if configured,
383+
which requires additional {kib} privileges.
384+
See {kibana-ref}/rum-sourcemap-api.html[RUM source map API] for more details.
385+
357386
////
358387
*********************************** ***********************************
359388
*********************************** ***********************************

0 commit comments

Comments
 (0)