Skip to content

Commit ecb109e

Browse files
Merge pull request #313482 from nehakulkarni123/patch-34
Add identity based exemption structure documentation
2 parents 870ecb9 + 20978d4 commit ecb109e

1 file changed

Lines changed: 35 additions & 1 deletion

File tree

articles/governance/policy/concepts/exemption-structure.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,41 @@ Exemptions support an optional property `resourceSelectors` that works the same
118118
}
119119
```
120120

121-
Regions can be added or removed from the `resourceLocation` list in the example. Resource selectors allow for greater flexibility of where and how exemptions can be created and managed.
121+
The follow resource selectors `kinds` are supported in the policy exemptions object:
122+
- resourceLocation: This property is used to select resources based on their type. Can't be used in the same resource selector as resourceWithoutLocation.
123+
- resourceType: This property is used to select resources based on their type.
124+
- resourceWithoutLocation: This property is used to select resources at the subscription level that don't have a location. Currently only supports subscriptionLevelResources. Can't be used in the same resource selector as resourceLocation.
125+
- in: The list of allowed values for the specified kind. Can't be used with notIn. Can contain up to 50 values.
126+
- notIn: The list of not-allowed values for the specified kind. Can't be used with in. Can contain up to 50 values.
127+
- userPrincipalId: the list of the allowed user object IDs can be exempt in the request. This can be associated with an individual user, an MSI, or a service principal.
128+
- groupPrincipalId: the list of the allowed security group IDs can be exempt in the request. A resource selector can contain multiple selectors. To be applicable to a resource selector, a resource must meet requirements specified by all its selectors. Further, up to 10 resourceSelectors can be specified in a single assignment. In-scope resources are evaluated when they satisfy any one of these resource selectors.
129+
130+
131+
### Identity based exemptions (preview)
132+
133+
You can leverage selector kinds userPrincipalId and groupPrincipalId within the exemption structure to enable a specific service principal, MSI, user, or security group to bypass a policy assignment's enforcement.
134+
135+
Take an example where you want to assign the built-in policy definition `Allowed virtual machine size SKUs` in your subscription to ensure that only A-family VMs can be deployed, with the exception of a high privileged group. You can use identity based conditions to exempt this group in your organization from this enforcement.
136+
137+
This is an example of an identity-based exemption:
138+
139+
```json
140+
"properties": {
141+
"policyAssignmentId": "/subscriptions/<subscriptionID>/providers/Microsoft.Authorization/policyAssignments/CostMgmt",
142+
"resourceSelectors": [{
143+
"name": "AllowedGroups",
144+
"selectors": [{
145+
"kind": "groupPrincipalId",
146+
"in": [ "<HighPrivEngGroupId>" ]
147+
},
148+
]
149+
}
150+
],
151+
"exemptionCategory": "Waiver",
152+
"displayName": "Exempt high SKU VM",
153+
"description": "Exempt high SKU VM for business need"
154+
}
155+
```
122156

123157
## Assignment scope validation (preview)
124158

0 commit comments

Comments
 (0)