Description
This check verifies that repository deletion permissions within a Bitbucket workspace are limited to authorized administrators or workspace owners. Restricting repository deletion privileges ensures that only trusted users can perform destructive repository management actions. Workspace-level permissions determine the level of access users have across repositories. Limiting repository deletion capabilities reduces the risk of accidental or unauthorized removal of repositories containing critical source code, configuration, or project history.
Note: Only repository-level branch restrictions are detected. Restrictions set only at the project level are not returned by Bitbucket’s API and will result in a FAIL. Configure the restriction at the repository level for accurate results.
Rationale
Repository deletion is a destructive operation that can permanently remove source code, commit history, issues, pull requests, and associated repository data. Allowing multiple users with elevated permissions to delete repositories increases the likelihood of accidental deletion or unauthorized removal of important resources. Restricting repository deletion privileges to workspace administrators or owners ensures that destructive actions are performed only by authorized personnel and supports the principle of least privilege.
Impact
Prevent non-administrative users from permanently deleting repositories.
Reduce the risk of accidental or malicious repository removal.
Require workspace administrators to approve and perform repository deletion activities.
Improve governance and accountability for destructive repository operations.
Ensure critical repositories remain protected from unauthorized changes.
Default Value
Depends on workspace configuration. Bitbucket workspace permissions determine which users have administrative capabilities. Repository deletion access is typically available to users with elevated workspace or repository administration permissions unless restricted through proper access management.
Pre-Requisites
Workspace administrator access
An existing Bitbucket workspace
Test Plan
Sign in to Bitbucket at https://bitbucket.org.
Navigate to the workspace settings.
Select User directory or Workspace permissions settings.
Review users and their assigned workspace permissions.
Identify users with administrative or owner-level permissions.
Verify that repository deletion privileges are limited to authorized administrators only.
If unnecessary users have administrative access, follow the implementation steps.
Implementation Steps
Sign in to Bitbucket at https://bitbucket.org.
Navigate to Workspace settings.
Select User groups or Workspace permissions.
Review users and groups with elevated permissions.
Remove unnecessary users from administrator or owner-level access.
Assign users the minimum required permission level based on their responsibilities.
Ensure only approved administrators or workspace owners retain repository deletion capabilities.
Save the changes.
Backout Plan
Sign in to Bitbucket at https://bitbucket.org.
Navigate to Workspace settings.
Select User groups or Workspace permissions.
Locate the user or group whose permission was modified.
Restore the previous permission level if elevated access is required.
Save the changes.
Confirm that workspace operations function as expected after the rollback.
Reference
https://support.atlassian.com/bitbucket-cloud/docs/workspaces/
https://support.atlassian.com/bitbucket-cloud/docs/groups-and-permissions/
https://support.atlassian.com/bitbucket-cloud/docs/manage-your-workspace/