The ClusterRoleBinding aks-cluster-admin-binding includes the User clusterUser as a subject

Konstantin Bachem 20 Reputation points
2024-07-08T14:36:04.85+00:00

Hello

On an RBAC & AzureRBAC enabled AKS cluster I have noticed that the cluster-admin ClusterRole is bound to two subjects through the aks-cluster-admin-binding ClusterRoleBinding:

  • User/clusterAdmin
  • User/clusterUser

This is unexpected. As far as I understand following Use Azure role-based access control to define access to the Kubernetes configuration file in Azure Kubernetes Service (AKS) - Available permissions for cluster roles, the Users clusterAdmin and clusterUser correspond to the Entra ID roles "Azure Kubernetes Service Cluster Admin" and "Azure Kubernetes Service Cluster User", respectively.

The cluster-admin ClusterRole grants full access onto all resources in all namespaces in the cluster. As such, an Entra ID user who is assigned the "Azure Kubernetes Service Cluster User" role in Entra ID should not be assigned the cluster-admin ClusterRole in Kubernetes.

Am I misunderstanding something?

Best

Konstantin

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
1,979 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,489 questions
{count} votes

Accepted answer
  1. vipullag-MSFT 25,861 Reputation points
    2024-07-12T05:12:02.5333333+00:00

    Hello Konstantin Bachem

    Welcome to Microsoft Q&A Platform, thanks for posting your query here.

    Based on the details you provided, looks like there is a discrepancy between the Entra ID roles and the Kubernetes RBAC roles assigned to the users.
    The cluster-admin ClusterRole grants full access to all resources in all namespaces in the cluster, and it should only be assigned to users who require full administrative access to the cluster.

    The Azure Kubernetes Service Cluster Admin role in Entra ID corresponds to the cluster-admin ClusterRole in Kubernetes, while the Azure Kubernetes Service Cluster User role in Entra ID corresponds to a more limited set of permissions in Kubernetes.

    It is possible that the clusterUser user in Kubernetes was mistakenly assigned the cluster-admin ClusterRole, which would grant them full administrative access to the cluster. I would recommend reviewing the RBAC roles assigned to each user in Kubernetes and ensuring that they correspond to the appropriate Entra ID roles.

    If you are still unsure about the RBAC roles assigned to users in your AKS cluster, you can use the kubectl describe clusterrolebinding command to view the details of the ClusterRoleBindings that have been created.

    Hope this helps.


0 additional answers

Sort by: Most helpful