Ensure branch protection rules are enforced for administrators

By default, the restrictions of a branch protection rule do not apply to people with admin permissions to the repository or custom roles with the "bypass branch protections" permission in a repository.

Risk Level: medium
Platform: Github
Spectral Rule ID: GH-HRD022

REMEDIATION

To enforce branch protections for all Admins and roles with the "Bypass branch protections" permission, enable Do not allow bypassing the above settings in your branch protection rules.

SaaS:

  1. On GitHub.com, navigate to the main page of the repository.
  2. Under your repository name, click Settings.
  3. In the Code and automation section of the sidebar, click Branches.
  4. Click on Branch protection rules. For each rule check Do not allow bypassing the above settings is enabled.

Read more: