GitLab repository Severitylow builtIn

Description

Protected branches should target a meaningful branch name (main, master, release/*, prod*, live*) — not arbitrary feature branches. The match operator uses the regex pattern from the GL_POLICY_VAR_PROJECT_PROTECTED_BRANCH_PATTERNS library variable. Protecting feature/experimental branches inflates inventory and dilutes the meaning of branch protection.

Recommendation

1. Go to project Settings > Repository > Protected branches. 
2. Remove protection from non-essential branches (feature/*, experiment/*, etc.). 
3. Keep protection on main, master (legacy), release/*, prod*, live* branches.

Policy Rule

{
  "target": "GLProtectedBranch",
  "if": {
    "allOf": [
      {
        "resource": "GLProtectedBranch",
        "property": "Name",
        "operator": "match",
        "value": "(main|master|protected|release|live|prod|prd)"
      }
    ]
  },
  "then": {
    "effect": "Audit"
  }
}