Skip to content

Commit 186492d

Browse files
author
Azure Policy Bot
committed
Built-in Policy Release 5bdabf55
1 parent 62623bc commit 186492d

10 files changed

Lines changed: 319 additions & 44 deletions

File tree

built-in-policies/policyDefinitions/Azure Government/Kubernetes/AllowedHostPaths.json

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"mode": "Microsoft.Kubernetes.Data",
66
"description": "Limit pod HostPath volume mounts to the allowed host paths in a Kubernetes Cluster. This policy is generally available for Kubernetes Service (AKS), and Azure Arc enabled Kubernetes. For more information, see https://aka.ms/kubepolicydoc.",
77
"metadata": {
8-
"version": "7.2.0",
8+
"version": "7.3.0",
99
"category": "Kubernetes"
1010
},
11-
"version": "7.2.0",
11+
"version": "7.3.0",
1212
"parameters": {
1313
"source": {
1414
"type": "String",
@@ -167,6 +167,45 @@
167167
"additionalProperties": false
168168
}
169169
},
170+
"windowsAllowedHostPaths": {
171+
"type": "Object",
172+
"metadata": {
173+
"displayName": "Allowed host paths for windows containers",
174+
"description": "The host paths allowed for windows pod hostPath volumes to use. Provide an empty paths list to block all host paths. Use \"C:\\\" to allow all windows host paths.",
175+
"portalReview": true
176+
},
177+
"defaultValue": {
178+
"paths": []
179+
},
180+
"schema": {
181+
"type": "object",
182+
"properties": {
183+
"paths": {
184+
"type": "array",
185+
"items": {
186+
"type": "object",
187+
"properties": {
188+
"pathPrefix": {
189+
"type": "string"
190+
},
191+
"readOnly": {
192+
"type": "boolean"
193+
}
194+
},
195+
"required": [
196+
"pathPrefix",
197+
"readOnly"
198+
],
199+
"additionalProperties": false
200+
}
201+
}
202+
},
203+
"required": [
204+
"paths"
205+
],
206+
"additionalProperties": false
207+
}
208+
},
170209
"excludedContainers": {
171210
"type": "Array",
172211
"metadata": {
@@ -200,7 +239,7 @@
200239
"warn": "[parameters('warn')]",
201240
"templateInfo": {
202241
"sourceType": "PublicURL",
203-
"url": "https://store.policy.azure.us/kubernetes/allowed-host-paths/v3/template.yaml"
242+
"url": "https://store.policy.azure.us/kubernetes/allowed-host-paths/v4/template.yaml"
204243
},
205244
"apiGroups": [
206245
""
@@ -213,13 +252,15 @@
213252
"labelSelector": "[parameters('labelSelector')]",
214253
"values": {
215254
"allowedHostPaths": "[parameters('allowedHostPaths').paths]",
255+
"windowsAllowedHostPaths": "[parameters('windowsAllowedHostPaths').paths]",
216256
"excludedContainers": "[parameters('excludedContainers')]",
217257
"excludedImages": "[parameters('excludedImages')]"
218258
}
219259
}
220260
}
221261
},
222262
"versions": [
263+
"7.3.0",
223264
"7.2.0",
224265
"7.1.1"
225266
]

