-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathBlockVulnerableImages.json
More file actions
221 lines (221 loc) · 7.84 KB
/
Copy pathBlockVulnerableImages.json
File metadata and controls
221 lines (221 loc) · 7.84 KB
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
{
"properties": {
"displayName": "[Deprecated]: Kubernetes clusters should gate deployment of vulnerable images",
"policyType": "BuiltIn",
"mode": "Microsoft.Kubernetes.Data",
"description": "This policy definition is no longer the recommended way to achieve its intent. Learn more about policy definition deprecation at aka.ms/policydefdeprecation.",
"metadata": {
"version": "2.1.0-deprecated",
"category": "Kubernetes",
"deprecated": true
},
"version": "2.1.0",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "'Audit' allows a non-compliant resource to be created or updated, but flags it as non-compliant. 'Deny' blocks the non-compliant resource creation or update. 'Disabled' turns off the policy.",
"portalReview": true
},
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"defaultValue": "Audit"
},
"excludedNamespaces": {
"type": "Array",
"metadata": {
"displayName": "Namespace exclusions",
"description": "List of Kubernetes namespaces to exclude from policy evaluation. System namespaces \"kube-system\", \"gatekeeper-system\" and \"azure-arc\" are always excluded by design. \"azure-extensions-usage-system\" is optional to remove."
},
"defaultValue": [
"kube-system",
"gatekeeper-system",
"azure-arc",
"azure-extensions-usage-system"
]
},
"namespaces": {
"type": "Array",
"metadata": {
"displayName": "Namespace inclusions",
"description": "List of Kubernetes namespaces the policy would apply to. An empty list means the policy is applied to all resources in all namespaces."
},
"defaultValue": []
},
"labelSelector": {
"type": "Object",
"metadata": {
"displayName": "Kubernetes label selector",
"description": "Label query to select Kubernetes resources for policy evaluation. An empty label selector matches all Kubernetes resources."
},
"defaultValue": {},
"schema": {
"description": "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all resources.",
"type": "object",
"properties": {
"matchLabels": {
"description": "matchLabels is a map of {key,value} pairs.",
"type": "object",
"additionalProperties": {
"type": "string"
},
"minProperties": 1
},
"matchExpressions": {
"description": "matchExpressions is a list of values, a key, and an operator.",
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"description": "key is the label key that the selector applies to.",
"type": "string"
},
"operator": {
"description": "operator represents a key's relationship to a set of values.",
"type": "string",
"enum": [
"In",
"NotIn",
"Exists",
"DoesNotExist"
]
},
"values": {
"description": "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty.",
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"key",
"operator"
],
"additionalProperties": false
},
"minItems": 1
}
},
"additionalProperties": false
}
},
"excludedImages": {
"type": "Array",
"metadata": {
"displayName": "Excluded images regex",
"description": "A list of RegEx rules used to exclude container images from policy evaluation. For example: exclude all images from the repo microsoft-defender-in-cluster-defense-repo in the blockreg ACR - [\"(blockreg.azurecr.io/microsoft-defender-in-cluster-defense-repo).*\"]. Use an empty list to apply this policy to all container images.",
"portalReview": true
},
"defaultValue": []
},
"severityThresholdForExcludingNotPatchableFindings": {
"type": "string",
"metadata": {
"displayName": "Severity threshold for excluding vulnerabilities without a patch",
"description": "Specify the maximum severity for exempting vulnerabilities without a patch. For example, specify Medium to ignore Low and Medium vulnerabilities without a patch.",
"portalReview": true
},
"allowedValues": [
"None",
"Low",
"Medium",
"High"
],
"defaultValue": "None"
},
"excludeFindingIDs": {
"type": "Array",
"metadata": {
"displayName": "Exclude findings IDs",
"description": "A list of finding IDs that the policy should exempt.",
"portalReview": true
},
"defaultValue": []
},
"severity": {
"type": "Object",
"metadata": {
"displayName": "Severity threshold",
"description": "The number of allowed findings per severity for an image. e.g. \"{\"High\":0,\"Medium\":3,\"Low\":10}\"",
"portalReview": true
},
"defaultValue": {
"High": 0,
"Medium": 0,
"Low": 0
},
"schema": {
"type": "object",
"properties": {
"High": {
"type": "integer"
},
"Medium": {
"type": "integer"
},
"Low": {
"type": "integer"
}
},
"required": [
"High",
"Medium",
"Low"
],
"additionalProperties": false
}
}
},
"policyRule": {
"if": {
"field": "type",
"in": [
"Microsoft.ContainerService/managedClusters"
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"templateInfo": {
"sourceType": "PublicURL",
"url": "https://store.policy.core.windows.net/kubernetes/container-no-vulnerable-images/v1/template.yaml"
},
"apiGroups": [
"",
"apps"
],
"kinds": [
"Pod",
"Deployment",
"ReplicaSet",
"StatefulSet",
"DaemonSet",
"Job",
"CronJob",
"ReplicationController"
],
"excludedNamespaces": "[parameters('excludedNamespaces')]",
"namespaces": "[parameters('namespaces')]",
"labelSelector": "[parameters('labelSelector')]",
"values": {
"excludedImages": "[parameters('excludedImages')]",
"severityThresholdForExcludingNotPatchableFindings": "[parameters('severityThresholdForExcludingNotPatchableFindings')]",
"excludeFindingIDs": "[parameters('excludeFindingIDs')]",
"severity": "[parameters('severity')]"
}
}
}
},
"versions": [
"2.1.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/13cd7ae3-5bc0-4ac4-a62d-4f7c120b9759",
"name": "13cd7ae3-5bc0-4ac4-a62d-4f7c120b9759"
}