Skip to content

Commit 1b58cce

Browse files
Merge pull request #238112 from HeidiSteen/heidist-rbac2
Edits for readability
2 parents 1d53dfe + ae11d09 commit 1b58cce

File tree

2 files changed

+33
-26
lines changed

2 files changed

+33
-26
lines changed

articles/search/search-security-overview.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Additionally, you can add [network security features](#service-access-and-authen
4747

4848
Outbound requests from a search service to other applications are typically made by indexers for text-based indexing and some aspects of AI enrichment. Outbound requests include both read and write operations.
4949

50-
The following list is a full enumeration of the outbound requests that can be made by a search service. A search makes requests on its own behalf, and on the behalf of an indexer or custom skill:
50+
The following list is a full enumeration of the outbound requests that can be made by a search service. A search service makes requests on its own behalf, and on the behalf of an indexer or custom skill:
5151

5252
+ Indexers [read from external data sources](search-indexer-securing-resources.md).
5353
+ Indexers write to Azure Storage when creating knowledge stores, persisting cached enrichments, and persisting debug sessions.
@@ -110,7 +110,18 @@ Outbound requests made by an indexer are subject to the authentication protocols
110110

111111
## Authorization
112112

113-
Cognitive Search provides different authorization models for content management and service management.
113+
Cognitive Search provides authorization models for service management and content management.
114+
115+
### Authorize service management
116+
117+
Service Management operations are authorized through [Azure role-based access control (Azure RBAC)](../role-based-access-control/overview.md). Azure RBAC is an authorization system built on [Azure Resource Manager](../azure-resource-manager/management/overview.md) for provisioning of Azure resources.
118+
119+
In Azure Cognitive Search, Resource Manager is used to create or delete the service, manage API keys, and scale the service. As such, Azure role assignments will determine who can perform those tasks, regardless of whether they're using the [portal](search-manage.md), [PowerShell](search-manage-powershell.md), or the [Management REST APIs](/rest/api/searchmanagement).
120+
121+
[Three basic roles](search-security-rbac.md) (Owner, Contributor, Reader) are defined for search service administration. The role assignments can be made using any supported methodology (portal, PowerShell, and so forth) and are honored service-wide.
122+
123+
> [!NOTE]
124+
> Using Azure-wide mechanisms, you can lock a subscription or resource to prevent accidental or unauthorized deletion of your search service by users with admin rights. For more information, see [Lock resources to prevent unexpected deletion](../azure-resource-manager/management/lock-resources.md).
114125
115126
### Authorize access to content
116127

@@ -130,7 +141,7 @@ In Azure Cognitive Search, an individual index is generally not a securable obje
130141

131142
However, if you're using Azure roles, you can [set permissions on individual indexes](search-security-rbac.md#grant-access-to-a-single-index) as long as it's done programmatically.
132143

133-
For key-based authentication scenarios, administrator and developer access to indexes is undifferentiated: both need write access to create, delete, and update the objects managed by the service. Anyone with an [admin key](search-security-api-keys.md) to your service can read, modify, or delete any index in the same service. For protection against accidental or malicious deletion of indexes, your in-house source control for code assets is the solution for reversing an unwanted index deletion or modification. Azure Cognitive Search has failover within the cluster to ensure availability, but it doesn't store or execute your proprietary code used to create or load indexes.
144+
Using keys, anyone with an [admin key](search-security-api-keys.md) to your service can read, modify, or delete any index in the same service. For protection against accidental or malicious deletion of indexes, your in-house source control for code assets is the solution for reversing an unwanted index deletion or modification. Azure Cognitive Search has failover within the cluster to ensure availability, but it doesn't store or execute your proprietary code used to create or load indexes.
134145

135146
For multitenancy solutions requiring security boundaries at the index level, such solutions typically include a middle tier, which customers use to handle index isolation. For more information about the multitenant use case, see [Design patterns for multitenant SaaS applications and Azure Cognitive Search](search-modeling-multitenant-saas-applications.md).
136147

@@ -145,17 +156,6 @@ Workarounds for "row-level security" include creating a field in the data source
145156
|[Security trimming based on identity filters](search-security-trimming-for-azure-search.md) | Documents the basic workflow for implementing user identity access control. It covers adding security identifiers to an index, and then explains filtering against that field to trim results of prohibited content. |
146157
|[Security trimming based on Azure Active Directory identities](search-security-trimming-for-azure-search-with-aad.md) | This article expands on the previous article, providing steps for retrieving identities from Azure Active Directory (Azure AD), one of the [free services](https://azure.microsoft.com/free/) in the Azure cloud platform. |
147158

148-
### Authorize service management
149-
150-
Service Management operations are authorized through [Azure role-based access control (Azure RBAC)](../role-based-access-control/overview.md). Azure RBAC is an authorization system built on [Azure Resource Manager](../azure-resource-manager/management/overview.md) for provisioning of Azure resources.
151-
152-
In Azure Cognitive Search, Resource Manager is used to create or delete the service, manage API keys, and scale the service. As such, Azure role assignments will determine who can perform those tasks, regardless of whether they're using the [portal](search-manage.md), [PowerShell](search-manage-powershell.md), or the [Management REST APIs](/rest/api/searchmanagement).
153-
154-
[Three basic roles](search-security-rbac.md) are defined for search service administration. The role assignments can be made using any supported methodology (portal, PowerShell, and so forth) and are honored service-wide. The Owner and Contributor roles can perform various administration functions. You can assign the Reader role to users who only view essential information.
155-
156-
> [!NOTE]
157-
> Using Azure-wide mechanisms, you can lock a subscription or resource to prevent accidental or unauthorized deletion of your search service by users with admin rights. For more information, see [Lock resources to prevent unexpected deletion](../azure-resource-manager/management/lock-resources.md).
158-
159159
## Data residency
160160

161161
When you set up a search service, you choose a location or region that determines where customer data is stored and processed. Azure Cognitive Search won't store customer data outside of your specified region unless you configure a feature that has a dependency on another Azure resource, and that resource is provisioned in a different region.

articles/search/search-security-rbac.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -311,27 +311,34 @@ For more information on how to acquire a token for a specific environment, see [
311311

312312
### [**.NET**](#tab/test-csharp)
313313

314+
1. Use the [Azure.Search.Documents 11.4.0](https://www.nuget.org/packages/Azure.Search.Documents/11.4.0) package.
315+
316+
314317
See [Authorize access to a search app using Azure Active Directory](search-howto-aad.md) for instructions that create an identity for your client app, assign a role, and call [DefaultAzureCredential()](/dotnet/api/azure.identity.defaultazurecredential).
315318

316-
The Azure SDK for .NET supports an authorization header in the [NuGet Gallery | Azure.Search.Documents 11.4.0](https://www.nuget.org/packages/Azure.Search.Documents/11.4.0) package. Configuration is required to register an application with Azure Active Directory, and to obtain and pass authorization tokens:
319+
1. Use [Azure.Identity for .NET](/dotnet/api/overview/azure/identity-readme) for token authentiation. Microsoft recommends [`DefaultAzureCredential()`](/dotnet/api/azure.identity.defaultazurecredential) for most scenarios.
317320

318-
+ When obtaining the OAuth token, the scope is "https://search.azure.com/.default". The SDK requires the audience to be "https://search.azure.com". The ".default" is an Azure AD convention.
321+
+ When obtaining the OAuth token, the scope is "https://search.azure.com/.default". The SDK requires the audience to be "https://search.azure.com". The ".default" is an Azure AD convention.
319322

320-
+ The SDK validates that the user has the "user_impersonation" scope, which must be granted by your app, but the SDK itself just asks for "https://search.azure.com/.default".
323+
+ The SDK validates that the user has the "user_impersonation" scope, which must be granted by your app, but the SDK itself just asks for "https://search.azure.com/.default".
321324

322-
Example of using [client secret credential](/dotnet/api/azure.core.tokencredential):
325+
1. Here's an example of a client connection using `DefaultAzureCredential()`.
323326

324-
```csharp
325-
var tokenCredential = new ClientSecretCredential(aadTenantId, aadClientId, aadSecret);
326-
SearchClient srchclient = new SearchClient(serviceEndpoint, indexName, tokenCredential);
327-
```
327+
```csharp
328+
// Create a SearchIndexClient to send create/delete index commands
329+
SearchIndexClient adminClient = new SearchIndexClient(serviceEndpoint, new DefaultAzureCredential());
330+
331+
// Create a SearchClient to load and query documents
332+
SearchClient srchclient = new SearchClient(serviceEndpoint, indexName, new DefaultAzureCredential());
333+
```
328334

329-
More details about using [Azure AD authentication with the Azure SDK for .NET](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity) are available in the SDK's GitHub repo.
335+
1. Here's another example of using [client secret credential](/dotnet/api/azure.core.tokencredential):
330336

331-
> [!NOTE]
332-
> If you get a 403 error, verify that your search service is enrolled in the preview program and that your service is configured for preview role assignments.
337+
```csharp
338+
var tokenCredential = new ClientSecretCredential(aadTenantId, aadClientId, aadSecret);
339+
SearchClient srchclient = new SearchClient(serviceEndpoint, indexName, tokenCredential);
340+
```
333341

334-
---
335342

336343
## Test as current user
337344

0 commit comments

Comments
 (0)