AzureDevOps project Severityhigh builtIn

Description

Recommendation

1. Navigate to Project Settings. 
2. Open the Agent pools link under Pipelines. 
3. Select an agent pool. 
4. Click on Security tab. 
5. Under 'User permissions' section, review security roles and ensure common groups have only read-only access.

Policy Rule

{
  "target": "ADOSecurityRoleAssignment",
  "if": {
    "allOf": [
      {
        "resource": "ADOSecurityRoleAssignment",
        "property": "ScopeResource.ResourceType",
        "operator": "equals",
        "value": "Queue"
      },
      {
        "resource": "ADOSecurityRoleAssignment",
        "property": "ScopeResource.ScopeId",
        "operator": "equals",
        "value": "distributedtask.agentqueuerole"
      },
      {
        "resource": "ADOSecurityRoleAssignment",
        "property": "Identity.DisplayName",
        "operator": "contains",
        "value": "$(POLICY_VAR_PROJECT_SECURITY_ROLES_COMMON_GROUPS)"
      },
      {
        "resource": "ADOSecurityRoleAssignment",
        "property": "Role.Name",
        "operator": "equals",
        "value": "Reader"
      }
    ]
  },
  "then": {
    "effect": "Audit"
  }
}