An Azure DevOps Security Review That Changed the Defaults

  • Azure DevOps
  • Entra ID
  • Terraform
  • RBAC

Before

Collection-level administrator access sat with teams that didn't need it, permissions were granted to individual users instead of groups, and anyone could create a new Azure DevOps organization.

What I built

Authored the Azure DevOps security proposal that leadership adopted. It identified those three gaps and drove the fixes: group-based permissions, restricted organization creation, Entra ID as the single source of truth for access, and the Azure DevOps estate managed in Terraform.

01Findingsthree access gaps02Proposalwritten03Adoptedby leadership04Entra ID groupssingle source05TerraformAzure DevOps estateA review only counts once it changes thedefaults.

The problem: the delivery platform was wide open

Azure DevOps holds the keys to everything it deploys: source code, pipelines, service connections into cloud subscriptions. A review of how access worked found three problems:

  • Organization-level admin access sat with the wrong people. Project Collection Administrator, the highest permission level in an Azure DevOps organization, was held more broadly than it should be, while the cloud engineering team responsible for the platform didn't hold it.
  • Permissions were granted to individual users, not groups. People were added directly to built-in security groups, so access was hard to audit, easy to get wrong, and didn't follow people when they changed teams or left.
  • Anyone could create a new Azure DevOps organization. With no restriction, new organizations could appear outside any governance, consuming DevOps, Azure resources and services, with nobody accountable for their security.

The approach: least privilege at the top, groups instead of people, identity upstream

Findings (three access gaps)
   → Written proposal to leadership (five changes)
   → Adopted
   → Entra ID groups as the source of truth
   → Azure DevOps configuration in Terraform

The principle behind the proposal was simple: a review only counts once it changes the defaults. Fixing individual grants by hand would drift back. Changing how access is granted would stay fixed.

What I did

1. Reviewed how access actually worked

I traced who held organization-level administration, how permissions were being granted, and who could create organizations. That gave three concrete findings, each with a specific risk, rather than a general "security could be better".

Illustrative: auditing who holds organization-level admin with the Azure DevOps CLI.

# Find the Project Collection Administrators group for the organization
az devops security group list --scope organization \
  --organization https://dev.azure.com/example-org \
  --query "graphGroups[?displayName=='Project Collection Administrators'].descriptor" -o tsv

# List everyone in it, directly or through nested groups
az devops security group membership list --id <pca-group-descriptor> \
  --organization https://dev.azure.com/example-org -o table

2. Wrote a proposal leadership adopted

The proposal went to leadership with five changes:

Change What it fixes
Project Collection Administrator access only for the cloud engineering team; every other team capped at Project Administrator Org-wide admin rights held by people who don't run the platform
Group-based permissions instead of individual users in built-in groups Unauditable, error-prone access
Restrict organization creation to a small set of global administrators Unmanaged organizations appearing outside governance
Microsoft Entra ID as the single source of truth for users and groups, with least-privilege groups per team Leavers and movers keeping access
Azure DevOps configuration managed in Terraform (organization, projects, repositories, teams, pipelines) Manual configuration that drifts and can't be reviewed

Leadership adopted it, and I drove the changes.

3. Made identity flow from Entra ID

With Entra ID groups mapped into Azure DevOps groups, removing someone from an Entra ID group removes their Azure DevOps access too. Access follows the identity system everyone already manages, instead of a second list of people inside Azure DevOps.

Illustrative: an Entra ID group brought into Azure DevOps and given project access in Terraform.

# The team's Entra ID group, materialized in Azure DevOps.
resource "azuredevops_group" "payments_devs_aad" {
  origin_id = azuread_group.payments_developers.object_id
}

# Grant access to the group, never to individual users.
resource "azuredevops_group_membership" "contributors" {
  group   = data.azuredevops_group.project_contributors.descriptor
  members = [azuredevops_group.payments_devs_aad.descriptor]
}

4. Locked down organization creation

Azure DevOps has a tenant-level policy to restrict organization creation for organizations backed by Microsoft Entra ID, with an allow-list of groups that may still create them. Turning it on means new organizations only appear through a deliberate, accountable path.

Things to watch

  • Map before you remove. Taking individual users out of built-in groups before their group-based access exists locks people out mid-sprint. Audit current access, create the groups, move people, then remove the direct grants.
  • Keep the top admin group tiny. Project Collection Administrator can change every project, pipeline and permission in the organization. Treat it like any privileged role: a small named group, reviewed regularly.
  • Restricting organization creation needs the right role. The tenant policy is managed by someone with the Azure DevOps Administrator role in Entra ID, and only applies to organizations connected to that tenant.
  • Plan an emergency path. If all administration flows through Entra ID groups, decide in advance how you regain access when group sync or the identity provider has a problem.

What it solves

  • Org-wide admin rights sit with the team that runs the platform, and nobody else.
  • Access is granted to groups, so it can be audited in one place and follows people as they move or leave.
  • No unmanaged organizations appear outside governance.
  • Configuration becomes code, reviewable and repeatable instead of hand-built.

What it doesn't solve

  • Personal access tokens. Tokens created by users can outlive the access that created them. Token lifetime and scope policies are a separate control.
  • What pipelines can reach. Group-based access controls who can edit pipelines, not which subscriptions their service connections can touch. Service-connection scope and approvals are a separate layer.
  • Stale group membership. Entra ID groups make access consistent, but someone still has to review who is in each group.

Checklist

  • [ ] Organization-level admin group audited, and limited to the platform team
  • [ ] Every other team capped at project-level administration
  • [ ] No individual users in built-in security groups; access granted to groups
  • [ ] Entra ID groups mapped into Azure DevOps as the single source of truth
  • [ ] Organization creation restricted to an allow-listed group
  • [ ] Azure DevOps configuration managed as code
  • [ ] An emergency access path that doesn't depend on group sync
  • [ ] Token and service-connection policies reviewed as a follow-up

Further reading

  • Azure DevOps permissions and security groups: https://learn.microsoft.com/azure/devops/organizations/security/about-permissions
  • Restrict organization creation with a Microsoft Entra tenant policy (Microsoft Learn, Azure DevOps documentation)
  • Azure DevOps CLI security group commands (az devops security group) (Microsoft Learn)
  • Terraform azuredevops provider: azuredevops_group, azuredevops_group_membership (Terraform Registry)

Get in touch