AzureDevOps organization medium builtIn

Description

Your organization should have at least 2 and at most 5 Project Collection Administrators. To reduce the risk of losing admin access, you may want to ensure at least 2 users are part of the Project Collection Administrators group. Limit the number of administrators to no more than 5 for your organization. Learn more: https://learn.microsoft.com/en-us/azure/devops/organizations/security/look-up-project-collection-administrators

Recommendation

1. Go to Organization Settings. 
2. Click on Security -> Permissions. 
3. Groups - Select ' Project Collection Administrators'. 
4. Review all members of this group.

Policy Rule

{
  "target": "ADOSecurityGroupMembers",
  "if": {
    "allOf": [
      {
        "resource": "ADOSecurityGroupMembers",
        "property": "ScopeResource.ResourceType",
        "operator": "equals",
        "value": "organization"
      },
      {
        "resource": "ADOSecurityGroupMembers",
        "property": "ScopeResource.Group.DisplayName",
        "operator": "equals",
        "value": "Project Collection Administrators"
      },
      {
        "resource": "ADOSecurityGroupMembers",
        "property": "TotalUserIdentityCount",
        "operator": "GreaterThan",
        "value": 1
      },
      {
        "resource": "ADOSecurityGroupMembers",
        "property": "TotalUserIdentityCount",
        "operator": "LessThan",
        "value": 4
      }
    ]
  },
  "then": {
    "effect": "Audit"
  }
}