Check ID:
Provider: GitHub
Service:
Severity: HIGH
Categories:
Resource type:
repository_default_branch_protection_enabledProvider: GitHub
Service:
repositorySeverity: HIGH
Categories:
identity-access, software-supply-chainResource type:
NotDefinedWhat this check verifies
GitHub repository default branch has branch protection rules enabled to restrict direct changes and require reviewed, validated merges. The evaluation determines whether the default branch enforces such rules.Risk
Without default-branch protection, changes can bypass reviews and checks, enabling:- Unauthorized direct pushes/force pushes
- Malicious code injection and workflow tampering
- Accidental deletions or unstable releases This undermines code integrity and service availability.
Recommendation
Enforce branch protection on the default branch:- Require pull requests with approvals (least privilege)
- Enforce required status checks and conversation resolution
- Require signed commits and linear history; block force pushes/deletions
- Restrict push to trusted actors and apply rules to admins Use CODEOWNERS to strengthen review accountability.
Remediation
- CLI
- Terraform
- Dashboard steps
References
- https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/managing-a-branch-protection-rule
- https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches
Where this check fires
This check runs on every scheduled scan against your GitHub account. Findings appear at Cloud Security → Findings filterable byCheck ID = repository_default_branch_protection_enabled. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to GitHub checks