1ES hosted pool azure/login used the pool managed identity instead of GitHub OIDC federation
The scenario
GitHub Actions now runs on a 1ES Managed DevOps Pool in a landing-zone spoke. azure/login@v2 with client-id set to the pool VMSS user-assigned identity succeeds for az acr login but az aks get-credentials 403s. The Entra app with the GitHub federated credential is unused. GitHub-hosted runners used to OIDC to that app.
Model answer
What I'd say first:
I would not grant the pool managed identity Kubernetes Contributor. The pool identity is the runner's Azure identity for pulling the image and joining the VNet. It is not the deployment identity. azure/login must use the Entra app with GitHub federation.
How I'd work it:
- 1Confirm azure/login is using the pool VMSS user-assigned identity as client-id. That explains ACR login working and AKS get-credentials 403ing.
- 2Restore login to the Entra app that has issuer token.actions.githubusercontent.com and the GitHub subject. Keep id-token write and an environment-scoped subject.
- 3Shrink the pool identity to image-pull and network join. Do not point the OIDC issuer at the pool tenant.
- 4Tell the room 1ES does not change OIDC. Tokens still come from GitHub even on a private pool.
How I'd explain it:
Private 1ES pools are network placement, not a new token issuer. A wrong answer is standing secrets, or over-granting the VMSS identity so every job on the pool is cluster admin.
How I'd prevent it:
A CI check that client-id is not the pool identity. A catalog of federated subjects per environment. Pool MI stays least privilege.
The follow-up they'll ask
“Grant the pool MI Azure Kubernetes Service Contributor so deploys work?”
No. Granting the pool managed identity Azure Kubernetes Service Contributor makes every job on the pool a cluster admin. I would keep OIDC on the app registration. Restore azure/login to that app, with GitHub as issuer. The pool identity stays for image pull and VNet join. This is not a permissions gap on the runner.
Common mistakes
- Pool MI as deploy identity
- Changing OIDC issuer to the pool
- Standing secrets
- Over-granting the VMSS identity