More Info:
Use dedicated service accounts integrated with Azure Active Directory so users and groups get scoped, auditable access to Kubernetes resources instead of shared or default identities.Risk Level
MediumAddress
SecurityCompliance Standards
- CIS AKS
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Determine whether the AKS cluster is Azure AD–integrated
- Run on any machine with Azure CLI access:
- Review the output: confirm that either a legacy
aadProfileis configured oroidcIssuerProfile.enabledistrue. If neither is present, plan to enable Azure AD / OIDC integration as per your organization’s standards before proceeding.
- Run on any machine with Azure CLI access:
-
Inventory who is accessing the cluster and how (AAD users/groups vs. shared identities)
- List Azure AD app registrations and service principals used for AKS access (run from any machine with Azure AD Graph/MS Graph permissions):
- Correlate these identities with:
- The AKS cluster’s managed identity or service principals (
identity,servicePrincipalProfilefields fromaz aks show). - Any identities configured in your IaC (ARM/Bicep/Terraform) for cluster access.
- The AKS cluster’s managed identity or service principals (
- Decide which of these identities represent shared/broadly used accounts that should not have direct, unscoped access.
- List Azure AD app registrations and service principals used for AKS access (run from any machine with Azure AD Graph/MS Graph permissions):
-
Review RBAC bindings to ensure use of scoped service accounts and AAD groups, not defaults/shared identities
- Get current role bindings and cluster role bindings (any machine with kubectl access):
- For more detail on subjects:
- Manually inspect subjects and look for:
system:anonymous,system:unauthenticated, orsystem:masters.system:serviceaccount:default:defaultor other default service accounts used for application workloads.- Broad Azure AD groups or generic service principals instead of dedicated, least-privilege identities.
- Decide which bindings should be refactored to:
- Dedicated Kubernetes service accounts per application or component.
- Azure AD groups mapped to appropriate ClusterRoles/Roles for human users.
- Get current role bindings and cluster role bindings (any machine with kubectl access):
-
Check whether workloads use dedicated Kubernetes service accounts vs. defaults
- List service accounts by namespace (any machine with kubectl access):
- Inspect pods to see which service accounts they use:
- Identify applications using
defaultor other shared service accounts instead of dedicated ones. Decide which namespaces/workloads require creation and use of dedicated service accounts and corresponding Role/RoleBindings.
- List service accounts by namespace (any machine with kubectl access):
-
Define and implement the desired model for dedicated AKS service accounts and AAD integration (via console/CLI/IaC)
- Using Azure Portal, Azure CLI, or your IaC:
- Ensure the cluster is configured to use Azure AD (managed AAD/OIDC) per step 1 if your policy requires it.
- Create or update Azure AD groups to represent roles (e.g.,
aks-dev-readonly,aks-ops-admin) and assign the appropriate users. - In your Kubernetes manifests/IaC, define:
- Dedicated
ServiceAccountobjects per application or CI/CD component. Role/ClusterRoleandRoleBinding/ClusterRoleBindingobjects that bind those service accounts and AAD groups with least-privilege access.
- Dedicated
- This step is done through Azure Portal/CLI/IaC authoring; there is no single command that can generically “fix” the cluster because choices are organization- and workload-specific.
- Using Azure Portal, Azure CLI, or your IaC:
-
Verify that access is now via dedicated service accounts and AAD identities, and not via shared/default identities
- Re-run:
- Confirm that:
- Human access is mediated through Azure AD users/groups mapped to appropriate RBAC roles.
- Application workloads use named, dedicated service accounts instead of
defaultor shared accounts. - Any previously identified broad/shared or default identities have been removed or re-scoped according to your access model.
- Re-run:
Using kubectl
Using kubectl
kubectl can’t configure Azure AD integration or how identities are mapped to AKS; those settings are managed in Azure (portal/CLI/IaC) at the managed control plane level. To address this finding, use Azure AD and AKS configuration as described in the Manual Steps section rather than attempting changes with kubectl.
Automation
Automation

