# Ensure repository deletion is restricted to admins

- Source: https://support.icompaas.com/support/solutions/articles/a_1789072808181364-ensure-repository-deletion-is-restricted-to-admins
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [Version Control System (VCS)](https://support.icompaas.com/support/solutions/c_1781179095087930) › [Bitbucket](https://support.icompaas.com/support/solutions/folders/f_1781179159125832)
- Last updated: 2026-10-26
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

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

1.  Sign in to Bitbucket at [https://bitbucket.org](https://bitbucket.org/).
    
2.  Navigate to the workspace settings.
    
3.  Select User directory or Workspace permissions settings.
    
4.  Review users and their assigned workspace permissions.
    
5.  Identify users with administrative or owner-level permissions.
    
6.  Verify that repository deletion privileges are limited to authorized administrators only.
    
7.  If unnecessary users have administrative access, follow the implementation steps.
    

Implementation Steps

1.  Sign in to Bitbucket at [https://bitbucket.org](https://bitbucket.org/).
    
2.  Navigate to Workspace settings.
    

3.  Select User groups or Workspace permissions.
    

4.  Review users and groups with elevated permissions.
    
5.  Remove unnecessary users from administrator or owner-level access.
    
6.  Assign users the minimum required permission level based on their responsibilities.
    
7.  Ensure only approved administrators or workspace owners retain repository deletion capabilities.
    
8.  Save the changes.
    

Backout Plan

1.  Sign in to Bitbucket at [https://bitbucket.org](https://bitbucket.org/).
    
2.  Navigate to Workspace settings.
    

3.  Select User groups or Workspace permissions.
    

4.  Locate the user or group whose permission was modified.
    
5.  Restore the previous permission level if elevated access is required.
    
6.  Save the changes.
    
7.  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/workspaces/)
    
-   [https://support.atlassian.com/bitbucket-cloud/docs/groups-and-permissions/](https://support.atlassian.com/bitbucket-cloud/docs/groups-and-permissions/)
    
-   [https://support.atlassian.com/bitbucket-cloud/docs/manage-your-workspace/](https://support.atlassian.com/bitbucket-cloud/docs/manage-your-workspace/)

## Related compliance guidance

- [SOC 2 compliance: a practical implementation guide for cloud-native SaaS teams](https://support.icompaas.com/compliance/soc-2-trust-services-criteria): Configuration checks like this one are the technical half of a SOC 2 / ISO 27001 programme — the guide shows where they fit, what else an auditor expects, and how to evidence them.
- [ISO/IEC 27001:2022 compliance: a practical implementation guide](https://support.icompaas.com/compliance/iso-27001-2022): ISO 27001 Annex A.8 (technological controls) is where cloud hardening evidence lands; the guide shows how to run the ISMS around it.
