Control: 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.
Usage
Run the control in your terminal:
powerpipe control run terraform_azure_compliance.control.kubernetes_instance_rbac_enabled
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run terraform_azure_compliance.control.kubernetes_instance_rbac_enabled --share
SQL
This control uses a named query:
select address as resource, case when (attributes_std -> 'role_based_access_control') is null then 'alarm' when (attributes_std -> 'role_based_access_control' -> 'azure_active_directory' -> 'azure_rbac_enabled')::boolean then 'ok' else 'alarm' end status, split_part(address, '.', 2) || case when (attributes_std -> 'role_based_access_control') is null then ' ''role_based_access_control'' not defined' when (attributes_std -> 'role_based_access_control' -> 'azure_active_directory' -> 'azure_rbac_enabled')::boolean then ' role based access control enabled' else ' role based access control disabled' end || '.' reason , path || ':' || start_linefrom terraform_resourcewhere type = 'azurerm_kubernetes_cluster';