56 lines
2.0 KiB
YAML
56 lines
2.0 KiB
YAML
id: azure-aks-rbac-unconfigured
|
|
info:
|
|
name: Azure AKS RBAC Not Enabled
|
|
author: princechaddha
|
|
severity: medium
|
|
description: |
|
|
Ensure that Kubernetes Role-Based Access Control (RBAC) is enabled for all Azure Kubernetes Service (AKS) clusters in order to achieve fine-grained control over AKS cluster resources. The Kubernetes Role-Based Access Control (RBAC) represents an efficient method of regulating access to Azure Kubernetes Service resources based on the roles of individual users or groups within an organization.
|
|
impact: |
|
|
If RBAC is not enabled for AKS clusters, unauthorized access or unregulated permissions may occur, leading to potential security vulnerabilities.
|
|
remediation: |
|
|
Ensure that Kubernetes Role-Based Access Control (RBAC) is enabled for each AKS cluster by configuring it during cluster creation or modifying existing clusters to enable RBAC settings.
|
|
reference:
|
|
- https://docs.microsoft.com/en-us/azure/aks/concepts-identity
|
|
tags: cloud,devops,azure,microsoft,aks,azure-cloud-config
|
|
|
|
flow: |
|
|
code(1);
|
|
for (let ClusterData of iterate(template.clusterList)) {
|
|
ClusterData = JSON.parse(ClusterData);
|
|
set("name", ClusterData.name);
|
|
set("resourceGroup", ClusterData.resourceGroup);
|
|
code(2);
|
|
}
|
|
|
|
self-contained: true
|
|
code:
|
|
- engine:
|
|
- sh
|
|
- bash
|
|
source: |
|
|
az aks list --output json --query '[*].{name:name, resourceGroup:resourceGroup}'
|
|
|
|
extractors:
|
|
- type: json
|
|
name: clusterList
|
|
internal: true
|
|
json:
|
|
- '.[]'
|
|
|
|
- engine:
|
|
- sh
|
|
- bash
|
|
source: |
|
|
az aks show --name "$name" --resource-group "$resourceGroup" --query 'enableRbac'
|
|
|
|
matchers-condition: and
|
|
matchers:
|
|
- type: word
|
|
words:
|
|
- 'false'
|
|
|
|
extractors:
|
|
- type: dsl
|
|
dsl:
|
|
- 'name + " in " + resourceGroup + " has RBAC not enabled"'
|
|
# digest: 4a0a0047304502204650e2feed9c433ad1897837c438c01ebce108cb284e218fe05f819034b48c3d022100acb11130dcf21735dfd7ce986df19b4a2d051ac92817a702029d137f3ae478d2:922c64590222798bb761d5b6d8e72950 |