Information
Resource locking is a powerful protection mechanism that can prevent inadvertent modification or deletion of resources within Azure subscriptions and resource groups, and it is a recommended NIST configuration.
Given that the resource lock functionality is outside of standard Role-Based Access Control (RBAC), it would be prudent to create a resource lock administrator role to prevent inadvertent unlocking of resources.
NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance.
Solution
Remediate from Azure Portal
- In the Azure portal, navigate to a subscription or resource group.
- Click Access control (IAM)
- Click + Add
- Click Add custom role
- In the Custom role name field enter Resource Lock Administrator
- In the Description field enter Can Administer Resource Locks
- For Baseline permissions select Start from scratch
- Click Next
- Click Add permissions
- In the Search for a permission box, type Microsoft.Authorization/locks
- Click the result.
- Check the box next to Permission
- Click Add
- Click Review + create
- Click Create
- Click OK
- Click + Add
- Click Add role assignment
- In the Search by role name, description, permission, or ID box, type Resource Lock Administrator
- Select the role.
- Click Next
- Click + Select members
- Select appropriate members.
- Click Select
- Click Review + assign
- Click Review + assign again.
- Repeat steps 1-26 for each subscription or resource group requiring remediation.
Remediate from PowerShell:
Below is a PowerShell definition for a resource lock administrator role created at an Azure Management group level
Import-Module Az.Accounts
Connect-AzAccount
$role = Get-AzRoleDefinition "User Access Administrator"
$role.Id = $null
$role.Name = "Resource Lock Administrator"
$role.Description = "Can Administer Resource Locks"
$role.Actions.Clear()
$role.Actions.Add("Microsoft.Authorization/locks/*")
$role.AssignableScopes.Clear()
* Scope at the Management group level Management group
$role.AssignableScopes.Add("/providers/Microsoft.Management/managementGroups/MG-Name")
New-AzRoleDefinition -Role $role
Get-AzureRmRoleDefinition "Resource Lock Administrator"
Impact:
By adding this role, specific permissions may be granted for managing only resource locks rather than needing to provide the broad Owner or User Access Administrator role, reducing the risk of the user being able to cause unintentional damage.
Item Details
Category: ACCESS CONTROL, AUDIT AND ACCOUNTABILITY, MEDIA PROTECTION
References: 800-53|AC-2, 800-53|AC-3, 800-53|AC-5, 800-53|AC-6, 800-53|AC-6(1), 800-53|AC-6(7), 800-53|AU-9(4), 800-53|MP-2, CSCv7|14.6
Control ID: a1ad0eafcb67bf76cb411b1c96e48a878077046a8c95a86ace1dd139da0ba440