-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaca-allowed-container-registries.json
59 lines (59 loc) · 1.65 KB
/
aca-allowed-container-registries.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
{
"properties": {
"displayName": "Azure Container Apps allowed container registries",
"policyType": "Custom",
"mode": "Indexed",
"description": "This policy enables you to restrict the list of container registries for Azure Container Apps.",
"metadata": {
"version": "1.0.0",
"category": "Azure Container Apps"
},
"parameters": {
"listOfAllowedContainerRegistries": {
"type": "Array",
"metadata": {
"displayName": "Allowed container registries",
"description": "The list of container registries that can be specified when deploying resources."
},
"defaultValue": [
"mcr.microsoft.com"
]
},
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [{
"field": "type",
"equals": "Microsoft.App/containerApps"
},
{
"count": {
"field": "Microsoft.App/containerApps/template.containers[*]",
"where": {
"value": "[split(first(field('Microsoft.App/containerApps/template.containers[*].image')), '/')[0]]",
"notIn": "[parameters('listOfAllowedContainerRegistries')]"
}
},
"greater": 0
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
}
}
}