-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
PublicEndpoint_DINE.json
109 lines (109 loc) · 3.72 KB
/
PublicEndpoint_DINE.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
{
"properties": {
"displayName": "Configure API Management services to disable access to API Management public service configuration endpoints",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "To improve the security of API Management services, restrict connectivity to service configuration endpoints, like direct access management API, Git configuration management endpoint, or self-hosted gateways configuration endpoint.",
"metadata": {
"version": "1.1.0",
"category": "API Management"
},
"version": "1.1.0",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"DeployIfNotExists",
"Disabled"
],
"defaultValue": "DeployIfNotExists"
},
"endpointType": {
"type": "String",
"metadata": {
"displayName": "Public Endpoint Type",
"description": "Public Endpoint Type for which to enforce the access check"
},
"allowedValues": [
"Management",
"Git",
"Gateway Configuration"
],
"defaultValue": "Management"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.ApiManagement/service"
},
{
"field": "Microsoft.ApiManagement/service/sku.name",
"notEquals": "Consumption"
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.ApiManagement/service/tenant",
"name": "[if(equals(parameters('endpointType'), 'Management'), 'access', if(equals(parameters('endpointType'), 'Git'), 'gitaccess', 'gatewayaccess'))]",
"evaluationDelay": "AfterProvisioningSuccess",
"roleDefinitionIds": [
"/providers/microsoft.authorization/roleDefinitions/312a565d-c81f-4fd8-895a-4e21e48d571c"
],
"existenceCondition": {
"field": "Microsoft.ApiManagement/service/tenant/enabled",
"equals": false
},
"deployment": {
"properties": {
"mode": "incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"endpointType": {
"type": "string"
},
"apimName": {
"type": "string"
}
},
"resources": [
{
"name": "[concat(parameters('apimName'), '/', parameters('endpointType'))]",
"type": "Microsoft.ApiManagement/service/tenant",
"apiVersion": "2020-06-01-preview",
"properties": {
"enabled": false
}
}
]
},
"parameters": {
"endpointType": {
"value": "[if(equals(parameters('endpointType'), 'Management'), 'access', if(equals(parameters('endpointType'), 'Git'), 'gitaccess', 'gatewayaccess'))]"
},
"apimName": {
"value": "[field('name')]"
}
}
}
}
}
}
},
"versions": [
"1.1.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/7ca8c8ac-3a6e-493d-99ba-c5fa35347ff2",
"name": "7ca8c8ac-3a6e-493d-99ba-c5fa35347ff2"
}