Skip to content

Commit 61174b0

Browse files
committed
checkpoint
1 parent b2e071d commit 61174b0

File tree

3 files changed

+20
-19
lines changed

3 files changed

+20
-19
lines changed

articles/search/TOC.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@
238238
items:
239239
- name: Security filters
240240
href: search-security-trimming-for-azure-search.md
241-
- name: Filter on user identities
241+
- name: Security filters with Azure AD
242242
href: search-security-trimming-for-azure-search-with-aad.md
243243
- name: Development
244244
items:

articles/search/search-security-trimming-for-azure-search-with-aad.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ manager: nitinme
77
author: HeidiSteen
88
ms.author: heidist
99
ms.service: cognitive-search
10-
ms.topic: conceptual
11-
ms.date: 01/30/2023
10+
ms.topic: how-to
11+
ms.date: 03/24/2023
1212
ms.custom: devx-track-csharp
1313
---
1414
# Security filters for trimming Azure Cognitive Search results using Active Directory identities
1515

1616
This article demonstrates how to use Azure Active Directory (AD) security identities together with filters in Azure Cognitive Search to trim search results based on user group membership.
1717

1818
This article covers the following tasks:
19+
1920
> [!div class="checklist"]
2021
> - Create Azure AD groups and users
2122
> - Associate the user with the group you have created
@@ -30,7 +31,7 @@ This article covers the following tasks:
3031

3132
Your index in Azure Cognitive Search must have a [security field](search-security-trimming-for-azure-search.md) to store the list of group identities having read access to the document. This use case assumes a one-to-one correspondence between a securable item (such as an individual's college application) and a security field specifying who has access to that item (admissions personnel).
3233

33-
You must have Azure AD administrator permissions (Owner or administrator), required in this walkthrough for creating users, groups, and associations.
34+
You must have Azure AD administrator permissions (Owner or administrator) to create users, groups, and associations.
3435

3536
Your application must also be registered with Azure AD as a multi-tenant app, as described in the following procedure.
3637

@@ -46,7 +47,7 @@ This step integrates your application with Azure AD for the purpose of accepting
4647

4748
1. Once the app registration is created, copy the Application ID. You'll need to provide this string to your application.
4849

49-
If you're stepping through the [DotNetHowToSecurityTrimming](https://github.com/Azure-Samples/search-dotnet-getting-started/tree/master/DotNetHowToEncryptionUsingCMK), paste this value into the **app.config** file.
50+
If you're stepping through the [DotNetHowToSecurityTrimming](https://github.com/Azure-Samples/search-dotnet-getting-started/tree/master/DotNetHowToSecurityTrimming), paste this value into the **app.config** file.
5051

5152
Repeat for the Tenant ID.
5253

articles/search/search-security-trimming-for-azure-search.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,50 +7,50 @@ manager: nitinme
77
author: HeidiSteen
88
ms.author: heidist
99
ms.service: cognitive-search
10-
ms.topic: conceptual
10+
ms.topic: how-to
1111
ms.date: 03/24/2023
1212
---
1313

1414
# Security filters for trimming results in Azure Cognitive Search
1515

16-
Cognitive Search doesn't provide document-level permissions and can't vary search results based on user permissions. As a workaround, you can create a filter that trims search results based on a string consisting of user identity information.
16+
Cognitive Search doesn't provide document-level permissions and can't vary search results from the within the same index by user permissions. As a workaround, you can create a filter that trims search results based on a string containing a group or user identity.
1717

1818
This article describes a pattern for security filtering that includes following steps:
1919

2020
> [!div class="checklist"]
21-
> * Assemble source documents that contain the required content
22-
> * Create a field in your search index to contain the principal identifiers
21+
> * Assemble source documents with the required content
22+
> * Create a field for the principal identifiers
2323
> * Push the documents to the search index for indexing
24-
> * Query the index with `search.in` filter function
24+
> * Query the index with the `search.in` filter function
2525
26-
## Choosing the security filter pattern
26+
## About the security filter pattern
2727

28-
Although Cognitive Search doesn't integrate with security subsystems at query time, many customers who have document-level security requirements have found that filters can meet their needs.
28+
Although Cognitive Search doesn't integrate with security subsystems for access to content within an index, many customers who have document-level security requirements have found that filters can meet their needs.
2929

30-
In Cognitive Search, a security filter is a regular OData filter that includes or excludes a search result based on a matching value. The security principal is just a string. There's no authentication or authorization. The service uses the string as filter criteria to include or exclude a document from the search results.
30+
In Cognitive Search, a security filter is a regular OData filter that includes or excludes a search result based on a matching value, except that in a security filter, the criteria is a string consisting of a security principal. There's no authentication or authorization through the security principal. The principal is just a string, used in a filter expression, to include or exclude a document from the search results.
3131

3232
There are several ways to achieve security filtering. One way is through a complicated disjunction of equality expressions: for example, `Id eq 'id1' or Id eq 'id2'`, and so forth. This approach is error-prone, difficult to maintain, and in cases where the list contains hundreds or thousands of values, slows down query response time by many seconds.
3333

34-
A better solution is using the `search.in` function for security filters. This solution is described in this article. If you use `search.in(Id, 'id1, id2, ...')` instead of an equality expression, you can expect subsecond response times.
34+
A better solution is using the `search.in` function for security filters, as described in this article. If you use `search.in(Id, 'id1, id2, ...')` instead of an equality expression, you can expect subsecond response times.
3535

3636
## Prerequisites
3737

38-
* You must have a [search index](search-what-is-an-index.md) that you can modify.
38+
* The field containing group or user identity must be a string with the "filterable" attribute. It should be a collection. It shouldn't allow nulls.
3939

40-
* You must also have source documents that include a field containing a group or user identity having access to the document. This information becomes the filter criteria against which documents are selected or rejected from the result set returned to the issuer. In the following JSON documents, the "security_id" fields contain an identity string that can be used in a security filter.
40+
* Other fields in the same document should provide the content that's accessible to that group or user. In the following JSON documents, the "security_id" fields contain identities used in a security filter, and the name, salary, and marital status will be included if the identity of the caller matches the "security_id" of the document.
4141

4242
```json
4343
{
4444
"Employee-1": {
4545
"id": "000-0000-00-0-00000-1",
46-
"name": "Sanchez",
46+
"name": "Abram",
4747
"salary": 75000,
4848
"married": true,
4949
"security_id": "10011"
5050
},
5151
"Employee-2": {
5252
"id": "000-0000-00-0-00000-2",
53-
"name": "Smith",
53+
"name": "Adams",
5454
"salary": 75000,
5555
"married": true,
5656
"security_id": "20022"
@@ -59,7 +59,7 @@ A better solution is using the `search.in` function for security filters. This s
5959
```
6060

6161
>[!NOTE]
62-
> The process of retrieving the principal identifiers and injecting those strings into source documents that can be indexed by Cognitive Search isn't covered in this article. See the documentation of your identity service provider for help with obtaining identifiers.
62+
> The process of retrieving the principal identifiers and injecting those strings into source documents that can be indexed by Cognitive Search isn't covered in this article. Refer to the documentation of your identity service provider for help with obtaining identifiers.
6363

6464
## Create security field
6565

0 commit comments

Comments
 (0)