| name | cis-azure-foundations-6.2 |
| description | Ensure that Resource Locks are set for Mission-Critical Azure Resources |
| category | cis-azure-foundations |
| version | 5.0.0 |
| author | cyberstrike-official |
| tags | ["cis","azure","governance","resource-locks","access-control"] |
| cis_id | 6.2 |
| cis_benchmark | CIS Microsoft Azure Foundations Benchmark v5.0.0 |
| tech_stack | ["azure"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
Ensure that Resource Locks are set for Mission-Critical Azure Resources
Description
Resource Manager Locks provide a way for administrators to lock down Azure resources to prevent deletion of, or modifications to, a resource. These locks sit outside of the Role Based Access Controls (RBAC) hierarchy and, when applied, will place restrictions on the resource for all users. These locks are very useful when there is an important resource in a subscription that users should not be able to delete or change. Locks can help prevent accidental and malicious changes or deletion.
While an automated assessment procedure exists for this recommendation, the assessment status remains manual. Determining resources that require resource locks depends on the context and requirements of each organization and environment.
Rationale
As an administrator, it may be necessary to lock a subscription, resource group, or resource to prevent other users in the organization from accidentally deleting or modifying critical resources. The lock level can be set to CanNotDelete or ReadOnly to achieve this purpose.
CanNotDelete means authorized users can still read and modify a resource, but they cannot delete the resource.
ReadOnly means authorized users can read a resource, but they cannot delete or update the resource. Applying this lock is similar to restricting all authorized users to the permissions granted by the Reader role.
Impact
There can be unintended outcomes of locking a resource. Applying a lock to a parent service will cause it to be inherited by all resources within. Conversely, applying a lock to a resource may not apply to connected storage, leaving it unlocked. Please see the documentation for further information.
Audit Procedure
Using Azure Portal
- Navigate to the specific Azure Resource or Resource Group.
- Click on
Locks.
- Ensure the lock is defined with name and description, with type
Read-only or Delete as appropriate.
Using Azure CLI
Review the list of all locks set currently:
az lock list --resource-group <resourcegroupname> --resource-name <resourcename> --namespace <Namespace> --resource-type <type> --parent ""
Using PowerShell
Run the following command to list all resources:
Get-AzResource
For each resource, run the following command to check for Resource Locks: