Skip to main content
ISSUE-504HighAccess and Authorization

No merge request approval rule covering all protected branches

Control: MR approval rules must cover all protected branchesยท Config key: mergeRequestApprovalRulesMustCoverAllProtectedBranches

๐Ÿ“‹ What is this?

There is no merge request approval rule configured in the project that applies to all protected branches.

โš ๏ธ Impact

Without at least one approval rule for protected branches, they lack the necessary review process, increasing the likelihood of unauthorized or insecure changes being merged.

๐Ÿ”ง How to fix

Create a merge request approval rule in the project that covers all protected branches.

โœ— BeforeNo approval rule covers all protected branches, so some branches can be merged without review.
# GitLab project settings: โŒ No approval rule for all branches
# Settings > Merge requests > Approval rules:
#
# Rule: "QA Team" โ†’ applies to: main
# Rule: "Dev Team" โ†’ applies to: develop
#
# There is no rule that applies to ALL protected branches.
# Branches like release/* have no approval requirement.
โœ“ AfterAn approval rule covering all protected branches ensures consistent review.
# GitLab project settings: โœ… Approval rule covers all protected branches
# Settings > Merge requests > Approval rules:
#
# Rule: "All Approvals" โ†’ applies to: All protected branches
# Eligible approvers: Maintainers
# Approvals required: 1

๐Ÿ’ก Tips

  • Create one 'catch-all' rule that targets all protected branches as a baseline.
  • You can add additional branch-specific rules on top of the catch-all rule.
  • This control complements ISSUE-502 (minimum approvals) for a complete review policy.

โš™๏ธ Configuration

This control is configured in .plumber.yaml under the gitlab section:

gitlab:
  controls:
    mergeRequestApprovalRulesMustCoverAllProtectedBranches:
      enabled: true

See the CLI documentation for the full configuration reference. On Plumber Platform, the same key is used in your policy configuration.