GitLab repository Severitymedium builtIn

Description

Protected branch entries should not use the literal wildcard '*' as their name pattern. Protecting every branch defeats the purpose of branch protection (which exists to distinguish important branches from working branches) and makes CI/CD branch-detection hostile.

Recommendation

1. Go to project Settings > Repository > Protected branches. 
2. Remove any entry where the branch pattern is '*'. 
3. Replace with specific patterns (main, release/*, prod*, etc.).

Policy Rule

{
  "target": "GLProtectedBranch",
  "if": {
    "allOf": [
      {
        "resource": "GLProtectedBranch",
        "property": "Name",
        "operator": "notEquals",
        "value": "*"
      }
    ]
  },
  "then": {
    "effect": "Audit"
  }
}