Check provider logo

Custom role has permission to administer resource locks

iam_custom_role_has_permissions_to_administer_resource_locks

Severitymedium
Serviceiam
by Prowler

Azure custom RBAC roles include the Microsoft.Authorization/locks/* action, indicating permission to administer management locks at subscription, resource group, or resource scope.

Risk

Absent a scoped custom role for Microsoft.Authorization/locks/*, lock control falls to broad roles (e.g., Owner), weakening least privilege. Locks can be disabled or altered, enabling unauthorized changes or deletion, harming integrity and availability, and reducing separation of duties and accountability.

Run this check with Prowler CLI

prowler azure --checks iam_custom_role_has_permissions_to_administer_resource_locks

Recommendation

Define a least-privilege custom role restricted to Microsoft.Authorization/locks/* and assign it to a tightly controlled group at minimal scope. Apply separation of duties, use just-in-time elevation, audit lock changes, and avoid broad roles or pipeline identities managing locks. Layer with defense-in-depth controls.

Remediation

CLI

az role definition create --role-definition '{"Name":"<role_name>","Description":"Custom role to administer resource locks","IsCustom":true,"Actions":["Microsoft.Authorization/locks/*"],"NotActions":[],"AssignableScopes":["/subscriptions/<subscription_id>"]}'

Native IaC
Terraform
Other
  1. In the Azure portal, go to the target scope (Subscription or Resource group) and open Access control (IAM)
  2. Click Roles, find your custom role, and select Edit
  3. Go to Permissions > Add permissions
  4. Search for "Microsoft.Authorization/locks" and select Microsoft.Authorization/locks/*
  5. Click Add, then Review + save > Save

Source Code

Resource Type

microsoft.authorization/roledefinitions

References