built-in-policies/policyDefinitions/Azure Government/Kubernetes/ContainerNoPrivilegeEscalation.json

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,32 @@
55
"mode": "Microsoft.Kubernetes.Data",
66
"description": "Do not allow containers to run with privilege escalation to root in a Kubernetes cluster. This recommendation is part of CIS 5.2.5 which is intended to improve the security of your Kubernetes environments. This policy is generally available for Kubernetes Service (AKS), and preview for Azure Arc enabled Kubernetes. For more information, see https://aka.ms/kubepolicydoc.",
77
"metadata": {
8-
"version": "8.1.0",
8+
"version": "9.0.0",
99
"category": "Kubernetes"
1010
},
11-
"version": "8.1.0",
11+
"version": "9.0.0",
1212
"parameters": {
13+
"source": {
14+
"type": "String",
15+
"metadata": {
16+
"displayName": "Source",
17+
"description": "The source k8s object for constraint evaluation. 'Original' means only evaluate against the specific GroupVersionKind specified in the policy definition. 'Generated' means only evaluate against k8s objects generated by Gatekeeper ExpansionTemplates. 'All' means evaluate against both the original object and any generated ones."
18+
},
19+
"defaultValue": "Original",
20+
"allowedValues": [
21+
"All",
22+
"Generated",
23+
"Original"
24+
]
25+
},
26+
"warn": {
27+
"type": "Boolean",
28+
"metadata": {
29+
"displayName": "Warn",
30+
"description": "Whether or not to return warnings back to the user in the kubectl cli"
31+
},
32+
"defaultValue": false
33+
},
1334
"effect": {
1435
"type": "String",
1536
"metadata": {
@@ -18,11 +39,8 @@
1839
"portalReview": true
1940
},
2041
"allowedValues": [
21-
"audit",
2242
"Audit",
23-
"deny",
2443
"Deny",
25-
"disabled",
2644
"Disabled"
2745
],
2846
"defaultValue": "Audit"
@@ -107,6 +125,14 @@
107125
"additionalProperties": false
108126
}
109127
},
128+
"forcePrivilegeEscalationToBeFalse": {
129+
"type": "Boolean",
130+
"metadata": {
131+
"displayName": "Force all container securityContext.allowPrivilegeEscalation fields to be explicity set to false",
132+
"description": "If set to true, then `allowPrivilegeEscalation` must explicitly be set to false regardless of the `runAsUser` field in the container securityContext. Setting this value to true will make this policy follow the behavior of the Kubernetes Pod Security Standards for Privilege Escalation at the restricted level: https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted"
133+
},
134+
"defaultValue": false
135+
},
110136
"excludedContainers": {
111137
"type": "Array",
112138
"metadata": {
@@ -136,9 +162,11 @@
136162
"then": {
137163
"effect": "[parameters('effect')]",
138164
"details": {
165+
"source": "[parameters('source')]",
166+
"warn": "[parameters('warn')]",
139167
"templateInfo": {
140168
"sourceType": "PublicURL",
141-
"url": "https://store.policy.azure.us/kubernetes/container-no-privilege-escalation/v3/template.yaml"
169+
"url": "https://store.policy.azure.us/kubernetes/container-no-privilege-escalation/v4/template.yaml"
142170
},
143171
"apiGroups": [
144172
""
@@ -151,12 +179,14 @@
151179
"labelSelector": "[parameters('labelSelector')]",
152180
"values": {
153181
"excludedContainers": "[parameters('excludedContainers')]",
154-
"excludedImages": "[parameters('excludedImages')]"
182+
"excludedImages": "[parameters('excludedImages')]",
183+
"forcePrivilegeEscalationToBeFalse": "[parameters('forcePrivilegeEscalationToBeFalse')]"
155184
}
156185
}
157186
}
158187
},
159188
"versions": [
189+
"9.0.0",
160190
"8.1.0"
161191
]
162192
},

built-in-policies/policyDefinitions/Azure Government/Kubernetes/EnforceAppArmorProfile.json

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,32 @@
55
"mode": "Microsoft.Kubernetes.Data",
66
"description": "Containers should only use allowed AppArmor profiles in a Kubernetes cluster. This policy is generally available for Kubernetes Service (AKS), and preview for Azure Arc enabled Kubernetes. For more information, see https://aka.ms/kubepolicydoc.",
77
"metadata": {
8-
"version": "7.1.1",
8+
"version": "7.2.0",
99
"category": "Kubernetes"
1010
},
11-
"version": "7.1.1",
11+
"version": "7.2.0",
1212
"parameters": {
13+
"source": {
14+
"type": "String",
15+
"metadata": {
16+
"displayName": "Source",
17+
"description": "The source k8s object for constraint evaluation. 'Original' means only evaluate against the specific GroupVersionKind specified in the policy definition. 'Generated' means only evaluate against k8s objects generated by Gatekeeper ExpansionTemplates. 'All' means evaluate against both the original object and any generated ones."
18+
},
19+
"defaultValue": "Original",
20+
"allowedValues": [
21+
"All",
22+
"Generated",
23+
"Original"
24+
]
25+
},
26+
"warn": {
27+
"type": "Boolean",
28+
"metadata": {
29+
"displayName": "Warn",
30+
"description": "Whether or not to return warnings back to the user in the kubectl cli"
31+
},
32+
"defaultValue": false
33+
},
1334
"effect": {
1435
"type": "String",
1536
"metadata": {
@@ -111,7 +132,7 @@
111132
"type": "Array",
112133
"metadata": {
113134
"displayName": "Allowed AppArmor profiles",
114-
"description": "The list of AppArmor profiles that containers are allowed to use. E.g. [ \"runtime/default\", \"docker/default\" ]. Provide empty list as input to block everything.",
135+
"description": "The list of AppArmor profiles that containers are allowed to use. E.g. [ \"runtime/default\", \"docker/default\" ]. Use \"localhost/*\" to allow all localhost profiles. Provide empty list as input to block everything.",
115136
"portalReview": true
116137
},
117138
"defaultValue": [
@@ -147,6 +168,8 @@
147168
"then": {
148169
"effect": "[parameters('effect')]",
149170
"details": {
171+
"source": "[parameters('source')]",
172+
"warn": "[parameters('warn')]",
150173
"templateInfo": {
151174
"sourceType": "PublicURL",
152175
"url": "https://store.policy.azure.us/kubernetes/enforce-apparmor-profile/v3/template.yaml"
@@ -169,6 +192,7 @@
169192
}
170193
},
171194
"versions": [
195+
"7.2.0",
172196
"7.1.1"
173197
]
174198
},

built-in-policies/policyDefinitions/Azure Government/Kubernetes/SELinux.json

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,36 @@
11
{
22
"properties": {
3-
"displayName": "Kubernetes cluster pods and containers should only use allowed SELinux options",
3+
"displayName": "Kubernetes cluster pods and containers should follow SELinux security standards",
44
"policyType": "BuiltIn",
55
"mode": "Microsoft.Kubernetes.Data",
6-
"description": "Pods and containers should only use allowed SELinux options in a Kubernetes cluster. This policy is generally available for Kubernetes Service (AKS), and preview for Azure Arc enabled Kubernetes. For more information, see https://aka.ms/kubepolicydoc.",
6+
"description": "This policy enforces Kubernetes Pod Security Standards for SELinux options. Under PSS mode, 'user' and 'role' fields must be empty, and 'type' field must be one of the allowed values. For more information, see https://aka.ms/kubepolicydoc.",
77
"metadata": {
8-
"version": "8.1.1",
8+
"version": "9.0.0",
99
"category": "Kubernetes"
1010
},
11-
"version": "8.1.1",
11+
"version": "9.0.0",
1212
"parameters": {
13+
"source": {
14+
"type": "String",
15+
"metadata": {
16+
"displayName": "Source",
17+
"description": "The source k8s object for constraint evaluation. 'Original' means only evaluate against the specific GroupVersionKind specified in the policy definition. 'Generated' means only evaluate against k8s objects generated by Gatekeeper ExpansionTemplates. 'All' means evaluate against both the original object and any generated ones."
18+
},
19+
"defaultValue": "Original",
20+
"allowedValues": [
21+
"All",
22+
"Generated",
23+
"Original"
24+
]
25+
},
26+
"warn": {
27+
"type": "Boolean",
28+
"metadata": {
29+
"displayName": "Warn",
30+
"description": "Whether or not to return warnings back to the user in the kubectl cli"
31+
},
32+
"defaultValue": false
33+
},
1334
"effect": {
1435
"type": "String",
1536
"metadata": {
@@ -104,11 +125,34 @@
104125
"additionalProperties": false
105126
}
106127
},
128+
"enforcePSS": {
129+
"type": "Boolean",
130+
"metadata": {
131+
"displayName": "Enforce Pod Security Standards",
132+
"description": "When true, enforces Kubernetes Pod Security Standards for SELinux options. Under PSS mode, 'user' and 'role' fields must be undefined or empty, and 'type' field must be one of the allowed values. When false, custom SELinux options can be specified.",
133+
"portalReview": true
134+
},
135+
"defaultValue": false
136+
},
137+
"allowedSELinuxTypes": {
138+
"type": "Array",
139+
"metadata": {
140+
"displayName": "Allowed SELinux types",
141+
"description": "List of allowed SELinux type values. Following PSS, this should typically include container_t, container_init_t, container_kvm_t and for K8s 1.31+ container_engine_t. Empty string is always allowed.",
142+
"portalReview": true
143+
},
144+
"defaultValue": [
145+
"container_t",
146+
"container_init_t",
147+
"container_kvm_t",
148+
"container_engine_t"
149+
]
150+
},
107151
"allowedSELinuxOptions": {
108152
"type": "Object",
109153
"metadata": {
110154
"displayName": "Allowed SELinux options",
111-
"description": "The allowed configurations for pod and container level SELinux Options. Provide empty options list as input to block everything.",
155+
"description": "The allowed configurations for pod and container level SELinux Options. Only used when enforcePSS is false.",
112156
"portalReview": true
113157
},
114158
"defaultValue": {
@@ -166,9 +210,11 @@
166210
"then": {
167211
"effect": "[parameters('effect')]",
168212
"details": {
213+
"source": "[parameters('source')]",
214+
"warn": "[parameters('warn')]",
169215
"templateInfo": {
170216
"sourceType": "PublicURL",
171-
"url": "https://store.policy.azure.us/kubernetes/selinux/v2/template.yaml"
217+
"url": "https://store.policy.azure.us/kubernetes/selinux/v3/template.yaml"
172218
},
173219
"apiGroups": [
174220
""
@@ -180,13 +226,16 @@
180226
"namespaces": "[parameters('namespaces')]",
181227
"labelSelector": "[parameters('labelSelector')]",
182228
"values": {
229+
"enforcePSS": "[parameters('enforcePSS')]",
230+
"allowedSELinuxTypes": "[parameters('allowedSELinuxTypes')]",
183231
"allowedSELinuxOptions": "[parameters('allowedSELinuxOptions').options]",
184232
"excludedImages": "[parameters('excludedImages')]"
185233
}
186234
}
187235
}
188236
},
189237
"versions": [
238+
"9.0.0",
190239
"8.1.1"
191240
]
192241
},

0 commit comments

Comments
 (0)