Ensure branch deletions are disabled

When enabling the deletion of a protected branch, any user with at least push access to the repository can delete a branch. This can be potentially dangerous, as a simple human mistake or a hacked account can lead to data loss if a branch is deleted. It is, therefore, crucial to prevent such incidents by denying protected branch deletion.

Risk Level: high
Platform: Github
Spectral Rule ID: GH-HRD031

REMEDIATION

SaaS:

Go to 'Branch protection rule' and mark the checkbox 'Allow deletions'.

  1. Go to https://github.com/<YOUR_ORGANIZATION_NAME>/<YOUR_REPO_NAME>/settings/branches.
  2. Go to section 'Branch protection rule'.
  3. Mark the checkbox 'Allow deletions'.

Read more: