Gallery › VirtualEnclaves › Azure built-in policies
[Preview]: Control the use of AKS in a Virtual Enclave
Converted Initiative Version 1.0.0-preview Preview
This initiative deploys Azure policies for AKS ensuring boundary protection of this resource while it operates within the logically separated structure of Azure Virtual Enclaves. https://aka.ms/VirtualEnclaves
ConvertTo-Bylaw converted this initiative, and proved that the file compiles back to the same definition.
Azure Policy JSONAKSInitiative.json · 65 lines
{
"properties": {
"displayName": "[Preview]: Control the use of AKS in a Virtual Enclave",
"policyType": "BuiltIn",
"description": "This initiative deploys Azure policies for AKS ensuring boundary protection of this resource while it operates within the logically separated structure of Azure Virtual Enclaves. https://aka.ms/VirtualEnclaves",
"metadata": {
"version": "1.0.0-preview",
"category": "VirtualEnclaves",
"preview": true
},
"version": "1.0.0-preview",
"policyDefinitions": [
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0e246bcf-5f6f-4f87-bc6f-775d4712c7ea",
"policyDefinitionReferenceId": "AksAuthorizedIpRangesShouldBeDefined",
"definitionVersion": "2.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/dbbdc317-9734-4dd8-9074-993b29c69008",
"policyDefinitionReferenceId": "AksShouldEnabledKMS",
"definitionVersion": "1.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/89f2d532-c53c-4f8f-9afa-4927b1114a0d",
"policyDefinitionReferenceId": "AksShouldDisableCommandInvoke",
"definitionVersion": "1.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/040732e8-d947-40b8-95d6-854c95024bf8",
"policyDefinitionReferenceId": "AksShouldEnablePrivateClusters",
"definitionVersion": "1.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/dbbdc317-9734-4dd8-9074-993b29c69008",
"policyDefinitionReferenceId": "AksShouldEnableKms",
"definitionVersion": "1.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7d7be79c-23ba-4033-84dd-45e2a5ccdd67",
"policyDefinitionReferenceId": "AksShouldUseCmk",
"definitionVersion": "1.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/ac4a19c2-fa67-49b4-8ae5-0b2e78c49457",
"policyDefinitionReferenceId": "AksShouldUseRbac",
"definitionVersion": "1.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/da6e2401-19da-4532-9141-fb8fbde08431",
"policyDefinitionReferenceId": "AksShouldUseManagedIds",
"definitionVersion": "1.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a1840de2-8088-4ea8-b153-b4c723e9cb01",
"policyDefinitionReferenceId": "AksShouldEnableDefender",
"definitionVersion": "2.*.*"
}
],
"versions": [
"1.0.0-PREVIEW"
]
},
"id": "/providers/Microsoft.Authorization/policySetDefinitions/d300338e-65d1-4be3-b18e-fb4ce5715a8f",
"name": "d300338e-65d1-4be3-b18e-fb4ce5715a8f"
}Bylawd300338e-65d1-4be3-b18e-fb4ce5715a8f.bylaw.ps1 · 42 lines
# Converted from AKSInitiative.json by ConvertTo-Bylaw.
Initiative 'd300338e-65d1-4be3-b18e-fb4ce5715a8f' {
Properties @{
DisplayName = '[Preview]: Control the use of AKS in a Virtual Enclave'
Description = 'This initiative deploys Azure policies for AKS ensuring boundary protection of this resource while it operates within the logically separated structure of Azure Virtual Enclaves. https://aka.ms/VirtualEnclaves'
Version = '1.0.0-preview'
Category = 'VirtualEnclaves'
Preview = $true
PolicyVersion = '1.0.0-preview'
}
PolicyDefinition @{
Id = '0e246bcf-5f6f-4f87-bc6f-775d4712c7ea'
ReferenceId = 'AksAuthorizedIpRangesShouldBeDefined'
Version = '2.*.*'
}
PolicyDefinition -Id 'dbbdc317-9734-4dd8-9074-993b29c69008' -ReferenceId 'AksShouldEnabledKMS' -Version '1.*.*'
PolicyDefinition @{
Id = '89f2d532-c53c-4f8f-9afa-4927b1114a0d'
ReferenceId = 'AksShouldDisableCommandInvoke'
Version = '1.*.*'
}
PolicyDefinition @{
Id = '040732e8-d947-40b8-95d6-854c95024bf8'
ReferenceId = 'AksShouldEnablePrivateClusters'
Version = '1.*.*'
}
PolicyDefinition -Id 'dbbdc317-9734-4dd8-9074-993b29c69008' -ReferenceId 'AksShouldEnableKms' -Version '1.*.*'
PolicyDefinition -Id '7d7be79c-23ba-4033-84dd-45e2a5ccdd67' -ReferenceId 'AksShouldUseCmk' -Version '1.*.*'
PolicyDefinition -Id 'ac4a19c2-fa67-49b4-8ae5-0b2e78c49457' -ReferenceId 'AksShouldUseRbac' -Version '1.*.*'
PolicyDefinition -Id 'da6e2401-19da-4532-9141-fb8fbde08431' -ReferenceId 'AksShouldUseManagedIds' -Version '1.*.*'
PolicyDefinition -Id 'a1840de2-8088-4ea8-b153-b4c723e9cb01' -ReferenceId 'AksShouldEnableDefender' -Version '2.*.*'
}Members (9)
- Authorized IP ranges should be defined on Kubernetes Services
- Azure Kubernetes Clusters should enable Key Management Service (KMS)
- Azure Kubernetes Service Clusters should disable Command Invoke
- Azure Kubernetes Service Private Clusters should be enabled
- Azure Kubernetes Clusters should enable Key Management Service (KMS)
- Both operating systems and data disks in Azure Kubernetes Service clusters should be encrypted by customer-managed keys
- Role-Based Access Control (RBAC) should be used on Kubernetes Services
- Azure Kubernetes Service Clusters should use managed identities
- Azure Kubernetes Service clusters should have Defender profile enabled
Source: built-in-policies/policySetDefinitions/VirtualEnclaves/AKSInitiative.json in Azure/azure-policy, under the MIT licence.
Bylaw