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.

Recommandation

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.

Règle de politique

{
  "target": "GLProtectedBranch",
  "if": {
    "allOf": [
      {
        "resource": "GLProtectedBranch",
        "property": "Name",
        "operator": "match",
        "value": "(main|master|protected|release|live|prod|prd)"
      }
    ]
  },
  "then": {
    "effect": "Audit"
  }
}
Détails de la règle
  • ID de la règle: DOS6043
  • Code: GL_Branch_Name_Should_Match_Important_Pattern
  • Plateforme: GitLab
  • Catégorie: repository
  • Sévérité: Severitylow
  • Type: builtIn