Skip to content

Commit ec2f6d0

Browse files
committed
Refactor AKS policy to correct versioning and update mode; enhance policy rule logic for improved compliance checks
1 parent 50b7d76 commit ec2f6d0

1 file changed

Lines changed: 16 additions & 38 deletions

File tree

‎policyDefinitions/aks/pol-deny-aks-disks-cache-encrypted-at-host.json‎

Lines changed: 16 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
"description": "To enhance data security, the data stored on the virtual machine (VM) host of your Azure Kubernetes Service nodes VMs should be encrypted at rest. This is a common requirement in many regulatory and industry compliance standards.",
66
"metadata": {
77
"category": "Azure Kubernetes Service",
8-
"version": "1.1.0",
8+
"version": "1.0.0",
99
"preview": false,
1010
"deprecated": false,
1111
"source_builtIn_name": "41425d9f-d1a5-499a-9932-f8ed8453932c"
1212
},
13-
"mode": "All",
13+
"mode": "Indexed",
1414
"parameters": {
1515
"effect": {
1616
"type": "String",
@@ -28,52 +28,30 @@
2828
},
2929
"policyRule": {
3030
"if": {
31-
"anyOf": [
31+
"allOf": [
3232
{
33-
"allOf": [
34-
{
35-
"field": "type",
36-
"equals": "Microsoft.ContainerService/managedClusters"
37-
},
38-
{
39-
"count": {
40-
"field": "Microsoft.ContainerService/managedClusters/agentPoolProfiles[*]",
41-
"where": {
42-
"anyOf": [
43-
{
44-
"field": "Microsoft.ContainerService/managedClusters/agentPoolProfiles[*].enableEncryptionAtHost",
45-
"exists": "false"
46-
},
47-
{
48-
"field": "Microsoft.ContainerService/managedClusters/agentPoolProfiles[*].enableEncryptionAtHost",
49-
"equals": "false"
50-
}
51-
]
52-
}
53-
},
54-
"greater": 0
55-
}
56-
]
33+
"field": "type",
34+
"equals": "Microsoft.ContainerService/managedClusters"
5735
},
5836
{
59-
"allOf": [
60-
{
61-
"field": "type",
62-
"equals": "Microsoft.ContainerService/managedClusters/agentPools"
63-
},
64-
{
37+
"count": {
38+
"field": "Microsoft.ContainerService/managedClusters/agentPoolProfiles[*]",
39+
"where": {
6540
"anyOf": [
6641
{
67-
"field": "Microsoft.ContainerService/managedClusters/agentPools/enableEncryptionAtHost",
68-
"exists": "false"
42+
"field": "Microsoft.ContainerService/managedClusters/agentPoolProfiles[*].enableEncryptionAtHost",
43+
"exists": "False"
6944
},
7045
{
71-
"field": "Microsoft.ContainerService/managedClusters/agentPools/enableEncryptionAtHost",
72-
"equals": "false"
46+
"not":{
47+
"field": "Microsoft.ContainerService/managedClusters/agentPoolProfiles[*].enableEncryptionAtHost",
48+
"equals": "true"
49+
}
7350
}
7451
]
7552
}
76-
]
53+
},
54+
"greater": 0
7755
}
7856
]
7957
},

0 commit comments

Comments
 (0)