Browse Source

Add privileges for connectors index creation (#91026)

Carlos Delgado 3 years ago
parent
commit
87eb40a671

+ 5 - 0
docs/changelog/91026.yaml

@@ -0,0 +1,5 @@
+pr: 91026
+summary: Add privileges for connectors index creation
+area: Authorization
+type: enhancement
+issues: []

+ 2 - 1
x-pack/plugin/security/qa/service-account/src/javaRestTest/java/org/elasticsearch/xpack/security/authc/service/ServiceAccountIT.java

@@ -166,7 +166,8 @@ public class ServiceAccountIT extends ESRestTestCase {
                         "logs-app_search.search_relevance_suggestions-default",
                         "logs-crawler-default",
                         "logs-workplace_search.analytics-default",
-                        "logs-workplace_search.content_events-default"
+                        "logs-workplace_search.content_events-default",
+                        ".elastic-connectors*"
                     ],
                     "privileges": [
                         "manage",

+ 2 - 1
x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/service/ElasticServiceAccounts.java

@@ -43,7 +43,8 @@ final class ElasticServiceAccounts {
                         "logs-app_search.search_relevance_suggestions-default",
                         "logs-crawler-default",
                         "logs-workplace_search.analytics-default",
-                        "logs-workplace_search.content_events-default"
+                        "logs-workplace_search.content_events-default",
+                        ".elastic-connectors*"
                     )
                     .privileges("manage", "read", "write")
                     .build() },

+ 2 - 1
x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/service/ElasticServiceAccountsTests.java

@@ -359,7 +359,8 @@ public class ElasticServiceAccountsTests extends ESTestCase {
             "logs-app_search.search_relevance_suggestions-default",
             "logs-crawler-default",
             "logs-workplace_search.analytics-default",
-            "logs-workplace_search.content_events-default"
+            "logs-workplace_search.content_events-default",
+            ".elastic-connectors*"
         ).forEach(index -> {
             final IndexAbstraction enterpriseSearchIndex = mockIndexAbstraction(index);
             assertThat(role.indices().allowedIndicesMatcher(AutoCreateAction.NAME).test(enterpriseSearchIndex), is(true));