Azure-devops-docs: Azure DevOps created a service account with cluster-admin role for a RBAC-enabled cluster

Created on 12 Jun 2020  Â·  3Comments  Â·  Source: MicrosoftDocs/azure-devops-docs

1) Created a new AKS cluster in the Azure portal
2) Enabled RBAC
3) Selected the new AKS cluster and namespace in the Azure DevOps "Add Kubernetes Resource" inside an Environment
4) Used kubectl to examine what Azure DevOps did
5) Verified Azure DevOps created a service account with cluster-admin role for a RBAC-enabled cluster

New service account:

kubectl get serviceaccount --namespace test
NAME              SECRETS   AGE
azdev-sa-403636   1         37m

New RoleBinding:

kubectl get rolebinding --namespace test -o json
            "roleRef": {
                "apiGroup": "rbac.authorization.k8s.io",
                "kind": "ClusterRole",
                "name": "cluster-admin"
            },
            "subjects": [
                {
                    "kind": "ServiceAccount",
                    "name": "azdev-sa-403636",
                    "namespace": "test"
                }

According to the documentation, the service account should be least-privileged:

For an RBAC enabled cluster, RoleBinding is created as well to limit the scope of the created service account to the chosen namespace. For an RBAC disabled cluster, the ServiceAccount created has cluster-wide privileges (across namespaces).

Either the documentation needs to be updated to say _For an RBAC enabled cluster, the ServiceAccount created has a cluster-admin role_ or the DevOps bug needs to be corrected.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 devops-cicd-procestech devopprod doc-enhancement

Most helpful comment

Azure DevOps Support #: 120061921001404

Would be great if the documentation included the service account RBAC permissions required in the namespace for Azure DevOps Kubernetes environments.

All 3 comments

@GeorgeTsiokos we are taking a glimpse on CSS Azure DevOps support, we are going to analyze the data

Azure DevOps Support #: 120061921001404

Would be great if the documentation included the service account RBAC permissions required in the namespace for Azure DevOps Kubernetes environments.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mikedouglasdev picture mikedouglasdev  Â·  3Comments

atrauzzi picture atrauzzi  Â·  3Comments

sevaa picture sevaa  Â·  3Comments

cijujoseph picture cijujoseph  Â·  3Comments

MJECloud picture MJECloud  Â·  3Comments