Gallery › Kubernetes › Azure built-in policies
Azure Kubernetes Service Clusters should have local authentication methods disabled
Converted Policy Audit Disabled Mode Indexed Version 2.0.0
Disabling local authentication methods improves security by ensuring that Azure Kubernetes Service Clusters should exclusively require Azure Active Directory identities for authentication. Learn more at: https://aka.ms/aks-disable-local-accounts.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONAKS_DisableLocalAccounts_Deny.json · 51 lines
{
"properties": {
"policyType": "BuiltIn",
"displayName": "Azure Kubernetes Service Clusters should have local authentication methods disabled",
"description": "Disabling local authentication methods improves security by ensuring that Azure Kubernetes Service Clusters should exclusively require Azure Active Directory identities for authentication. Learn more at: https://aka.ms/aks-disable-local-accounts.",
"metadata": {
"version": "2.0.0",
"category": "Kubernetes"
},
"version": "2.0.0",
"mode": "Indexed",
"parameters": {
"effect": {
"type": "String",
"defaultValue": "Audit",
"allowedValues": [
"Audit",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy.",
"portalReview": true
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.ContainerService/managedClusters"
},
{
"field": "Microsoft.ContainerService/managedClusters/disableLocalAccounts",
"notEquals": true
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"2.0.0",
"1.0.1"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/993c2fcd-2b29-49d2-9eb0-df2c3a730c32",
"name": "993c2fcd-2b29-49d2-9eb0-df2c3a730c32"
}Bylaw993c2fcd-2b29-49d2-9eb0-df2c3a730c32.bylaw.ps1 · 29 lines
# Converted from AKS_DisableLocalAccounts_Deny.json by ConvertTo-Bylaw.
Policy '993c2fcd-2b29-49d2-9eb0-df2c3a730c32' {
Properties @{
DisplayName = 'Azure Kubernetes Service Clusters should have local authentication methods disabled'
Description = 'Disabling local authentication methods improves security by ensuring that Azure Kubernetes Service Clusters should exclusively require Azure Active Directory identities for authentication. Learn more at: https://aka.ms/aks-disable-local-accounts.'
Version = '2.0.0'
Category = 'Kubernetes'
PolicyVersion = '2.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy.'
Metadata = [ordered]@{ portalReview = $true }
}
Resource 'Microsoft.ContainerService/managedClusters' {
Require 'disableLocalAccounts is true' {
Field disableLocalAccounts | Must -Be $true
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Kubernetes/AKS_DisableLocalAccounts_Deny.json in Azure/azure-policy, under the MIT licence.
Bylaw