Gallery › Mission › Azure built-in policies
Control the use of AKS for Cloud in Mission Platforms
Converted Initiative Version 1.0.0
This policy initiative applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. This initiative deploys Azure policies for AKS ensuring boundary protection of this resource while it operates within the logically separated structure of Mission Platform.
ConvertTo-Bylaw converted this initiative, and proved that the file compiles back to the same definition.
Azure Policy JSONAKSInitiative.json · 197 lines
{
"properties": {
"displayName": "Control the use of AKS for Cloud in Mission Platforms",
"policyType": "BuiltIn",
"description": "This policy initiative applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. This initiative deploys Azure policies for AKS ensuring boundary protection of this resource while it operates within the logically separated structure of Mission Platform.",
"metadata": {
"version": "1.0.0",
"category": "Mission"
},
"version": "1.0.0",
"parameters": {
"effect-0e246bcf-5f6f-4f87-bc6f-775d4712c7ea": {
"type": "String",
"metadata": {
"displayName": "Effect for Policy: Authorized IP ranges should be defined on Kubernetes Services",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Audit",
"Disabled"
],
"defaultValue": "Audit"
},
"effect-89f2d532-c53c-4f8f-9afa-4927b1114a0d": {
"type": "String",
"metadata": {
"displayName": "Effect for Policy: AKS should disable Command Invoke",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Audit",
"Disabled"
],
"defaultValue": "Audit"
},
"effect-040732e8-d947-40b8-95d6-854c95024bf8": {
"type": "String",
"metadata": {
"displayName": "Effect for Policy: Azure Kubernetes Service Private Clusters should be enabled",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Audit",
"Disabled"
],
"defaultValue": "Audit"
},
"effect-dbbdc317-9734-4dd8-9074-993b29c69008": {
"type": "String",
"metadata": {
"displayName": "Effect for Policy: AKS should enable KMS",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Audit",
"Disabled"
],
"defaultValue": "Audit"
},
"effect-7d7be79c-23ba-4033-84dd-45e2a5ccdd67": {
"type": "String",
"metadata": {
"displayName": "Effect for Policy: AKS should use CMK",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Audit",
"Disabled"
],
"defaultValue": "Audit"
},
"effect-ac4a19c2-fa67-49b4-8ae5-0b2e78c49457": {
"type": "String",
"metadata": {
"displayName": "Effect for Policy: Azure Kubernetes Service Clusters should use RBAC",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Audit",
"Disabled"
],
"defaultValue": "Audit"
},
"effect-da6e2401-19da-4532-9141-fb8fbde08431": {
"type": "String",
"metadata": {
"displayName": "Effect for Policy: AKS should use Managed Identities",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Audit",
"Disabled"
],
"defaultValue": "Audit"
},
"effect-a1840de2-8088-4ea8-b153-b4c723e9cb01": {
"type": "String",
"metadata": {
"displayName": "Effect for Policy: AKS should enable Defender",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Audit",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyDefinitions": [
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0e246bcf-5f6f-4f87-bc6f-775d4712c7ea",
"policyDefinitionReferenceId": "AksAuthorizedIpRangesShouldBeDefined",
"definitionVersion": "2.*.*",
"parameters": {
"effect": {
"value": "[parameters('effect-0e246bcf-5f6f-4f87-bc6f-775d4712c7ea')]"
}
}
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/89f2d532-c53c-4f8f-9afa-4927b1114a0d",
"policyDefinitionReferenceId": "AksShouldDisableCommandInvoke",
"definitionVersion": "1.*.*",
"parameters": {
"effect": {
"value": "[parameters('effect-89f2d532-c53c-4f8f-9afa-4927b1114a0d')]"
}
}
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/040732e8-d947-40b8-95d6-854c95024bf8",
"policyDefinitionReferenceId": "AksShouldEnablePrivateClusters",
"definitionVersion": "1.*.*",
"parameters": {
"effect": {
"value": "[parameters('effect-040732e8-d947-40b8-95d6-854c95024bf8')]"
}
}
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/dbbdc317-9734-4dd8-9074-993b29c69008",
"policyDefinitionReferenceId": "AksShouldEnableKms",
"definitionVersion": "1.*.*",
"parameters": {
"effect": {
"value": "[parameters('effect-dbbdc317-9734-4dd8-9074-993b29c69008')]"
}
}
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7d7be79c-23ba-4033-84dd-45e2a5ccdd67",
"policyDefinitionReferenceId": "AksShouldUseCmk",
"definitionVersion": "1.*.*",
"parameters": {
"effect": {
"value": "[parameters('effect-7d7be79c-23ba-4033-84dd-45e2a5ccdd67')]"
}
}
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/ac4a19c2-fa67-49b4-8ae5-0b2e78c49457",
"policyDefinitionReferenceId": "AksShouldUseRbac",
"definitionVersion": "1.*.*",
"parameters": {
"effect": {
"value": "[parameters('effect-ac4a19c2-fa67-49b4-8ae5-0b2e78c49457')]"
}
}
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/da6e2401-19da-4532-9141-fb8fbde08431",
"policyDefinitionReferenceId": "AksShouldUseManagedIds",
"definitionVersion": "1.*.*",
"parameters": {
"effect": {
"value": "[parameters('effect-da6e2401-19da-4532-9141-fb8fbde08431')]"
}
}
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a1840de2-8088-4ea8-b153-b4c723e9cb01",
"policyDefinitionReferenceId": "AksShouldEnableDefender",
"definitionVersion": "2.*.*",
"parameters": {
"effect": {
"value": "[parameters('effect-a1840de2-8088-4ea8-b153-b4c723e9cb01')]"
}
}
}
],
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policySetDefinitions/ba557f41-8712-41bc-a2c4-2db129c43561",
"name": "ba557f41-8712-41bc-a2c4-2db129c43561"
}Bylawba557f41-8712-41bc-a2c4-2db129c43561.bylaw.ps1 · 140 lines
# Converted from AKSInitiative.json by ConvertTo-Bylaw.
Initiative 'ba557f41-8712-41bc-a2c4-2db129c43561' {
Properties @{
DisplayName = 'Control the use of AKS for Cloud in Mission Platforms'
Description = 'This policy initiative applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. This initiative deploys Azure policies for AKS ensuring boundary protection of this resource while it operates within the logically separated structure of Mission Platform.'
Version = '1.0.0'
Category = 'Mission'
PolicyVersion = '1.0.0'
}
Parameter Effect_0e246bcf_5f6f_4f87_bc6f_775d4712c7ea @{
AllowedValues = @('Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect for Policy: Authorized IP ranges should be defined on Kubernetes Services'
Description = 'Enable or disable the execution of the policy'
JsonName = 'effect-0e246bcf-5f6f-4f87-bc6f-775d4712c7ea'
}
Parameter Effect_89f2d532_c53c_4f8f_9afa_4927b1114a0d @{
AllowedValues = @('Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect for Policy: AKS should disable Command Invoke'
Description = 'Enable or disable the execution of the policy'
JsonName = 'effect-89f2d532-c53c-4f8f-9afa-4927b1114a0d'
}
Parameter Effect_040732e8_d947_40b8_95d6_854c95024bf8 @{
AllowedValues = @('Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect for Policy: Azure Kubernetes Service Private Clusters should be enabled'
Description = 'Enable or disable the execution of the policy'
JsonName = 'effect-040732e8-d947-40b8-95d6-854c95024bf8'
}
Parameter Effect_dbbdc317_9734_4dd8_9074_993b29c69008 @{
AllowedValues = @('Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect for Policy: AKS should enable KMS'
Description = 'Enable or disable the execution of the policy'
JsonName = 'effect-dbbdc317-9734-4dd8-9074-993b29c69008'
}
Parameter Effect_7d7be79c_23ba_4033_84dd_45e2a5ccdd67 @{
AllowedValues = @('Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect for Policy: AKS should use CMK'
Description = 'Enable or disable the execution of the policy'
JsonName = 'effect-7d7be79c-23ba-4033-84dd-45e2a5ccdd67'
}
Parameter Effect_ac4a19c2_fa67_49b4_8ae5_0b2e78c49457 @{
AllowedValues = @('Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect for Policy: Azure Kubernetes Service Clusters should use RBAC'
Description = 'Enable or disable the execution of the policy'
JsonName = 'effect-ac4a19c2-fa67-49b4-8ae5-0b2e78c49457'
}
Parameter Effect_da6e2401_19da_4532_9141_fb8fbde08431 @{
AllowedValues = @('Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect for Policy: AKS should use Managed Identities'
Description = 'Enable or disable the execution of the policy'
JsonName = 'effect-da6e2401-19da-4532-9141-fb8fbde08431'
}
Parameter Effect_a1840de2_8088_4ea8_b153_b4c723e9cb01 @{
AllowedValues = @('Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect for Policy: AKS should enable Defender'
Description = 'Enable or disable the execution of the policy'
JsonName = 'effect-a1840de2-8088-4ea8-b153-b4c723e9cb01'
}
PolicyDefinition @{
Id = '0e246bcf-5f6f-4f87-bc6f-775d4712c7ea'
ReferenceId = 'AksAuthorizedIpRangesShouldBeDefined'
Version = '2.*.*'
Parameters = @{
effect = (Param Effect_0e246bcf_5f6f_4f87_bc6f_775d4712c7ea)
}
}
PolicyDefinition @{
Id = '89f2d532-c53c-4f8f-9afa-4927b1114a0d'
ReferenceId = 'AksShouldDisableCommandInvoke'
Version = '1.*.*'
Parameters = @{
effect = (Param Effect_89f2d532_c53c_4f8f_9afa_4927b1114a0d)
}
}
PolicyDefinition @{
Id = '040732e8-d947-40b8-95d6-854c95024bf8'
ReferenceId = 'AksShouldEnablePrivateClusters'
Version = '1.*.*'
Parameters = @{
effect = (Param Effect_040732e8_d947_40b8_95d6_854c95024bf8)
}
}
PolicyDefinition @{
Id = 'dbbdc317-9734-4dd8-9074-993b29c69008'
ReferenceId = 'AksShouldEnableKms'
Version = '1.*.*'
Parameters = @{
effect = (Param Effect_dbbdc317_9734_4dd8_9074_993b29c69008)
}
}
PolicyDefinition @{
Id = '7d7be79c-23ba-4033-84dd-45e2a5ccdd67'
ReferenceId = 'AksShouldUseCmk'
Version = '1.*.*'
Parameters = @{
effect = (Param Effect_7d7be79c_23ba_4033_84dd_45e2a5ccdd67)
}
}
PolicyDefinition @{
Id = 'ac4a19c2-fa67-49b4-8ae5-0b2e78c49457'
ReferenceId = 'AksShouldUseRbac'
Version = '1.*.*'
Parameters = @{
effect = (Param Effect_ac4a19c2_fa67_49b4_8ae5_0b2e78c49457)
}
}
PolicyDefinition @{
Id = 'da6e2401-19da-4532-9141-fb8fbde08431'
ReferenceId = 'AksShouldUseManagedIds'
Version = '1.*.*'
Parameters = @{
effect = (Param Effect_da6e2401_19da_4532_9141_fb8fbde08431)
}
}
PolicyDefinition @{
Id = 'a1840de2-8088-4ea8-b153-b4c723e9cb01'
ReferenceId = 'AksShouldEnableDefender'
Version = '2.*.*'
Parameters = @{
effect = (Param Effect_a1840de2_8088_4ea8_b153_b4c723e9cb01)
}
}
}Members (8)
- Authorized IP ranges should be defined on Kubernetes Services
- 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/Mission/AKSInitiative.json in Azure/azure-policy, under the MIT licence.
Bylaw