Skip to content

Commit 4a16df7

Browse files
Create search-query-acls-rbac-enforcement.md
1 parent 7447963 commit 4a16df7

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: Query-Time ACL and RBAC Enforcement in Azure AI Search
3+
titleSuffix: Azure AI Search
4+
description: Learn how query-time ACL and RBAC enforcement ensures secure document retrieval in Azure AI Search.
5+
ms.service: azure-ai-search
6+
ms.topic: conceptual
7+
ms.date: 04/23/2025
8+
author: magottei
9+
ms.author: magottei
10+
---
11+
12+
# Query-Time ACL and RBAC Enforcement in Azure AI Search
13+
14+
Query-time Access Control ensures that users only retrieve search results they are authorized to access, based on their identity, group memberships, roles, or attributes. This functionality is essential for secure enterprise search and compliance-driven workflows.
15+
16+
## Requirements
17+
- ADLS Gen2 data source configured ACLs and/or RBAC roles at container level, or permissions manually pushed into the index.
18+
- Configure document ACL and RBAC role functionality as required using Azure AI Search [built-in indexers](search-indexer-acls-rbac.md) or when indexing the documents [using the API directly](search-indexing-acls-rbac-push-api.md).
19+
20+
21+
## How Query-Time Enforcement Works
22+
### 1. User Permissions Input
23+
The end-user application sends user permission as part of the search query request. The following table lists the source of the user permissions Azure AI Search uses for ACL enforcement:
24+
25+
| Permission Type | Source |
26+
| - | - |
27+
| userIds | `oid` from `x-ms-query-source-authorization` token |
28+
| groupIds | Group membership fetched using the [Microsoft Graph](https://learn.microsoft.com/graph/api/resources/groups-overview?view=graph-rest-1.0&tabs=http) API |
29+
| rbacScope | Permissions the user from `x-ms-query-source-authorization` has on a storage container |
30+
31+
### 2. Security Filter Construction
32+
Azure AI Search dynamically constructs security filters based on the user permissions provided. These security filters are automatically appended to any filters that might come in with the query if the index has the permission filter option enabled.
33+
34+
### 3. Results Filtering
35+
The security filter efficiently matches the userIds, groupIds and rbacScope from the user against each list of ACLs in every document in the search index to limit the results returned to ones the user has access to. It's important to note that each filter is applied indepdendently and a document is considered authorized if any filter succeeds. For example, if a user has access to a document through userIds but not through groupIds, the document is still considered valid and returned to the user.
36+
37+
---
38+
39+
## Limitations
40+
- Provide limitations of the features
41+
- If ACL evaluation fails (for example, Graph API is unavailable), the service returns **5xx** and does **not** return a partially filtered result set.
42+
- Document visibility requires both:
43+
1) the calling application’s RBAC role (Authorization header), and
44+
2) the user identity carried by **x-ms-query-source-authorization**.
45+
46+
## Next steps
47+
* [How to Index Permission Information](tutorial-adls-gen2-indexer-acls.md) provides a detailed walkthrough of how to set up an index with ACLs using Azure Search indexers.
48+
* [Indexing ACLs and RBAC using Push API in Azure AI Search](search-indexing-acls-rbac-push-api.md) provides a walkthrough of how to setup an index with ACLs using the push API.

0 commit comments

Comments
 (0)