AzureDevOps project Severityhigh builtIn

Description

Recommendation

1. Navigate to Project -> Pipelines -> Environments 
2. Select an environment. 
3. Click on the three dots button (top right). 
4. Click on Security. 
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": "Environment"
      },
      {
        "resource": "ADOSecurityRoleAssignment",
        "property": "ScopeResource.ScopeId",
        "operator": "equals",
        "value": "distributedtask.environmentreferencerole"
      },
      {
        "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"
  }
}