Skip to main content

CI/CD provider

ISSUE-501CriticalAccess and Authorization

Branch protection missing

Control:CTRL-501Branch must be protected

📋 What is this?

A branch is not protected on the repository.

⚠️ Impact

Unprotected branches are highly vulnerable to unauthorized modifications. For instance, any member can push malicious code directly to your production branch without any review or validation.

🔧 How to fix

Enable branch protection on the branch to restrict changes to authorized users only.

✗ BeforeThe `main` branch has no protection, violating the policy.
# GitLab project settings: ❌ Branch not protected
# Branch "main" has no protection rules
# Anyone with Developer access can:
# - Push directly
# - Force push
# - Delete the branch
✓ AfterProper branch protection with restricted push access and code review requirements.
# GitLab project settings: ✅ Branch properly protected
# Settings > Repository > Protected Branches:
#
# Branch: main
# Allowed to merge: Developers + Maintainers
# Allowed to push: Maintainers
# Allow force push: No
# Code owner approval required: Yes

💡 Tips

  • Use namePatterns with wildcards to protect branch families (e.g., release/*).
  • Set minPushAccessLevel: 40 (Maintainer) to prevent developers from pushing directly.
  • Enable codeOwnerApprovalRequired if you use a CODEOWNERS file.

⚙️ Configure this control

On the Plumber Platform: open the Policies page and set control CTRL-501 on the policy that governs the project.

With the CLI alone: set it in your configuration file. Every field and default is in the controls configuration reference, CTRL-501.