GitLab repository Severityhigh builtIn

Description

Protected branches should set allow_force_push = false. Force push rewrites history on the protected branch, breaking downstream clones and bypassing the audit trail of merge-request reviews. Even Maintainers should not have force-push privilege on critical branches.

Recommandation

1. Go to project Settings > Repository > Protected branches. 
2. For each protected branch, ensure Allowed to force push is empty (no roles selected). 
3. Save changes.

Règle de politique

{
  "target": "GLProtectedBranch",
  "if": {
    "allOf": [
      {
        "resource": "GLProtectedBranch",
        "property": "AllowForcePush",
        "operator": "equals",
        "value": false
      }
    ]
  },
  "then": {
    "effect": "Audit"
  }
}
Détails de la règle
  • ID de la règle: DOS6040
  • Code: GL_Branch_ForcePush_Should_Be_Disabled
  • Plateforme: GitLab
  • Catégorie: repository
  • Sévérité: Severityhigh
  • Type: builtIn