mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 23:27:25 -04:00
[Fleet] Add read privileges to profiling-* for symbolization support (#95596)
This commit is contained in:
parent
626db84fac
commit
e752135f44
5 changed files with 46 additions and 8 deletions
5
docs/changelog/95596.yaml
Normal file
5
docs/changelog/95596.yaml
Normal file
|
@ -0,0 +1,5 @@
|
|||
pr: 95596
|
||||
summary: "[Fleet] Add read privileges to profiling-* for symbolization support"
|
||||
area: Authorization
|
||||
type: bug
|
||||
issues: []
|
|
@ -74,8 +74,7 @@ GET /_security/service/elastic/fleet-server
|
|||
"metrics-*",
|
||||
"traces-*",
|
||||
".logs-endpoint.diagnostic.collection-*",
|
||||
".logs-endpoint.action.responses-*",
|
||||
"profiling-*"
|
||||
".logs-endpoint.action.responses-*"
|
||||
],
|
||||
"privileges": [
|
||||
"write",
|
||||
|
@ -84,6 +83,17 @@ GET /_security/service/elastic/fleet-server
|
|||
],
|
||||
"allow_restricted_indices": false
|
||||
},
|
||||
{
|
||||
"names": [
|
||||
"profiling-*"
|
||||
],
|
||||
"privileges": [
|
||||
"read",
|
||||
"write",
|
||||
"auto_configure"
|
||||
],
|
||||
"allow_restricted_indices": false
|
||||
},
|
||||
{
|
||||
"names" : [
|
||||
"traces-apm.sampled-*"
|
||||
|
|
|
@ -93,8 +93,7 @@ public class ServiceAccountIT extends ESRestTestCase {
|
|||
"metrics-*",
|
||||
"traces-*",
|
||||
".logs-endpoint.diagnostic.collection-*",
|
||||
".logs-endpoint.action.responses-*",
|
||||
"profiling-*"
|
||||
".logs-endpoint.action.responses-*"
|
||||
],
|
||||
"privileges": [
|
||||
"write",
|
||||
|
@ -103,6 +102,17 @@ public class ServiceAccountIT extends ESRestTestCase {
|
|||
],
|
||||
"allow_restricted_indices": false
|
||||
},
|
||||
{
|
||||
"names": [
|
||||
"profiling-*"
|
||||
],
|
||||
"privileges": [
|
||||
"read",
|
||||
"write",
|
||||
"auto_configure"
|
||||
],
|
||||
"allow_restricted_indices": false
|
||||
},
|
||||
{
|
||||
"names": [
|
||||
"traces-apm.sampled-*"
|
||||
|
|
|
@ -69,11 +69,11 @@ final class ElasticServiceAccounts {
|
|||
"metrics-*",
|
||||
"traces-*",
|
||||
".logs-endpoint.diagnostic.collection-*",
|
||||
".logs-endpoint.action.responses-*",
|
||||
"profiling-*"
|
||||
".logs-endpoint.action.responses-*"
|
||||
)
|
||||
.privileges("write", "create_index", "auto_configure")
|
||||
.build(),
|
||||
RoleDescriptor.IndicesPrivileges.builder().indices("profiling-*").privileges("read", "write", "auto_configure").build(),
|
||||
RoleDescriptor.IndicesPrivileges.builder()
|
||||
// APM Server (and hence Fleet Server, which issues its API Keys) needs additional privileges
|
||||
// for the non-sensitive "sampled traces" data stream:
|
||||
|
|
|
@ -192,8 +192,7 @@ public class ElasticServiceAccountsTests extends ESTestCase {
|
|||
"metrics-" + randomAlphaOfLengthBetween(1, 20),
|
||||
"traces-" + randomAlphaOfLengthBetween(1, 20),
|
||||
".logs-endpoint.diagnostic.collection-" + randomAlphaOfLengthBetween(1, 20),
|
||||
".logs-endpoint.action.responses-" + randomAlphaOfLengthBetween(1, 20),
|
||||
"profiling-" + randomAlphaOfLengthBetween(1, 20)
|
||||
".logs-endpoint.action.responses-" + randomAlphaOfLengthBetween(1, 20)
|
||||
).stream().map(this::mockIndexAbstraction).forEach(index -> {
|
||||
assertThat(role.indices().allowedIndicesMatcher(AutoPutMappingAction.NAME).test(index), is(true));
|
||||
assertThat(role.indices().allowedIndicesMatcher(AutoCreateAction.NAME).test(index), is(true));
|
||||
|
@ -209,6 +208,20 @@ public class ElasticServiceAccountsTests extends ESTestCase {
|
|||
assertThat(role.indices().allowedIndicesMatcher(UpdateSettingsAction.NAME).test(index), is(false));
|
||||
});
|
||||
|
||||
final IndexAbstraction profilingIndex = mockIndexAbstraction("profiling-" + randomAlphaOfLengthBetween(1, 20));
|
||||
assertThat(role.indices().allowedIndicesMatcher(AutoPutMappingAction.NAME).test(profilingIndex), is(true));
|
||||
assertThat(role.indices().allowedIndicesMatcher(AutoCreateAction.NAME).test(profilingIndex), is(true));
|
||||
assertThat(role.indices().allowedIndicesMatcher(DeleteAction.NAME).test(profilingIndex), is(true));
|
||||
assertThat(role.indices().allowedIndicesMatcher(CreateIndexAction.NAME).test(profilingIndex), is(false));
|
||||
assertThat(role.indices().allowedIndicesMatcher(IndexAction.NAME).test(profilingIndex), is(true));
|
||||
assertThat(role.indices().allowedIndicesMatcher(BulkAction.NAME).test(profilingIndex), is(true));
|
||||
assertThat(role.indices().allowedIndicesMatcher(DeleteIndexAction.NAME).test(profilingIndex), is(false));
|
||||
assertThat(role.indices().allowedIndicesMatcher(GetAction.NAME).test(profilingIndex), is(true));
|
||||
assertThat(role.indices().allowedIndicesMatcher(MultiGetAction.NAME).test(profilingIndex), is(true));
|
||||
assertThat(role.indices().allowedIndicesMatcher(SearchAction.NAME).test(profilingIndex), is(true));
|
||||
assertThat(role.indices().allowedIndicesMatcher(MultiSearchAction.NAME).test(profilingIndex), is(true));
|
||||
assertThat(role.indices().allowedIndicesMatcher(UpdateSettingsAction.NAME).test(profilingIndex), is(false));
|
||||
|
||||
List.of("synthetics-" + randomAlphaOfLengthBetween(1, 20)).stream().map(this::mockIndexAbstraction).forEach(index -> {
|
||||
assertThat(role.indices().allowedIndicesMatcher(AutoPutMappingAction.NAME).test(index), is(true));
|
||||
assertThat(role.indices().allowedIndicesMatcher(AutoCreateAction.NAME).test(index), is(true));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue