Skip to content

Commit d471e3b

Browse files
committed
RBAC-related updates
1 parent e104b71 commit d471e3b

File tree

3 files changed

+39
-20
lines changed

3 files changed

+39
-20
lines changed

articles/search/search-manage.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.author: heidist
99
tags: azure-portal
1010
ms.service: cognitive-search
1111
ms.topic: conceptual
12-
ms.date: 12/21/2022
12+
ms.date: 01/12/2023
1313
---
1414
# Service administration for Azure Cognitive Search in the Azure portal
1515

@@ -62,8 +62,8 @@ Several aspects of a search service are determined when the service is provision
6262
Service administration includes the following tasks:
6363

6464
* [Adjust capacity](search-capacity-planning.md) by adding or removing replicas and partitions
65-
* [Rotate API keys](search-security-api-keys.md) used for admin and query operations
66-
* [Control access to admin operations](search-security-rbac.md) through role-based security
65+
* [Manage API keys](search-security-api-keys.md) used for admin and query operations
66+
* [Allow or deny access using Azure roles](search-security-rbac.md)
6767
* [Configure IP firewall rules](service-configure-firewall.md) to restrict access by IP address
6868
* [Configure a private endpoint](service-create-private-endpoint.md) using Azure Private Link and a private virtual network
6969
* [Monitor service health and operations](monitor-azure-cognitive-search.md): storage, query volumes, and latency
@@ -92,22 +92,24 @@ Internally, Microsoft collects telemetry data about your service and the platfor
9292
| Telemetry | One and a half years |
9393

9494
> [!NOTE]
95-
> This section is about monitoring data. For questions about customer data and privacy, see the ["Data residency"](search-security-overview.md#data-residency) section of the security overview article.
95+
> See the ["Data residency"](search-security-overview.md#data-residency) section of the security overview article for more information about data location and privacy.
9696
9797
## Administrator permissions
9898

9999
When you open the search service overview page, the Azure role assigned to your account determines what portal content is available to you. The overview page at the beginning of the article shows the portal content available to an Owner or Contributor.
100100

101-
Control plane roles include the following items:
101+
Azure roles used for service administration include:
102102

103103
* Owner
104104
* Contributor (same as Owner, minus the ability to assign roles)
105-
* Reader (access to service information and the Monitoring tab)
105+
* Reader (provides access to service information in Essentials section and in the Monitoring tab)
106106

107-
If you want a combination of control plane and data plane permissions, consider Search Service Contributor. For more information, see [Built-in roles](search-security-rbac.md#built-in-roles-used-in-search).
107+
By default, all search services start with at least one Owner. Owners, service administrators, and co-administrators have permission to create other administrators and other role assignments.
108+
109+
Also by default, search services start with API keys for content-related tasks that an Owner or Contributor might perform in the portal. However, it's possible to turn off [API key authentication](search-security-api-keys.md) and use [Azure role-based access control](search-security-rbac.md#built-in-roles-used-in-search) exclusively. If you turn off API keys, be sure to set up data access role assignments so that all features in the portal remain operational.
108110

109111
> [!TIP]
110-
> By default, any Owner or Co-owner can create or delete services. To prevent accidental deletions, you can [lock resources](../azure-resource-manager/management/lock-resources.md).
112+
> By default, any owner or administrator can create or delete services. To prevent accidental deletions, you can [lock resources](../azure-resource-manager/management/lock-resources.md).
111113
112114
## Next steps
113115

articles/search/search-security-api-keys.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Connect with API keys
2+
title: Connect using API keys
33
titleSuffix: Azure Cognitive Search
44
description: Learn how to use an admin or query API key for inbound access to an Azure Cognitive Search service endpoint.
55

@@ -15,10 +15,10 @@ ms.date: 01/10/2023
1515

1616
Cognitive Search offers key-based authentication that you can use on connections to your search service. An API key is a unique string composed of 52 randomly generated numbers and letters. A request made to a search service endpoint will be accepted if both the request and the API key are valid.
1717

18-
API keys are frequently used when making REST API calls to a search service. You can also use them in search solutions if Azure Active Directory isn't an option.
18+
API keys are used for content-related requests, such as creating or querying an index. Upon service creation, it's the only authentication mechanism for data plane (content) operations, but you can replace or supplement key authentication with [Azure roles](search-security-rbac.md) if you can't use hard-coded keys in your code.
1919

2020
> [!NOTE]
21-
> A quick note about "key" terminology in Cognitive Search. An "API key", which is described in this article, refers to a GUID used for authenticating a request. A "document key" refers to a unique string in your indexed content that's used to uniquely identify documents in a search index. API keys and document keys are unrelated.
21+
> A quick note about how "key" terminology is used in Cognitive Search. An "API key", which is described in this article, refers to a GUID used for authenticating a request. A separate term, "document key", refers to a unique string in your indexed content that's used to uniquely identify documents in a search index.
2222
2323
## Types of API keys
2424

articles/search/search-security-rbac.md

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ author: HeidiSteen
88
ms.author: heidist
99
ms.service: cognitive-search
1010
ms.topic: how-to
11-
ms.date: 05/24/2022
11+
ms.date: 01/12/2023
1212
ms.custom: subject-rbac-steps, references_regions
1313
---
1414

@@ -95,7 +95,7 @@ In this step, configure your search service to recognize an **authorization** he
9595
| Role-based access control | Preview | Requires membership in a role assignment to complete the task, described in the next step. It also requires an authorization header. Choosing this option limits you to clients that support the 2021-04-30-preview REST API. |
9696
| Both | Preview | Requests are valid using either an API key or an authorization token. |
9797

98-
If you can't save your selection, or if you get "API access control failed to update for search service `<name>`. DisableLocalAuth is preview and not enabled for this subscription", your subscription enrollment hasn't been initiated or it hasn't been processed.
98+
All network calls for search service operations and content will respect the option you select: API keys for **API Keys**, an RBAC token for **Role-based access control**, or API keys and RBAC tokens equally for **Both**. This applies to both portal features and clients that access a search service programmatically.
9999

100100
### [**REST API**](#tab/config-svc-rest)
101101

@@ -201,6 +201,8 @@ Recall that you can only scope access to top-level resources, such as indexes, s
201201

202202
## Test role assignments
203203

204+
When testing roles, remember that roles are cumulative and inherited roles that are scoped to the subscription or resource group can't be deleted or denied at the resource (search service) level.
205+
204206
### [**Azure portal**](#tab/test-portal)
205207

206208
1. Open the [Azure portal](https://portal.azure.com).
@@ -209,13 +211,15 @@ Recall that you can only scope access to top-level resources, such as indexes, s
209211

210212
1. On the Overview page, select the **Indexes** tab:
211213

214+
+ Members of the Contributor role can view and create any object, but can't query an index using Search Explorer.
215+
212216
+ Members of Search Index Data Reader can use Search Explorer to query the index. You can use any API version to check for access. You should be able to issue queries and view results, but you shouldn't be able to view the index definition.
213217

214218
+ Members of Search Index Data Contributor can select **New Index** to create a new index. Saving a new index will verify write access on the service.
215219

216220
### [**REST API**](#tab/test-rest)
217221

218-
+ Register your application with Azure Active Directory.
222+
+ Register your REST client with Azure Active Directory.
219223

220224
+ Revise your code to use a [Search REST API](/rest/api/searchservice/) (any supported version) and set the **Authorization** header on requests, replacing the **api-key** header.
221225

@@ -395,13 +399,27 @@ The PowerShell example shows the JSON syntax for creating a custom role that's a
395399

396400
## Disable API key authentication
397401

398-
API keys can't be deleted, but they can be disabled on your service. If you're using the Search Service Contributor, Search Index Data Contributor, and Search Index Data Reader preview roles and Azure AD authentication, you can disable API keys, causing the search service to refuse all data-related requests that pass an API key in the header for content-related requests.
402+
API keys can't be deleted, but they can be disabled on your service if you're using the Search Service Contributor, Search Index Data Contributor, and Search Index Data Reader roles and Azure AD authentication. Disabling API keys causes the search service to refuse all data-related requests that pass an API key in the header.
403+
404+
Owner or Contributor permissions are required to disable features.
405+
406+
To disable [key-based authentication](search-security-api-keys.md), use Azure portal or the Management REST API.
407+
408+
### [**Portal**](#tab/disable-keys-portal)
409+
410+
1. In the Azure portal, navigate to your search service.
399411

400-
To disable [key-based authentication](search-security-api-keys.md), use the Management REST API version 2021-04-01-Preview and send two consecutive requests for [Update Service](/rest/api/searchmanagement/2021-04-01-preview/services/create-or-update).
412+
1. In the left-navigation pane, select **Keys**.
401413

402-
Owner or Contributor permissions are required to disable features. Use Postman or another web testing tool to complete the following steps (see Tip below):
414+
1. Select **Role-based access control**.
403415

404-
1. On the first request, set ["AuthOptions"](/rest/api/searchmanagement/2021-04-01-preview/services/create-or-update#dataplaneauthoptions) to "aadOrApiKey" to enable Azure AD authentication. Notice that the option indicates availability of either approach: Azure AD or the native API keys.
416+
The change is effective immediately. Assuming you have permission to assign roles as a member of Owner, service administrator, or co-administrator, you can use portal features to test role-based access.
417+
418+
### [**REST API**](#tab/disable-keys-rest)
419+
420+
Use Postman or another REST client to send two consecutive requests for [Update Service](/rest/api/searchmanagement/2021-04-01-preview/services/create-or-update). See [Manage a search service using REST APIs](search-manage-rest.md) for instructions on setting up the client.
421+
422+
1. On the first request, set ["AuthOptions"](/rest/api/searchmanagement/2021-04-01-preview/services/create-or-update#dataplaneauthoptions) to "aadOrApiKey" to enable Azure AD authentication. Activating Azure AD authentication is a prerequisite to setting "disableLocalAuth".
405423

406424
```http
407425
PUT https://management.azure.com/subscriptions/{{subscriptionId}}/resourcegroups/{{resource-group}}/providers/Microsoft.Search/searchServices/{{search-service-name}}?api-version=2021-04-01-Preview
@@ -439,8 +457,7 @@ You can't combine steps one and two. In step one, "disableLocalAuth" must be fal
439457
440458
To re-enable key authentication, rerun the last request, setting "disableLocalAuth" to false. The search service will resume acceptance of API keys on the request automatically (assuming they're specified).
441459
442-
> [!TIP]
443-
> Management REST API calls are authenticated through Azure Active Directory. For guidance on setting up a security principal and a request, see this blog post [Azure REST APIs with Postman (2021)](https://blog.jongallant.com/2021/02/azure-rest-apis-postman-2021/). The previous example was tested using the instructions and Postman collection provided in the blog post.
460+
---
444461
445462
## Conditional Access
446463

0 commit comments

Comments
 (0)