/
Vaults_CrossSubscriptionRestore_Modify.json
89 lines (89 loc) · 3.13 KB
/
Vaults_CrossSubscriptionRestore_Modify.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{
"properties": {
"displayName": "[Preview]: Disable Cross Subscription Restore for Backup Vaults",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Disable or PermanentlyDisable Cross Subscription Restore for your Backup vault so that restore targets cannot be in different subscription from the vault subscription. Learn more at: https://aka.ms/csrstatechange.",
"metadata": {
"version": "1.1.0-preview",
"category": "Backup",
"preview": true
},
"version": "1.1.0-preview",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Modify",
"Disabled"
],
"defaultValue": "Modify"
},
"crossSubscriptionRestoreState": {
"type": "String",
"metadata": {
"displayName": "Cross Subscription Restore State",
"description": "Settings to disable or permanently disable Cross Subscription Restore. Please note that Cross Subscription Restore once permanently disabled on a vault cannot be re-enabled.",
"deprecated": true
},
"allowedValues": [
"Disable",
"PermanentlyDisable"
],
"defaultValue": "Disable"
},
"crossSubscriptionRestoreStateParameter": {
"type": "String",
"metadata": {
"displayName": "Cross Subscription Restore State",
"description": "Settings to disable or permanently disable Cross Subscription Restore. Please note that Cross Subscription Restore once permanently disabled on a vault cannot be re-enabled."
},
"allowedValues": [
"Disabled",
"PermanentlyDisabled"
],
"defaultValue": "Disabled"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.DataProtection/backupVaults"
},
{
"field": "Microsoft.DataProtection/backupVaults/featureSettings.crossSubscriptionRestoreSettings.state",
"notEquals": "[parameters('crossSubscriptionRestoreStateParameter')]"
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"conflictEffect": "deny",
"roleDefinitionIds": [
"/providers/microsoft.authorization/roleDefinitions/5e467623-bb1f-42f4-a55d-6e525e11384b"
],
"operations": [
{
"condition": "[greaterOrEquals(requestContext().apiVersion, '2022-12-01')]",
"operation": "addOrReplace",
"field": "Microsoft.DataProtection/backupVaults/featureSettings.crossSubscriptionRestoreSettings.state",
"value": "[parameters('crossSubscriptionRestoreStateParameter')]"
}
]
}
}
},
"versions": [
"1.1.0-PREVIEW"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/4d479a11-f2b5-4f0a-bb1e-d2332aa95cda",
"name": "4d479a11-f2b5-4f0a-bb1e-d2332aa95cda"
}