Skip to main content
Five Steps for Cloud Compliance Readiness·A practical playbook for security teamsDownload
CIS Microsoft Azure Foundations v6.0.0 · 5.5

A custom role should exist for administering resource locks

  • Level 2
  • Identity Services

This check looks at whether your Azure environment has a custom role that grants the permissions to create and delete resource locks. The safe setting is to have that role, so lock management is given to named people without handing out Owner.

Why it matters

Resource locks stop accidental deletion or change of important resources, and they apply to every user and role. Microsoft Learn explains that creating or deleting a lock needs the Microsoft.Authorization/locks/* actions, which the Owner and User Access Administrator roles carry. Those roles are far broader than lock management.

Without a dedicated role, teams either give out Owner just so someone can manage locks, or nobody is allowed to and critical resources go unprotected. A narrow custom role lets you hand out only that one power. See the source below.

How to check it yourself

In the Azure portal open Subscriptions, choose a subscription, then Access control (IAM) → Roles, set the type filter to CustomRole and open each role's Permissions. Look for the Microsoft.Authorization/locks actions.

The same view with the Azure CLI is read-only:

az role definition list --custom-role-only true \
  --query "[].{name:roleName, actions:permissions[0].actions}" -o json

Find a role whose actions include Microsoft.Authorization/locks/*. Run it once per subscription you assess.

How to fix it

In the portal choose Access control (IAM) → Add → Add custom role, start from scratch, add the permission Microsoft.Authorization/locks/* and set the assignable scope. With the Azure CLI, save the definition below as lock-admin.json (use your own subscription ID) and create the role:

{
  "Name": "Resource Lock Administrator",
  "Description": "Can create and delete resource locks.",
  "Actions": ["Microsoft.Authorization/locks/*", "Microsoft.Resources/subscriptions/resourceGroups/read"],
  "AssignableScopes": ["/subscriptions/00000000-0000-0000-0000-000000000000"]
}

az role definition create --role-definition lock-admin.json

Then assign the role to the people who should manage locks. You run these steps yourself. ConfigCobra reads your subscriptions with Reader access and never writes to Azure.

What changes when you fix it

Creating the role changes nothing for existing resources or users. The change comes when you assign it: the holders can add and remove locks anywhere the role is assigned, so choose a small group such as the platform or cloud operations team.

It also lets you take lock management away from people who only hold Owner for that reason. Be aware that locks themselves have side effects. Microsoft Learn notes that a read-only lock can block operations that look harmless, for example starting a virtual machine in a locked resource group, so test locks on a non-production scope first.

Included in

BenchmarkCIS IDProfile
CIS Microsoft Azure Foundations v6.0.05.5Level 2

Check this on your Microsoft Azure

ConfigCobra runs this check with every other control of the CIS Microsoft Azure Benchmarks, read-only.

Get in touch

Let's talk.

Whether you're evaluating ConfigCobra, running an audit, or managing a client fleet — we respond within one business day.

Free trial