Description
A shared storage account key gives clients broad data access and makes individual actions hard to attribute.
Potential impact
A leaked key can permit reads or changes. Disabling Shared Key also rejects service and account SAS tokens signed with the account key.
Remediation
Check each client’s supported authentication, including Azure Files and operational tools. Migrate clients to supported Microsoft Entra authentication and the data roles they need. Test their normal operations before setting shared_access_key_enabled = false. Check which SAS types they use. Valid user delegation SAS tokens for blobs can still work.
Examples
The second excerpt describes a differently named Premium FileStorage account in another resource group and region, with different replication. Keep the existing account’s name, kind and deployment settings when changing only authorization.
Before
resource "azurerm_storage_account" "example" {
name = "examplestorage"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
account_tier = "Standard"
account_replication_type = "GRS"
shared_access_key_enabled = true
}
After
resource "azurerm_storage_account" "example" {
name = "safestorage"
resource_group_name = "testRG"
location = "northeurope"
account_tier = "Premium"
account_replication_type = "LRS"
account_kind = "FileStorage"
shared_access_key_enabled = false
}