Skip to content

Commit 82cbfc6

Browse files
haflidifCopilot
andauthored
docs: fix DDoS protection policy assignment documentation (#4063)
- Fix incorrect management group scope: Enable-DDoS-VNET is assigned at connectivity and landingzones MGs, not platform MG - Use correct parameter names: platformConnectivityConfig and landingZonesConfig instead of platformConfig - Fix parameter name: ddosPlan instead of ddosProtectionPlanId - Add cross-MG RBAC file sync instructions (main-rbac.bicepparam) - Add important warning about Modify effect intercepting ARM deployments - Fix typo: DoNoteEnforce to DoNotEnforce in generic section - Replace misleading Enable-DDoS-VNET example in generic Disabling section Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 1ba93c7 commit 82cbfc6

File tree

1 file changed

+70
-24
lines changed

1 file changed

+70
-24
lines changed

docs/content/bicep/howtos/modifyingPolicyAssignments.md

Lines changed: 70 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,29 +30,28 @@ param parPolicyAssignmentParameterOverrides = {
3030

3131
## Disabling a Policy Assignment
3232

33-
Let's say you want to disable the `Enable-DDoS-VNET` policy assignment. You can either set its enforcement mode to DoNotEnforce or exclude it entirely from deployment.
33+
You can either set a policy assignment's enforcement mode to DoNotEnforce or exclude it entirely from deployment.
3434

35-
To change the Enforcement mode of a policy assignment to DoNoteEnforce, but still assign the policy, add it to the `managementGroupDoNotEnforcePolicyAssignments` array in the corresponding management group's `.bicepparam` file:
35+
To change the Enforcement mode of a policy assignment to DoNotEnforce, but still assign the policy, add it to the `managementGroupDoNotEnforcePolicyAssignments` array in the corresponding management group's `.bicepparam` file:
3636

37-
**landingzones/main.bicepparam:**
38-
**platform/platform-connectivity/main.bicepparam:**
37+
**Example using `landingzones/main.bicepparam`:**
3938

4039
```bicep-params
41-
param platformConfig = {
40+
param landingZonesConfig = {
4241
// ... other config
4342
managementGroupDoNotEnforcePolicyAssignments: [
44-
'Enable-DDoS-VNET' // This policy will be set to DoNotEnforce mode
43+
'Deny-Subnet-Without-Nsg' // This policy will be set to DoNotEnforce mode
4544
]
4645
}
4746
```
4847

4948
Alternatively, you can exclude a policy assignment entirely from the deployment using `managementGroupExcludedPolicyAssignments`:
5049

5150
```bicep-params
52-
param platformConfig = {
51+
param landingZonesConfig = {
5352
// ... other config
5453
managementGroupExcludedPolicyAssignments: [
55-
'Enable-DDoS-VNET' // This policy will not be deployed at all
54+
'Deny-Subnet-Without-Nsg' // This policy will not be deployed at all
5655
]
5756
}
5857
```
@@ -163,42 +162,89 @@ param parPolicyAssignmentParameterOverrides = {
163162

164163
### DDoS Protection {#ddos-protection}
165164

166-
If you don't have a DDoS protection plan, disable the `Enable-DDoS-VNET` policy assignment at the `platform` management group:
165+
The `Enable-DDoS-VNET` policy assignment is deployed at two management groups:
166+
167+
- **Connectivity** management group — via `lib/alz/platform/connectivity/Enable-DDoS-VNET.alz_policy_assignment.json`
168+
- **Landing Zones** management group — via `lib/alz/landingzones/Enable-DDoS-VNET.alz_policy_assignment.json`
169+
170+
#### Keeping the policy enabled
171+
172+
If you plan to keep the policy enabled, make sure you provide the DDoS protection plan resource ID via the `Enable-DDoS-VNET` override in both management group parameter files:
173+
174+
**platform-connectivity/main.bicepparam:**
175+
176+
```bicep-params
177+
param parPolicyAssignmentParameterOverrides = {
178+
'Enable-DDoS-VNET': {
179+
parameters: {
180+
ddosPlan: {
181+
value: '/subscriptions/<subscription-id>/resourceGroups/<rg-name>/providers/Microsoft.Network/ddosProtectionPlans/<plan-name>'
182+
}
183+
}
184+
}
185+
}
186+
```
187+
188+
**landingzones/main.bicepparam:**
189+
190+
```bicep-params
191+
param parPolicyAssignmentParameterOverrides = {
192+
'Enable-DDoS-VNET': {
193+
parameters: {
194+
ddosPlan: {
195+
value: '/subscriptions/<subscription-id>/resourceGroups/<rg-name>/providers/Microsoft.Network/ddosProtectionPlans/<plan-name>'
196+
}
197+
}
198+
}
199+
}
200+
```
201+
202+
#### Disabling the policy
167203

168-
**platform/main.bicepparam:**
204+
{{< hint type=important >}}
205+
The `Enable-DDoS-VNET` policy uses a `Modify` effect with `Default` enforcement mode. This means the policy actively intercepts VNet creation and update requests to inject the DDoS protection plan reference. If the policy is deployed with placeholder parameter values and no DDoS protection plan exists, VNet deployments will fail with `LinkedAuthorizationFailed` errors. Make sure the governance stacks are updated and deployed before running the networking stack.
206+
{{< /hint >}}
207+
208+
If you don't have a DDoS protection plan, exclude the `Enable-DDoS-VNET` policy assignment from both management groups:
209+
210+
**platform-connectivity/main.bicepparam:**
169211

170212
```bicep-params
171-
param platformConfig = {
213+
param platformConnectivityConfig = {
172214
// ... other config
173215
managementGroupExcludedPolicyAssignments: [
174216
'Enable-DDoS-VNET'
175217
]
176218
}
177219
```
178220

179-
Or set it to DoNotEnforce mode:
221+
**landingzones/main.bicepparam:**
180222

181223
```bicep-params
182-
param platformConfig = {
224+
param landingZonesConfig = {
183225
// ... other config
184-
managementGroupDoNotEnforcePolicyAssignments: [
226+
managementGroupExcludedPolicyAssignments: [
185227
'Enable-DDoS-VNET'
186228
]
187229
}
188230
```
189231

190-
If you plan to keep the policy enabled, make sure you provide the DDoS protection plan resource ID via the `Enable-DDoS-VNET` override:
232+
You must also update the cross-management group RBAC parameter files to exclude the policy assignment. These modules reference the policy assignment as an `existing` resource to retrieve its managed identity, and will fail if the assignment does not exist.
233+
234+
**platform/main-rbac.bicepparam:**
235+
236+
```bicep-params
237+
param parManagementGroupExcludedPolicyAssignments = [
238+
'Enable-DDoS-VNET'
239+
]
240+
```
241+
242+
**landingzones/main-rbac.bicepparam:**
191243

192244
```bicep-params
193-
param parPolicyAssignmentParameterOverrides = {
194-
'Enable-DDoS-VNET': {
195-
parameters: {
196-
ddosProtectionPlanId: {
197-
value: '/subscriptions/<subscription-id>/resourceGroups/<rg-name>/providers/Microsoft.Network/ddosProtectionPlans/<plan-name>'
198-
}
199-
}
200-
}
201-
}
245+
param parManagementGroupExcludedPolicyAssignments = [
246+
'Enable-DDoS-VNET'
247+
]
202248
```
203249

204250
### Private DNS Zones

0 commit comments

Comments
 (0)