rules/findings/azure/IAM/azure-custom-role-admin-lock-not-set.json
|
{
"provider": "Azure", "serviceType": "Subscription Identity", "serviceName": "Subscription", "displayName": "Ensure that a custom role is assigned permissions for administering resource locks", "description": "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.", "rationale": "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.", "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.", "remediation": { "text": " #### Remediate from Azure Portal 1. In the Azure portal, navigate to a subscription or resource group. 2. Click Access control (IAM). 3. Click + Add. 4. Click Add custom role. 5. In the Custom role name field enter Resource Lock Administrator. 6. In the Description field enter Can Administer Resource Locks. 7. For Baseline permissions select Start from scratch. 8. Click Next. 9. Click Add permissions. 10. In the Search for a permission box, type Microsoft.Authorization/locks. 11. Click the result. 12. Check the box next to Permission. 13. Click Add. 14. Click Review + create. 15. Click Create. 16. Click OK. 17. Click + Add. 18. Click Add role assignment. 19. In the Search by role name, description, permission, or ID box, type Resource Lock Administrator. 20. Select the role. 21. Click Next. 22. Click + Select members. 23. Select appropriate members. 24. Click Select. 25. Click Review + assign. 26. Click Review + assign again. 27. Repeat steps 1-26 for each subscription or resource group requiring remediation. ", "code": { "powerShell": null, "iac": null, "terraform": null, "other": null } }, "recommendation": null, "references": [ "https://learn.microsoft.com/en-us/azure/role-based-access-control/custom-roles", "https://learn.microsoft.com/en-us/azure/role-based-access-control/check-access?tabs=default", "https://learn.microsoft.com/en-us/security/benchmark/azure/mcsb-privileged-access#pa-1-separate-and-limit-highly-privilegedadministrative-users", "https://learn.microsoft.com/en-us/security/benchmark/azure/mcsb-privileged-access#pa-7-follow-just-enough-administration-least-privilege-principle", "https://learn.microsoft.com/en-us/security/benchmark/azure/mcsb-privileged-access#pa-3-manage-lifecycle-of-identities-and-entitlements", "https://learn.microsoft.com/en-us/security/benchmark/azure/mcsb-governance-strategy#gs-2-define-and-implement-enterprise-segmentationseparation-of-duties-strategy", "https://learn.microsoft.com/en-us/security/benchmark/azure/mcsb-governance-strategy#gs-6-define-and-implement-identity-and-privileged-access-strategy" ], "compliance": [ { "name": "CIS Microsoft Azure Foundations", "version": "6.0.0", "reference": "5.5", "profile": [ "Level 2" ] } ], "level": "low", "tags": [], "rule": { "path": "az_role_definitions", "subPath": null, "selectCondition": {}, "data": { "properties": { "id": "id", "properties.roleName": "Role", "properties.type": "Type", "properties.description": "Description", "properties": "properties" } }, "query": [ { "filter": [ { "conditions": [ [ "properties.type", "eq", "CustomRole" ], [ "properties.permissions.actions", "match", "Microsoft.Authorization/locks/*" ] ], "operator": "and" } ] } ], "shouldExist": true, "returnObject": { "Role": "Custom Resource Lock Administrator", "Type": "Type", "Description": "Description", "Status": "Missing" }, "removeIfNotExists": null }, "output": { "html": { "data": { "properties": { "id": "Id", "Role": "Role", "Type": "Type", "Description": "Description" }, "expandObject": null }, "table": "default", "decorate": [], "emphasis": [], "actions": { "objectData": { "properties": [ "id", "properties" ], "expandObject": null, "limit": null }, "showGoToButton": "True", "showModalButton": "True", "directLink": null } }, "text": { "data": { "properties": { "id": "Id", "Role": "Role", "Type": "Type", "Description": "Description" }, "expandObject": null }, "status": { "keyName": [ "Role" ], "message": "A {Role} for administering resource locks was not found", "defaultMessage": "Ensure that a custom role is assigned permissions for administering resource locks" }, "properties": { "resourceName": null, "resourceId": null, "resourceType": null }, "onlyStatus": false } }, "idSuffix": "azure_iam_missing_admin_lock", "notes": [ ], "categories": [ ], "immutable_properties": [ "id" ], "id": "azure_iam_002" } |