Skip to content

Commit 40940eb

Browse files
Merge pull request #194095 from rolyon/rolyon-abac-blobs-list-optimization
[Azure ABAC] Blobs list optimization
2 parents 12dc301 + 845f1e2 commit 40940eb

33 files changed

+1485
-381
lines changed

articles/role-based-access-control/conditions-format.md

Lines changed: 194 additions & 42 deletions
Large diffs are not rendered by default.

articles/role-based-access-control/conditions-overview.md

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.service: role-based-access-control
88
ms.subservice: conditions
99
ms.topic: overview
1010
ms.workload: identity
11-
ms.date: 11/16/2021
11+
ms.date: 05/16/2022
1212
ms.author: rolyon
1313

1414
#Customer intent: As a dev, devops, or it admin, I want to learn how to constrain access within a role assignment by using conditions.
@@ -55,23 +55,19 @@ For more information about how to create these examples, see [Examples of Azure
5555

5656
## Where can conditions be added?
5757

58-
Currently, conditions can be added to built-in or custom role assignments that have [storage blob data actions](conditions-format.md#actions). These include the following built-in roles:
58+
Currently, conditions can be added to built-in or custom role assignments that have [blob storage or queue storage data actions](conditions-format.md#actions). Conditions are added at the same scope as the role assignment. Just like role assignments, you must have `Microsoft.Authorization/roleAssignments/write` permissions to add a condition.
5959

60-
- [Storage Blob Data Contributor](built-in-roles.md#storage-blob-data-contributor)
61-
- [Storage Blob Data Owner](built-in-roles.md#storage-blob-data-owner)
62-
- [Storage Blob Data Reader](built-in-roles.md#storage-blob-data-reader)
60+
Here are some of the [blob storage attributes](../storage/common/storage-auth-abac-attributes.md#azure-blob-storage-attributes) you can use in your conditions.
6361

64-
Conditions are added at the same scope as the role assignment. Just like role assignments, you must have `Microsoft.Authorization/roleAssignments/write` permissions to add a condition.
65-
66-
Here are the storage attributes you can use in your conditions.
67-
68-
- Container name
69-
- Blob path
70-
- Blob index tags keys
62+
- Account name
7163
- Blob index tags
72-
73-
> [!TIP]
74-
> Blobs also support the ability to store arbitrary user-defined key-value metadata. Although metadata is similar to blob index tags, you must use blob index tags with conditions. For more information, see [Manage and find Azure Blob data with blob index tags (preview)](../storage/blobs/storage-manage-find-blobs.md).
64+
- Blob path
65+
- Blob prefix
66+
- Container name
67+
- Encryption scope name
68+
- Is hierarchical namespace enabled
69+
- Snapshot
70+
- Version ID
7571

7672
## What does a condition look like?
7773

@@ -85,7 +81,7 @@ If Chandra tries to read a blob without the Project=Cascade tag, access will not
8581

8682
Here is what the condition looks like in the Azure portal:
8783

88-
![Build expression section with values for blob index tags.](./media/shared/condition-expressions.png)
84+
:::image type="content" source="./media/shared/condition-expressions.png" alt-text="Screenshot of condition editor in Azure portal showing build expression section with values for blob index tags." lightbox="./media/shared/condition-expressions.png":::
8985

9086
Here is what the condition looks like in code:
9187

@@ -107,14 +103,15 @@ For more information about the format of conditions, see [Azure role assignment
107103

108104
## Features of conditions
109105

110-
Here's a list of the some of the primary features of conditions:
106+
Here's a list of the primary features of conditions:
111107

112108
| Feature | Status | Date |
113109
| --- | --- | --- |
114-
| Add conditions to Storage Blob Data role assignments | Preview | May 2021 |
110+
| Use the following [attributes](../storage/common/storage-auth-abac-attributes.md#azure-blob-storage-attributes) in a condition: Account name, Blob prefix, Encryption scope name, Is hierarchical namespace enabled, Snapshot, Version ID | Preview | May 2022 |
111+
| Use [custom security attributes on a principal in a condition](conditions-format.md#principal-attributes) | Preview | November 2021 |
112+
| Add conditions to blob storage data role assignments | Preview | May 2021 |
115113
| Use attributes on a resource in a condition | Preview | May 2021 |
116114
| Use attributes that are part of the action request in a condition | Preview | May 2021 |
117-
| Use custom security attributes on a principal in a condition | Preview | November 2021 |
118115

119116
## Conditions and Privileged Identity Management (PIM)
120117

@@ -132,6 +129,13 @@ To better understand Azure RBAC and Azure ABAC, you can refer back to the follow
132129
| attribute | In this context, a key-value pair such as Project=Blue, where Project is the attribute key and Blue is the attribute value. Attributes and tags are synonymous for access control purposes. |
133130
| expression | A statement in a condition that evaluates to true or false. An expression has the format of <attribute> <operator> <value>. |
134131

132+
## Limits
133+
134+
Here are some of the limits for conditions.
135+
136+
| Resource | Limit | Notes |
137+
| --- | --- | --- |
138+
| Number of expressions per condition using the visual editor | 5 | You can add more than five expressions using the code editor |
135139

136140
## Known issues
137141

articles/role-based-access-control/conditions-role-assignments-portal.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.service: role-based-access-control
88
ms.subservice: conditions
99
ms.topic: conceptual
1010
ms.workload: identity
11-
ms.date: 11/16/2021
11+
ms.date: 05/16/2022
1212
ms.author: rolyon
1313
ms.custom: subject-rbac-steps
1414
---
@@ -119,7 +119,7 @@ Once you have the Add role assignment condition page open, you can review the ba
119119

120120
1. In the **Operator** list, select an operator.
121121

122-
For more information, see [Operators](conditions-format.md#operators).
122+
For more information, see [Azure role assignment condition format and syntax](conditions-format.md).
123123

124124
1. In the **Value** box, enter a value for the right side of the expression.
125125

articles/role-based-access-control/conditions-troubleshoot.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.service: role-based-access-control
88
ms.subservice: conditions
99
ms.topic: troubleshooting
1010
ms.workload: identity
11-
ms.date: 11/16/2021
11+
ms.date: 05/16/2022
1212
ms.author: rolyon
1313

1414
#Customer intent:
@@ -187,12 +187,36 @@ Fix any [condition format or syntax](conditions-format.md) issues. Alternatively
187187

188188
**Cause**
189189

190-
If you copy a condition from a document, it might include special characters and cause errors. Some editors (such as Microsoft Word) add control characters when formatting text that does not appear.
190+
If you use PowerShell and copy a condition from a document, it might include special characters that cause the following error. Some editors (such as Microsoft Word) add control characters when formatting text that does not appear.
191+
192+
`The given role assignment condition is invalid.`
191193

192194
**Solution**
193195

194196
If you copied a condition from a rich text editor and you are certain the condition is correct, delete all spaces and returns and then add back the relevant spaces. Alternatively, use a plain text editor or a code editor, such as Visual Studio Code.
195197

198+
## Symptom - Attribute does not apply error in visual editor for previously saved condition
199+
200+
When you open a previously saved condition in the visual editor, you get the following message:
201+
202+
`Attribute does not apply for the selected actions. Select a different set of actions.`
203+
204+
**Cause**
205+
206+
In May 2022, the Read a blob action was changed from the following format:
207+
208+
`!(ActionMatches{'Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read'})`
209+
210+
To exclude the `Blob.List` suboperation:
211+
212+
`!(ActionMatches{'Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read'} AND NOT SubOperationMatches{'Blob.List'})`
213+
214+
If you created a condition with the Read a blob action prior to May 2022, you might see this error message in the visual editor.
215+
216+
**Solution**
217+
218+
Open the **Select an action** pane and reselect the **Read a blob** action.
219+
196220
## Next steps
197221

198222
- [Azure role assignment condition format and syntax (preview)](conditions-format.md)
1.34 KB
Loading

0 commit comments

Comments
 (0)