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

Konstantin Bachem 0 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.
2,090 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
21,590 questions
{count} votes

2 answers

Sort by: Most helpful
  1. vipullag-MSFT 26,301 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.


  2. Konstantin Bachem 0 Reputation points
    2024-07-18T10:55:36.5266667+00:00

    I have contacted Microsoft support, who have responded with the following:

    These are the default local accounts that are configured on RBAC clusterrolebinding.

    Yes, both users will have same permissions when using only RBAC, but this is by design.

    So, if you have AAD enabled on your cluster, this clusterrolebinding will not be taken in consideration, since AAD overlap RBAC.

    If you think that this might be some "unsecure" configuration on your cluster, you can always disable this local accounts: Manage local accounts with AKS-managed Microsoft Entra integration - Azure Kubernetes Service | Microsoft Learn

    More information on this: Azure.AKS.LocalAccounts - PSRule for Azure


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.