-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
FIC_LimitToWellknownIssuers.json
183 lines (183 loc) · 6.69 KB
/
FIC_LimitToWellknownIssuers.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
{
"properties": {
"displayName": "[Preview]: [Preview]: Managed Identity Federated Credentials should be from allowed issuer types",
"mode": "All",
"policyType": "BuiltIn",
"description": "This policy limits whether Managed Identities can use federated credentials, which common issuer types are allowed, and provides a list of allowed issuer exceptions.",
"metadata": {
"version": "1.0.0-preview",
"category": "Managed Identity",
"preview": true
},
"version": "1.0.0-preview",
"parameters": {
"allowFederatedCredentials": {
"type": "Boolean",
"metadata": {
"displayName": "Allow Federated Credentials",
"description": "Set this value to true to allow Federated Credentials to be configured on Azure Managed Identities."
},
"defaultValue": false
},
"allowAKS": {
"type": "Boolean",
"metadata": {
"displayName": "Allow AKS",
"description": "Set this value to true to allow Azure Managed Identities federation with Azure Kubernetes Service Clusters."
},
"defaultValue": false
},
"allowGitHub": {
"type": "Boolean",
"metadata": {
"displayName": "Allow GitHub",
"description": "Set this value to true to allow Azure Managed Identities federation with GitHub Actions."
},
"defaultValue": false
},
"allowAWS": {
"type": "Boolean",
"metadata": {
"displayName": "Allow AWS",
"description": "Set this value to true to allow Azure Managed Identities federation with Amazon Web Services resources."
},
"defaultValue": false
},
"allowGCS": {
"type": "Boolean",
"metadata": {
"displayName": "Allow GCS",
"description": "Set this value to true to allow Azure Managed Identities federation with Google Cloud resources."
},
"defaultValue": false
},
"allowedIssuerExceptions": {
"type": "Array",
"metadata": {
"displayName": "Allowed Exception Issuers",
"description": "The list of specific issuers allowed."
},
"defaultValue": []
},
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy."
},
"allowedValues": [
"Audit",
"Disabled",
"Deny"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials"
},
{
"anyOf": [
{
"value": "[parameters('allowFederatedCredentials')]",
"equals": false
},
{
"allOf": [
{
"value": "[if(greaterOrEquals(length(split(field('Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials/issuer'),'/')),3),split(field('Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials/issuer'),'/')[2],'')]",
"like": "*.oic.prod-aks.azure.com"
},
{
"value": "[parameters('allowAKS')]",
"equals": false
}
]
},
{
"allOf": [
{
"field": "Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials/issuer",
"equals": "https://token.actions.githubusercontent.com"
},
{
"value": "[parameters('allowGitHub')]",
"equals": false
}
]
},
{
"allOf": [
{
"field": "Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials/issuer",
"equals": "https://cognito-identity.amazonaws.com"
},
{
"value": "[parameters('allowAWS')]",
"equals": false
}
]
},
{
"allOf": [
{
"field": "Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials/issuer",
"equals": "https://accounts.google.com"
},
{
"value": "[parameters('allowGCS')]",
"equals": false
}
]
},
{
"allOf": [
{
"not": {
"anyOf": [
{
"value": "[if(greaterOrEquals(length(split(field('Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials/issuer'),'/')),3),split(field('Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials/issuer'),'/')[2],'')]",
"like": "*.oic.prod-aks.azure.com"
},
{
"field": "Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials/issuer",
"equals": "https://token.actions.githubusercontent.com"
},
{
"field": "Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials/issuer",
"equals": "https://cognito-identity.amazonaws.com"
},
{
"field": "Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials/issuer",
"equals": "https://accounts.google.com"
}
]
}
},
{
"not": {
"field": "Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials/issuer",
"in": "[parameters('allowedIssuerExceptions')]"
}
}
]
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0-PREVIEW"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/2571b7c3-3056-4a61-b00a-9bc5232234f5",
"name": "2571b7c3-3056-4a61-b00a-9bc5232234f5"
}