rules/findings/azure/storage/azure-storage-account-delete-lock-not-set.json
|
{
"provider": "Azure", "serviceType": "Storage Accounts", "serviceName": "Storage", "displayName": "Ensure Azure Resource Manager Delete locks are applied to Azure Storage Accounts", "description": "Azure Resource Manager CannotDelete (Delete) locks can prevent users from accidentally or maliciously deleting a storage account. This feature ensures that while the Storage account can still be modified or used, deletion of the Storage account resource requires removal of the lock by a user with appropriate permissions.<br/><br/>This feature is a protective control for the availability of data. By ensuring that a storage account or its parent resource group cannot be deleted without first removing the lock, the risk of data loss is reduced.<br/><br/>While an automated assessment procedure exists for this recommendation, the assessment status remains manual. Determining storage accounts that require CannotDelete locks depends on the context and requirements of each organization and environment.", "rationale": "Applying a Delete lock on storage accounts protects the availability of data by preventing the accidental or unauthorized deletion of the entire storage account. It is a fundamental protective control that can prevent data loss", "impact": "• Prevents the deletion of the Storage account Resource entirely.\n• Prevents the deletion of the parent Resource Group containing the locked Storage account resource.\n• Does not prevent other control plane operations, including modification of configurations, network settings, containers, and access.\n• Does not prevent deletion of containers or other objects within the storage account.", "remediation": { "text": "Remediate from Azure Portal 1. Navigate to the storage account in the Azure portal. 2. Under the Settings section, select Locks. 3. Select Add. 4. Provide a Name, and choose Delete for the type of lock. 5. Add a note about the lock if desired.", "code": { "powerShell": null, "iac": null, "terraform": null, "other": null } }, "recommendation": null, "references": [ "https://learn.microsoft.com/en-us/azure/storage/common/lock-account-resource2", "https://learn.microsoft.com/en-us/azure/azure-resource-" ], "compliance": [ { "name": "CIS Microsoft Azure Foundations", "version": "5.0.0", "reference": "9.3.9", "profile": [ "Level 1" ] } ], "level": "info", "tags": [], "rule": { "path": "az_storage_accounts", "subPath": null, "selectCondition": { }, "query": [ { "filter": [ { "conditions": [ [ "properties.level", "eq", "CanNotDelete" ] ], "whereObject":"locks" } ] } ], "shouldExist": "true", "returnObject": null, "removeIfNotExists": null }, "output": { "html": { "data": { "properties": { "name": "Name", "location": "Location", "ResourceGroupName": "ResourceGroupName", "locks": "Locks" }, "expandObject": null }, "table": "default", "decorate": [], "emphasis": [], "actions": { "objectData": { "properties": [ "id", "name", "properties", "locks" ], "expandObject": null, "limit": null }, "showGoToButton": "True", "showModalButton": "True", "directLink": null } }, "text": { "data": { "properties": { "name": "Name", "location": "Location", "ResourceGroupName": "ResourceGroupName", "locks": "Locks" }, "expandObject": null }, "status": { "keyName": ["name"], "message": "Ensure Azure Resource Manager Delete locks are applied to {name} Storage Account", "defaultMessage": "Ensure Azure Resource Manager Delete locks are applied to Azure Storage Accounts" }, "properties": { "resourceName": "name", "resourceId": "id", "resourceType": "AzureStorageAccount" }, "onlyStatus": false } }, "idSuffix": "storage_accounts_delete_lock_not_set", "notes": [ ], "categories": [ ], "immutable_properties": [ "id" ], "id": "azure_storage_019" } |