Gallery › Security Center › Azure built-in policies
Role-Based Access Control (RBAC) should be used on Kubernetes Services
Converted Policy Audit Disabled Mode All Version 1.1.0
To provide granular filtering on the actions that users can perform, use Role-Based Access Control (RBAC) to manage permissions in Kubernetes Service Clusters and configure relevant authorization policies.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONASC_EnableRBAC_KubernetesService_Audit.json · 55 lines
{
"properties": {
"displayName": "Role-Based Access Control (RBAC) should be used on Kubernetes Services",
"policyType": "BuiltIn",
"mode": "All",
"description": "To provide granular filtering on the actions that users can perform, use Role-Based Access Control (RBAC) to manage permissions in Kubernetes Service Clusters and configure relevant authorization policies.",
"metadata": {
"version": "1.1.0",
"category": "Security Center"
},
"version": "1.1.0",
"parameters": {
"effect": {
"type": "string",
"defaultValue": "Audit",
"allowedValues": [
"Audit",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.ContainerService/managedClusters"
},
{
"field": "Microsoft.ContainerService/managedClusters/enableRBAC",
"exists": "true"
},
{
"field": "Microsoft.ContainerService/managedClusters/enableRBAC",
"equals": "false"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.1.0",
"1.0.4",
"1.0.3"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/ac4a19c2-fa67-49b4-8ae5-0b2e78c49457",
"name": "ac4a19c2-fa67-49b4-8ae5-0b2e78c49457"
}Bylawac4a19c2-fa67-49b4-8ae5-0b2e78c49457.bylaw.ps1 · 33 lines
# Converted from ASC_EnableRBAC_KubernetesService_Audit.json by ConvertTo-Bylaw.
Policy 'ac4a19c2-fa67-49b4-8ae5-0b2e78c49457' {
Properties @{
DisplayName = 'Role-Based Access Control (RBAC) should be used on Kubernetes Services'
Description = 'To provide granular filtering on the actions that users can perform, use Role-Based Access Control (RBAC) to manage permissions in Kubernetes Service Clusters and configure relevant authorization policies.'
Version = '1.1.0'
Category = 'Security Center'
PolicyVersion = '1.1.0'
Mode = 'All'
}
Parameter Effect @{
Type = 'string'
AllowedValues = @('Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.ContainerService/managedClusters' {
When {
Field enableRBAC | Must -Exist
}
Require 'enableRBAC is not false' {
Field enableRBAC | Must -Not -Be 'false' -IfPresent
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Security Center/ASC_EnableRBAC_KubernetesService_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw